@gemafajarramadhan/dynamic-ui 1.2.37 → 1.2.39
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/dynamic-ui.css +1 -1
- package/dist/dynamic-ui.es.js +5583 -5404
- package/dist/dynamic-ui.umd.js +9 -9
- package/dist/index.d.ts +33 -0
- package/package.json +1 -1
- package/src/index.d.ts +33 -0
package/dist/dynamic-ui.umd.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(de,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-i18n"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-i18n","vue-router","vue3-lottie"],n):(de=typeof globalThis<"u"?globalThis:de||self,n(de.DynamicUI={},de.Vue,de.LucideIcons,de.rekaUi,de.core,de.VueDatePicker,de.Uppy,de.UppyDashboard,de.UppyImageEditor,de.VueI18n,de.VueRouter,de.Vue3Lottie))})(this,(function(de,n,ae,ue,Re,Jd,Qd,Os,Zd,Xt,Dn,eu){"use strict";var MS=Object.defineProperty;var NS=(de,n,ae)=>n in de?MS(de,n,{enumerable:!0,configurable:!0,writable:!0,value:ae}):de[n]=ae;var me=(de,n,ae)=>NS(de,typeof n!="symbol"?n+"":n,ae);var Ha;function tu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Et=tu(ae);let xt={};function zs(e){xt={...xt,...e}}function nu(){return xt}function ou(){return xt.apiBaseUrl?xt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function au(){const e={"Content-Type":"application/json",Accept:"application/json"};let t=null;if(xt.getAuthToken?t=xt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?t=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(t=localStorage.getItem("token")||sessionStorage.getItem("token")),t&&(e.Authorization=`Bearer ${t}`),xt.getHeaders){const o=xt.getHeaders();return{...e,...o}}return e}function ru(){xt.onUnauthorized&&xt.onUnauthorized()}async function Fs(e,t,o,a){const r=nu();if(r.apiClient)return r.apiClient(e,t||"GET",o);if(!e||!e.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(t||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${t}' tidak valid, fallback ke 'GET'.`);const c=ou(),d=e.startsWith("http")?e:`${c}${e}`,u={method:l,headers:{...au(),...a||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const p=new URLSearchParams;Object.entries(o).forEach(([y,g])=>{g!=null&&p.append(y,String(g))});const b=p.toString();b&&(f=`${d}${d.includes("?")?"&":"?"}${b}`)}const h=await fetch(f,u);if(h.status===401&&ru(),!h.ok){const p=await h.text();throw new Error(`HTTP ${h.status}: ${p}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function Je(){return{apiUrl:(o,a,r,s)=>Fs(o,a,r,s),DCodeApi:(o,a,r,s)=>{let i=o,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${a}`,l="POST")),Fs(i,l,c,s==null?void 0:s.headers)}}}const Mn=Math.min,dt=Math.max,Po=Math.round,vo=Math.floor,St=e=>({x:e,y:e}),su={left:"right",right:"left",bottom:"top",top:"bottom"},iu={start:"end",end:"start"};function Rs(e,t,o){return dt(e,Mn(t,o))}function Jn(e,t){return typeof e=="function"?e(t):e}function Yt(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function Is(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}const lu=new Set(["top","bottom"]);function Ft(e){return lu.has(Yt(e))?"y":"x"}function $s(e){return Is(Ft(e))}function cu(e,t,o){o===void 0&&(o=!1);const a=Qn(e),r=$s(e),s=Ls(r);let i=r==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=To(i)),[i,To(i)]}function du(e){const t=To(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>iu[t])}const Ws=["left","right"],js=["right","left"],uu=["top","bottom"],fu=["bottom","top"];function hu(e,t,o){switch(e){case"top":case"bottom":return o?t?js:Ws:t?Ws:js;case"left":case"right":return t?uu:fu;default:return[]}}function mu(e,t,o,a){const r=Qn(e);let s=hu(Yt(e),o==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(tr)))),s}function To(e){return e.replace(/left|right|bottom|top/g,t=>su[t])}function pu(e){return{top:0,right:0,bottom:0,left:0,...e}}function gu(e){return typeof e!="number"?pu(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:o,width:a,height:r}=e;return{width:a,height:r,top:o,left:t,right:t+a,bottom:o+r,x:t,y:o}}function Us(e,t,o){let{reference:a,floating:r}=e;const s=Ft(t),i=$s(t),l=Ls(i),c=Yt(t),d=s==="y",u=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,h=a[l]/2-r[l]/2;let m;switch(c){case"top":m={x:u,y:a.y-r.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-r.width,y:f};break;default:m={x:a.x,y:a.y}}switch(Qn(t)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function bu(e,t){var o;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Jn(t,e),p=gu(m),y=l[h?f==="floating"?"reference":"floating":f],g=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(y)))==null||o?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),B=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:B,offsetParent:w,strategy:c}):B);return{top:(g.top-E.top+p.top)/C.y,bottom:(E.bottom-g.bottom+p.bottom)/C.y,left:(g.left-E.left+p.left)/C.x,right:(E.right-g.right+p.right)/C.x}}const yu=async(e,t,o)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=o,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Us(d,a,c),h=a,m={},p=0;for(let y=0;y<l.length;y++){var b;const{name:g,fn:B}=l[y],{x:w,y:C,data:E,reset:_}=await B({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:m,rects:d,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:bu},elements:{reference:e,floating:t}});u=w??u,f=C??f,m={...m,[g]:{...m[g],...E}},_&&p<=50&&(p++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(d=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:u,y:f}=Us(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:m}},xu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...y}=Jn(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const g=Yt(r),B=Ft(l),w=Yt(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(w||!b?[To(l)]:du(l)),_=p!=="none";!h&&_&&E.push(...mu(l,b,p,C));const k=[l,...E],x=await c.detectOverflow(t,y),A=[];let D=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&A.push(x[g]),f){const T=cu(r,i,C);A.push(x[T[0]],x[T[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(T=>T<=0)){var M,V;const T=(((M=s.flip)==null?void 0:M.index)||0)+1,K=k[T];if(K&&(!(f==="alignment"?B!==Ft(K):!1)||D.every(q=>Ft(q.placement)===B?q.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:K}};let R=(V=D.filter(I=>I.overflows[0]<=0).sort((I,q)=>I.overflows[1]-q.overflows[1])[0])==null?void 0:V.placement;if(!R)switch(m){case"bestFit":{var N;const I=(N=D.filter(q=>{if(_){const ne=Ft(q.placement);return ne===B||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:N[0];I&&(R=I);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}},ku=new Set(["left","top"]);async function wu(e,t){const{placement:o,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Yt(o),l=Qn(o),c=Ft(o)==="y",d=ku.has(i)?-1:1,u=s&&c?-1:1,f=Jn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Cu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await wu(t,e);return i===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},Bu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:g=>{let{x:B,y:w}=g;return{x:B,y:w}}},...d}=Jn(e,t),u={x:o,y:a},f=await s.detectOverflow(t,d),h=Ft(Yt(r)),m=Is(h);let p=u[m],b=u[h];if(i){const g=m==="y"?"top":"left",B=m==="y"?"bottom":"right",w=p+f[g],C=p-f[B];p=Rs(w,p,C)}if(l){const g=h==="y"?"top":"left",B=h==="y"?"bottom":"right",w=b+f[g],C=b-f[B];b=Rs(w,b,C)}const y=c.fn({...t,[m]:p,[h]:b});return{...y,data:{x:y.x-o,y:y.y-a,enabled:{[m]:i,[h]:l}}}}}},_u=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Jn(e,t),u=await i.detectOverflow(t,d),f=Yt(r),h=Qn(r),m=Ft(r)==="y",{width:p,height:b}=s.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,y=h==="end"?"top":"bottom");const B=b-u.top-u.bottom,w=p-u.left-u.right,C=Mn(b-u[y],B),E=Mn(p-u[g],w),_=!t.middlewareData.shift;let k=C,x=E;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(x=w),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(k=B),_&&!h){const D=dt(u.left,0),M=dt(u.right,0),V=dt(u.top,0),N=dt(u.bottom,0);m?x=p-2*(D!==0||M!==0?D+M:dt(u.left,u.right)):k=b-2*(V!==0||N!==0?V+N:dt(u.top,u.bottom))}await c({...t,availableWidth:x,availableHeight:k});const A=await i.getDimensions(l.floating);return p!==A.width||b!==A.height?{reset:{rects:!0}}:{}}}};function zo(){return typeof window<"u"}function fn(e){return nr(e)?(e.nodeName||"").toLowerCase():"#document"}function ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(nr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nr(e){return zo()?e instanceof Node||e instanceof ut(e).Node:!1}function kt(e){return zo()?e instanceof Element||e instanceof ut(e).Element:!1}function Vt(e){return zo()?e instanceof HTMLElement||e instanceof ut(e).HTMLElement:!1}function Hs(e){return!zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ut(e).ShadowRoot}const Eu=new Set(["inline","contents"]);function Zn(e){const{overflow:t,overflowX:o,overflowY:a,display:r}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+o)&&!Eu.has(r)}const Su=new Set(["table","td","th"]);function Au(e){return Su.has(fn(e))}const Vu=[":popover-open",":modal"];function Fo(e){return Vu.some(t=>{try{return e.matches(t)}catch{return!1}})}const Du=["transform","translate","scale","rotate","perspective"],Mu=["transform","translate","scale","rotate","perspective","filter"],Nu=["paint","layout","strict","content"];function or(e){const t=ar(),o=kt(e)?wt(e):e;return Du.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||Mu.some(a=>(o.willChange||"").includes(a))||Nu.some(a=>(o.contain||"").includes(a))}function Pu(e){let t=Kt(e);for(;Vt(t)&&!Nn(t);){if(or(t))return t;if(Fo(t))return null;t=Kt(t)}return null}function ar(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vu=new Set(["html","body","#document"]);function Nn(e){return vu.has(fn(e))}function wt(e){return ut(e).getComputedStyle(e)}function Ro(e){return kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kt(e){if(fn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hs(e)&&e.host||At(e);return Hs(t)?t.host:t}function qs(e){const t=Kt(e);return Nn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vt(t)&&Zn(t)?t:qs(t)}function eo(e,t,o){var a;t===void 0&&(t=[]),o===void 0&&(o=!0);const r=qs(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=ut(r);if(s){const l=rr(i);return t.concat(i,i.visualViewport||[],Zn(r)?r:[],l&&o?eo(l):[])}return t.concat(r,eo(r,[],o))}function rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){const t=wt(e);let o=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Vt(e),s=r?e.offsetWidth:o,i=r?e.offsetHeight:a,l=Po(o)!==s||Po(a)!==i;return l&&(o=s,a=i),{width:o,height:a,$:l}}function sr(e){return kt(e)?e:e.contextElement}function Pn(e){const t=sr(e);if(!Vt(t))return St(1);const o=t.getBoundingClientRect(),{width:a,height:r,$:s}=Gs(t);let i=(s?Po(o.width):o.width)/a,l=(s?Po(o.height):o.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Tu=St(0);function Xs(e){const t=ut(e);return!ar()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==ut(e)?!1:t}function hn(e,t,o,a){t===void 0&&(t=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=sr(e);let i=St(1);t&&(a?kt(a)&&(i=Pn(a)):i=Pn(e));const l=Ou(s,o,a)?Xs(s):St(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const h=ut(s),m=a&&kt(a)?ut(a):a;let p=h,b=rr(p);for(;b&&a&&m!==p;){const y=Pn(b),g=b.getBoundingClientRect(),B=wt(b),w=g.left+(b.clientLeft+parseFloat(B.paddingLeft))*y.x,C=g.top+(b.clientTop+parseFloat(B.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=C,p=ut(b),b=rr(p)}}return Oo({width:u,height:f,x:c,y:d})}function Io(e,t){const o=Ro(e).scrollLeft;return t?t.left+o:hn(At(e)).left+o}function Ys(e,t){const o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-Io(e,o),r=o.top+t.scrollTop;return{x:a,y:r}}function zu(e){let{elements:t,rect:o,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=At(a),l=t?Fo(t.floating):!1;if(a===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=St(1);const u=St(0),f=Vt(a);if((f||!f&&!s)&&((fn(a)!=="body"||Zn(i))&&(c=Ro(a)),Vt(a))){const m=hn(a);d=Pn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?Ys(i,c):St(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Fu(e){return Array.from(e.getClientRects())}function Ru(e){const t=At(e),o=Ro(e),a=e.ownerDocument.body,r=dt(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=dt(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+Io(e);const l=-o.scrollTop;return wt(a).direction==="rtl"&&(i+=dt(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ks=25;function Iu(e,t){const o=ut(e),a=At(e),r=o.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=ar();(!u||u&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Io(a);if(d<=0){const u=a.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(a.clientWidth-f.clientWidth-m);p<=Ks&&(s-=p)}else d<=Ks&&(s+=d);return{width:s,height:i,x:l,y:c}}const Lu=new Set(["absolute","fixed"]);function $u(e,t){const o=hn(e,!0,t==="fixed"),a=o.top+e.clientTop,r=o.left+e.clientLeft,s=Vt(e)?Pn(e):St(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function Js(e,t,o){let a;if(t==="viewport")a=Iu(e,o);else if(t==="document")a=Ru(At(e));else if(kt(t))a=$u(t,o);else{const r=Xs(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oo(a)}function Qs(e,t){const o=Kt(e);return o===t||!kt(o)||Nn(o)?!1:wt(o).position==="fixed"||Qs(o,t)}function Wu(e,t){const o=t.get(e);if(o)return o;let a=eo(e,[],!1).filter(l=>kt(l)&&fn(l)!=="body"),r=null;const s=wt(e).position==="fixed";let i=s?Kt(e):e;for(;kt(i)&&!Nn(i);){const l=wt(i),c=or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Lu.has(r.position)||Zn(i)&&!c&&Qs(e,i))?a=a.filter(u=>u!==i):r=l,i=Kt(i)}return t.set(e,a),a}function ju(e){let{element:t,boundary:o,rootBoundary:a,strategy:r}=e;const i=[...o==="clippingAncestors"?Fo(t)?[]:Wu(t,this._c):[].concat(o),a],l=i[0],c=i.reduce((d,u)=>{const f=Js(t,u,r);return d.top=dt(f.top,d.top),d.right=Mn(f.right,d.right),d.bottom=Mn(f.bottom,d.bottom),d.left=dt(f.left,d.left),d},Js(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uu(e){const{width:t,height:o}=Gs(e);return{width:t,height:o}}function Hu(e,t,o){const a=Vt(t),r=At(t),s=o==="fixed",i=hn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=St(0);function d(){c.x=Io(r)}if(a||!a&&!s)if((fn(t)!=="body"||Zn(r))&&(l=Ro(t)),a){const m=hn(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?Ys(r,l):St(0),f=i.left+l.scrollLeft-c.x-u.x,h=i.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function ir(e){return wt(e).position==="static"}function Zs(e,t){if(!Vt(e)||wt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return At(e)===o&&(o=o.ownerDocument.body),o}function ei(e,t){const o=ut(e);if(Fo(e))return o;if(!Vt(e)){let r=Kt(e);for(;r&&!Nn(r);){if(kt(r)&&!ir(r))return r;r=Kt(r)}return o}let a=Zs(e,t);for(;a&&Au(a)&&ir(a);)a=Zs(a,t);return a&&Nn(a)&&ir(a)&&!or(a)?o:a||Pu(e)||o}const qu=async function(e){const t=this.getOffsetParent||ei,o=this.getDimensions,a=await o(e.floating);return{reference:Hu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Gu(e){return wt(e).direction==="rtl"}const Xu={convertOffsetParentRelativeRectToViewportRelativeRect:zu,getDocumentElement:At,getClippingRect:ju,getOffsetParent:ei,getElementRects:qu,getClientRects:Fu,getDimensions:Uu,getScale:Pn,isElement:kt,isRTL:Gu};function ti(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yu(e,t){let o=null,a;const r=At(e);function s(){var l;clearTimeout(a),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||t(),!h||!m)return;const p=vo(f),b=vo(r.clientWidth-(u+h)),y=vo(r.clientHeight-(f+m)),g=vo(u),w={rootMargin:-p+"px "+-b+"px "+-y+"px "+-g+"px",threshold:dt(0,Mn(1,c))||1};let C=!0;function E(_){const k=_[0].intersectionRatio;if(k!==c){if(!C)return i();k?i(!1,k):a=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!ti(d,e.getBoundingClientRect())&&i(),C=!1}try{o=new IntersectionObserver(E,{...w,root:r.ownerDocument})}catch{o=new IntersectionObserver(E,w)}o.observe(e)}return i(!0),s}function lr(e,t,o,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=sr(e),u=r||s?[...d?eo(d):[],...eo(t)]:[];u.forEach(g=>{r&&g.addEventListener("scroll",o,{passive:!0}),s&&g.addEventListener("resize",o)});const f=d&&l?Yu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(g=>{let[B]=g;B&&B.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),o()}),d&&!c&&m.observe(d),m.observe(t));let p,b=c?hn(e):null;c&&y();function y(){const g=hn(e);b&&!ti(b,g)&&o(),b=g,p=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(B=>{r&&B.removeEventListener("scroll",o),s&&B.removeEventListener("resize",o)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const cr=Cu,dr=Bu,ur=xu,fr=_u,Ku=(e,t,o)=>{const a=new Map,r={platform:Xu,...o},s={...r.platform,_c:a};return yu(e,t,{...r,platform:s})};function Ju(e){return e!=null&&typeof e=="object"&&"$el"in e}function ni(e){if(Ju(e)){const t=e.$el;return nr(t)&&fn(t)==="#comment"?null:t}return e}function to(e){return typeof e=="function"?e():n.unref(e)}function oi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ai(e,t){const o=oi(e);return Math.round(t*o)/o}function hr(e,t,o){o===void 0&&(o={});const a=o.whileElementsMounted,r=n.computed(()=>{var k;return(k=to(o.open))!=null?k:!0}),s=n.computed(()=>to(o.middleware)),i=n.computed(()=>{var k;return(k=to(o.placement))!=null?k:"bottom"}),l=n.computed(()=>{var k;return(k=to(o.strategy))!=null?k:"absolute"}),c=n.computed(()=>{var k;return(k=to(o.transform))!=null?k:!0}),d=n.computed(()=>ni(e.value)),u=n.computed(()=>ni(t.value)),f=n.ref(0),h=n.ref(0),m=n.ref(l.value),p=n.ref(i.value),b=n.shallowRef({}),y=n.ref(!1),g=n.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const x=ai(u.value,f.value),A=ai(u.value,h.value);return c.value?{...k,transform:"translate("+x+"px, "+A+"px)",...oi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:x+"px",top:A+"px"}});let B;function w(){if(d.value==null||u.value==null)return;const k=r.value;Ku(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(x=>{f.value=x.x,h.value=x.y,m.value=x.strategy,p.value=x.placement,b.value=x.middlewareData,y.value=k!==!1})}function C(){typeof B=="function"&&(B(),B=void 0)}function E(){if(C(),a===void 0){w();return}if(d.value!=null&&u.value!=null){B=a(d.value,u.value,w);return}}function _(){r.value||(y.value=!1)}return n.watch([s,i,l,r],w,{flush:"sync"}),n.watch([d,u],E,{flush:"sync"}),n.watch(r,_,{flush:"sync"}),n.getCurrentScope()&&n.onScopeDispose(C),{x:n.shallowReadonly(f),y:n.shallowReadonly(h),strategy:n.shallowReadonly(m),placement:n.shallowReadonly(p),middlewareData:n.shallowReadonly(b),isPositioned:n.shallowReadonly(y),floatingStyles:g,update:w}}const Qu=["aria-busy"],Zu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ef=["for"],tf={key:0,class:"ml-1 text-destructive"},nf={class:"relative"},of={key:0,class:"flex items-center text-gray-500 gap-2"},af=["id","placeholder","disabled","readonly","value"],rf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},sf=["disabled"],lf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},cf=["onMouseenter","onClick"],df={key:0},uf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},ff={key:0},hf={key:1},mf={key:2},pf={key:1,class:"mt-1 text-xs text-red-600"},Lo=n.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>r.label??void 0),i=G=>{const le=r[G];return le===""||le===!0||le==="true"||le===1||le==="1"},l=n.ref(!1),c=n.computed(()=>o.itemTitle||r["item-title"]||r.itemTitle||"name"),d=n.computed(()=>o.itemValue||r["item-value"]||r.itemValue||"id"),u=n.computed(()=>o.disabled),f=n.computed(()=>i("required")),h=n.computed(()=>i("readonly")),m=n.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=n.computed(()=>f.value||i("aria-required")),b=n.computed(()=>o.error||o.errorMessage||r["error-message"]),y=n.computed(()=>r.placeholder??""),g=n.computed(()=>{const G=r.minChars??r["min-chars"];if(G==null||G==="")return 0;const le=typeof G=="number"?G:Number.parseInt(String(G),10);return Number.isFinite(le)&&le>0?le:0}),B=n.computed(()=>{const G=r.rules;return Array.isArray(G)?G:[]}),w=n.computed(()=>{const G=r.id||r.label;return G?`app-autocomplete-${G}-${Math.random().toString(36).slice(2,7)}`:void 0}),C=n.ref(o.modelValue),E=n.ref([]),_=n.ref(!1),k=n.ref(!1),x=n.computed(()=>r.items),A=n.computed(()=>{const G=T.value;return G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems?E.value:x.value??[]}),D=n.computed(()=>!!r.loading),M=n.computed(()=>D.value||_.value),V=n.computed(()=>{const{label:G,items:le,loading:be,rules:Oe,"item-title":De,"item-value":Z,itemTitle:se,itemValue:ce,minChars:we,"min-chars":je,clearable:Ot,required:qa,"aria-required":zd,disabled:Ga,readonly:Fd,visible:rt,"return-object":Rd,returnObject:Xa,class:Id,"fetch-items":Ya,fetchItems:Ld,error:vs,errorMessage:$d,"error-message":Wd,...Ka}=r||{};return Ka}),N=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=n.computed(()=>{const G=o.endpoint||{};return{apiModule:o.apiModule||G.apiModule,apiAction:o.apiAction||G.apiAction,apiUrl:G.apiUrl,apiMethod:G.apiMethod||"GET"}}),K=n.ref(null),R=n.ref(null),I=n.ref(null),{floatingStyles:q}=hr(R,I,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:G,elements:le,availableHeight:be}){Object.assign(le.floating.style,{width:`${G.reference.width}px`,maxHeight:`${be}px`})}})]}),ne=n.ref(!1),W=n.ref(""),U=n.ref(-1),ee=n.ref(null),v=n.computed(()=>!g.value||(W.value||"").trim().length>=g.value?"":`Ketik minimal ${g.value} karakter`),O=G=>{if(G==null)return"";if(typeof G=="string"||typeof G=="number")return String(G);const le=c.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.name)??(G==null?void 0:G.nama)??(G==null?void 0:G.label)??(G==null?void 0:G.title)??"-"},$=G=>{if(G==null)return null;if(typeof G=="string"||typeof G=="number")return G;const le=d.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.id)??(G==null?void 0:G.value)??(G==null?void 0:G.code)??null},X=n.computed(()=>{const G=C.value;if(G==null||G==="")return"";if(Array.isArray(G))return G.length?G.map(Oe=>{if(m.value&&typeof Oe=="object"||typeof Oe=="object")return O(Oe);const De=A.value.find(Z=>$(Z)==Oe);return De?O(De):String(Oe)}).join(", "):"";if(typeof G=="object")return O(G);const le=A.value.find(be=>$(be)==G);return le?O(le):String(G)}),te=n.computed(()=>{const G=A.value||[],le=(W.value||"").trim().toLowerCase(),be=(X.value||"").toLowerCase(),Oe=!le||le===be;let De=G;if(Oe||(De=G.filter(Z=>O(Z).toLowerCase().includes(le))),De.length>0){const Z=se=>{const ce=$(se);return Array.isArray(C.value)?C.value.some(we=>we==ce):C.value==ce};De=[...De].sort((se,ce)=>{const we=Z(se),je=Z(ce);return we&&!je?-1:!we&&je?1:0})}return De}),ie=G=>Array.isArray(G)?G.length===0:G==null||G==="",re=G=>{if(ee.value=null,f.value&&ie(G)&&!B.value.length)return ee.value="This field is required",!1;for(const le of B.value){const be=le(G);if(be===!1)return ee.value="Invalid value",!1;if(typeof be=="string")return ee.value=be,!1}return!0},z=async()=>{if(u.value||h.value)return;ne.value=!0,U.value=te.value.length?0:-1,W.value=X.value||"";const G=T.value,le=G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems;o.autoFetchOnOpen&&le&&!k.value&&(await pe(),U.value=te.value.length?0:-1)},P=()=>{ne.value=!1,U.value=-1,W.value=X.value||""},H=G=>{const le=m.value?G:$(G);let be=le;Array.isArray(C.value)&&(be=[le]),C.value=be,a("update:modelValue",be),ee.value=null,re(be),W.value=O(G),P()},Y=()=>{E.value=[],k.value=!1,C.value=Array.isArray(C.value)?[]:null,a("update:modelValue",C.value),W.value="",ee.value=null},oe=()=>{l.value=!0,Y(),P(),setTimeout(()=>{l.value=!1},0)},ye=G=>{if(u.value||h.value)return;const le=G.target.value;W.value=le,ee.value&&(ee.value=null),ne.value||(ne.value=!0),U.value=te.value.length?0:-1;const be=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&be&&!M.value&&!k.value&&pe()},xe=G=>{var be;if(u.value||h.value)return;const le={ArrowDown:()=>{if(G.preventDefault(),!ne.value){z();return}te.value.length&&(U.value=Math.min(U.value+1,te.value.length-1))},ArrowUp:()=>{!ne.value||!te.value.length||(G.preventDefault(),U.value=Math.max(U.value-1,0))},Enter:()=>{if(!ne.value)return;G.preventDefault();const Oe=te.value[U.value];Oe&&H(Oe)},Escape:()=>{G.preventDefault(),P()},Tab:()=>{P()}};(be=le[G.key])==null||be.call(le)},pe=async()=>{const G=T.value;if(G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems){_.value=!0;try{let be;if(o.fetchItems){const Oe=N()||{},De={page:1,perPage:100,search:(W.value||"").trim(),...Oe,...o.apiParams},Z=await o.fetchItems(De),se=(Z==null?void 0:Z.data)??Z;be=(se==null?void 0:se.data)??se}else{const De=Je().DCodeApi;if(typeof De!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const se={page:1,perPage:100,...N()||{},...o.apiParams};let ce;G.apiUrl?ce=await De("","",se,{_url:G.apiUrl,_method:G.apiMethod||"POST"}):ce=await De(G.apiModule,G.apiAction,se);const we=(ce==null?void 0:ce.data)??ce;be=(we==null?void 0:we.data)??we}E.value=Array.isArray(be)?be:[],k.value=!0}catch(be){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",be),ee.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(be==null?void 0:be.message)||(be==null?void 0:be.toString())||"Failed to load options"}`,E.value=[],k.value=!0}finally{_.value=!1}}},ke=G=>{const le=$(G);return m.value?C.value?Array.isArray(C.value)?C.value.some(be=>$(be)==le):$(C.value)==le:!1:Array.isArray(C.value)?C.value.some(be=>be==le):C.value==le};n.watch(()=>[N(),T.value,o.apiParams],([G,le,be],[Oe,De,Z])=>{const se=T.value;if(!(se.apiModule&&se.apiAction||se.apiUrl||o.fetchItems)){Y();return}const we=JSON.stringify(G??null)===JSON.stringify(Oe??null),je=JSON.stringify(be??null)===JSON.stringify(Z??null);we&&je||(Y(),je||pe())},{deep:!0}),n.watch(()=>o.modelValue,(G,le)=>{C.value=G,!l.value&&(G==null||G==="")&&le!=null&&o.apiModule&&o.apiAction&&(E.value=[],k.value=!1),W.value=X.value||""},{immediate:!0});const Fe=T.value;(Fe.apiModule&&Fe.apiAction||Fe.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ie(o.modelValue))&&pe();const it=G=>{const le=K.value,be=I.value,Oe=G.target;le&&le.contains(Oe)||be&&be.contains(Oe)||ne.value&&P()},_t=n.computed(()=>{const G=o.modelValue;return G==null?!1:typeof G=="string"?G.trim().length>0:Array.isArray(G)?G.length>0:typeof G=="object"?Object.keys(G).length>0:!0}),et=n.computed(()=>!!o.clearable&&_t.value&&!o.disabled);return n.onMounted(()=>{document.addEventListener("mousedown",it)}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",it)}),(G,le)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:K,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Zu)):n.createCommentVNode("",!0),le[6]||(le[6]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:w.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),p.value?(n.openBlock(),n.createElementBlock("span",tf,"*")):n.createCommentVNode("",!0)],8,ef)):n.createCommentVNode("",!0),n.createElementVNode("div",nf,[n.createElementVNode("div",{ref_key:"reference",ref:R,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||h.value?"opacity-60 cursor-not-allowed":"",ee.value||b.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||G.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",of,[n.renderSlot(G.$slots,"prepend-inner",{},()=>[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps(V.value,{id:w.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||h.value?"cursor-not-allowed":"cursor-text"],placeholder:y.value,disabled:u.value,readonly:h.value,value:ne.value?W.value:X.value||W.value,onFocus:le[0]||(le[0]=()=>{ne.value||z()}),onClick:le[1]||(le[1]=()=>{ne.value||z()}),onInput:ye,onKeydown:xe,onBlur:le[2]||(le[2]=()=>re(C.value))}),null,16,af),M.value?(n.openBlock(),n.createElementBlock("svg",rf,[...le[7]||(le[7]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):et.value?(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:le[3]||(le[3]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(oe,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||h.value,onClick:le[4]||(le[4]=be=>ne.value?P():z()),"aria-label":"Toggle"},[n.createVNode(n.unref(ae.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":ne.value}])},null,8,["class"])],8,sf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[ne.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:I,style:n.normalizeStyle(n.unref(q)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",lf,[te.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(te.value,(be,Oe)=>(n.openBlock(),n.createElementBlock("button",{key:$(be)??Oe,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Oe===U.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:De=>U.value=Oe,onMousedown:le[5]||(le[5]=n.withModifiers(()=>{},["prevent"])),onClick:De=>H(be)},[n.createTextVNode(n.toDisplayString(O(be))+" ",1),ke(be)?(n.openBlock(),n.createElementBlock("span",df," ✓ ")):n.createCommentVNode("",!0)],42,cf))),128)):n.renderSlot(G.$slots,"no-data",{key:1},()=>[n.createElementVNode("div",uf,[M.value?(n.openBlock(),n.createElementBlock("span",ff,"Loading data…")):v.value?(n.openBlock(),n.createElementBlock("span",hf,n.toDisplayString(v.value),1)):(n.openBlock(),n.createElementBlock("span",mf,"No data available"))])])])],4)):n.createCommentVNode("",!0)]))]),ee.value||b.value?(n.openBlock(),n.createElementBlock("p",pf,n.toDisplayString(ee.value||b.value),1)):n.createCommentVNode("",!0)],64))],10,Qu)),[[n.vShow,e.visible]])}}),gf=["aria-busy"],bf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},yf=["for"],xf={key:0,class:"ml-1 text-destructive"},kf={class:"relative"},wf={key:0,class:"flex items-center text-gray-500 gap-2"},Cf=["id","placeholder","disabled","value"],Bf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},_f=["disabled"],Ef={key:0,class:"p-3 space-y-2"},Sf=["onMouseenter","onClick"],Af={class:"flex items-center space-x-3"},Vf={class:"flex-1"},Df={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Mf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Nf={key:0},Pf={key:2,class:"p-3 text-center"},vf={class:"inline-flex items-center space-x-2"},Tf={class:"text-sm text-gray-500"},Of={key:3,class:"p-3 text-center"},zf={class:"text-xs text-gray-400"},Ff={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Rf={key:1,class:"mt-1 text-xs text-red-600"},If={key:2,class:"mt-1 text-xs text-gray-500"},ri=n.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.ref(),i=n.ref(),l=n.ref(),c=n.ref(),d=n.ref(),u=n.computed(()=>{const U=o.label||o.placeholder;return U?`app-infinite-autocomplete-${U}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=n.ref(""),h=n.ref([]),m=n.ref(!1),p=n.ref(!1),b=n.ref(-1),y=n.ref(1),g=n.ref(!0),B=n.ref(0),w=n.ref(),{floatingStyles:C}=hr(c,d,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:U,elements:ee}){Object.assign(ee.floating.style,{width:`${U.reference.width}px`})}})]});n.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const E=n.computed(()=>f.value?h.value.filter(U=>A(U).toLowerCase().includes(f.value.toLowerCase())):h.value),_=n.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const U=h.value.find(ee=>D(ee)===o.modelValue);return U?A(U):String(o.modelValue)}}return""}),k=()=>{p.value=!0},x=()=>{p.value=!1},A=U=>typeof o.itemTitle=="function"?o.itemTitle(U):U[o.itemTitle]||"",D=U=>typeof o.itemValue=="function"?o.itemValue(U):U[o.itemValue]||U,M=U=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(U):U[o.itemSubtitle]||"":"",V=U=>o.modelValue?o.returnObject?D(U)===D(o.modelValue):D(U)===o.modelValue:!1,N=U=>{var v;const ee=o.returnObject?U:D(U);a("update:modelValue",ee),a("select",U),p.value=!1,f.value="",(v=s.value)==null||v.blur()},T=()=>{var U;a("update:modelValue",null),f.value="",(U=s.value)==null||U.focus()},K=U=>{p.value=!0,a("focus",U),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&W(!0)},R=U=>{setTimeout(()=>{p.value=!1,a("blur",U)},200)},I=U=>{const ee=U.target;f.value=ee.value,w.value&&clearTimeout(w.value),w.value=setTimeout(()=>{a("search",f.value),y.value=1,g.value=!0,W(!0)},o.debounceMs)},q=U=>{if(p.value)switch(U.key){case"ArrowDown":U.preventDefault(),b.value=Math.min(b.value+1,E.value.length-1);break;case"ArrowUp":U.preventDefault(),b.value=Math.max(b.value-1,0);break;case"Enter":U.preventDefault(),b.value>=0&&E.value[b.value]&&N(E.value[b.value]);break;case"Escape":p.value=!1;break}},ne=U=>{if(!g.value||m.value)return;const ee=U.target,{scrollTop:v,scrollHeight:O,clientHeight:$}=ee;v+$>=O-o.threshold&&W()},W=async(U=!1)=>{var ee,v;if(!m.value){m.value=!0;try{let O=[];if(o.fetchItems)O=await o.fetchItems();else{const $=Je(),X=((ee=o.endpoint)==null?void 0:ee.apiModule)||o.apiModule,te=((v=o.endpoint)==null?void 0:v.apiAction)||o.apiAction;if(!X||!te)throw new Error("API module and action are required");const ie={page:U?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},re=await $.apiUrl(`/${X}/${te}`,"GET",ie);O=re.data||re.items||re||[],B.value=re.total||re.totalItems||O.length}U?(h.value=O,y.value=1):(h.value.push(...O),y.value++),g.value=O.length>=o.pageSize,g.value||a("end-of-results"),a("load-more",{items:O,page:y.value,hasMore:g.value,total:B.value})}catch(O){console.error("Error fetching items:",O),a("error",O)}finally{m.value=!1}}};return n.onMounted(()=>{o.autoFetchOnMount&&W()}),n.onUnmounted(()=>{w.value&&clearTimeout(w.value)}),n.watch(()=>o.modelValue,U=>{U||(f.value="")}),(U,ee)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:l,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",bf)):n.createCommentVNode("",!0),ee[3]||(ee[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",xf,"*")):n.createCommentVNode("",!0)],8,yf)):n.createCommentVNode("",!0),n.createElementVNode("div",kf,[n.createElementVNode("div",{ref_key:"reference",ref:c,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[e.disabled?"opacity-60 cursor-not-allowed":"",e.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(n.openBlock(),n.createElementBlock("div",wf,[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({ref_key:"inputRef",ref:s},U.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",e.disabled?"cursor-not-allowed":"cursor-text"],placeholder:e.placeholder,disabled:e.disabled,value:_.value,onFocus:K,onBlur:R,onInput:I,onKeydown:q}),null,16,Cf),m.value?(n.openBlock(),n.createElementBlock("svg",Bf,[...ee[4]||(ee[4]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.clearable&&e.modelValue?(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:ee[0]||(ee[0]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:e.disabled,onClick:ee[1]||(ee[1]=v=>p.value?x():k()),"aria-label":"Toggle"},[n.createVNode(n.unref(ae.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":p.value}])},null,8,["class"])],8,_f))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[p.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:n.normalizeStyle(n.unref(C)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:ne},[m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ef,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(5,v=>n.createElementVNode("div",{key:v,class:"flex items-center space-x-3"},[...ee[5]||(ee[5]=[n.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),n.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):E.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(E.value,(v,O)=>(n.openBlock(),n.createElementBlock("button",{key:D(v)??O,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",O===b.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:$=>b.value=O,onMousedown:ee[2]||(ee[2]=n.withModifiers(()=>{},["prevent"])),onClick:$=>N(v)},[n.renderSlot(U.$slots,"item",{item:v,index:O},()=>[n.createElementVNode("div",Af,[n.createElementVNode("div",Vf,[n.createElementVNode("div",Df,n.toDisplayString(A(v)),1),e.itemSubtitle?(n.openBlock(),n.createElementBlock("div",Mf,n.toDisplayString(M(v)),1)):n.createCommentVNode("",!0)])])]),V(v)?(n.openBlock(),n.createElementBlock("span",Nf," ✓ ")):n.createCommentVNode("",!0)],42,Sf))),128)):n.createCommentVNode("",!0),m.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Pf,[n.createElementVNode("div",vf,[ee[6]||(ee[6]=n.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),n.createElementVNode("span",Tf,n.toDisplayString(e.loadingText),1)])])):n.createCommentVNode("",!0),!g.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Of,[n.createElementVNode("div",zf,n.toDisplayString(e.endOfResultsText),1)])):!m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ff,n.toDisplayString(e.noResultsText),1)):n.createCommentVNode("",!0)],544)],4)):n.createCommentVNode("",!0)]))]),e.error?(n.openBlock(),n.createElementBlock("p",Rf,n.toDisplayString(e.errorMessage||e.error),1)):e.helperText?(n.openBlock(),n.createElementBlock("p",If,n.toDisplayString(e.helperText),1)):n.createCommentVNode("",!0)],64))],10,gf)),[[n.vShow,e.visible]])}});function si(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=si(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function ii(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=si(e))&&(a&&(a+=" "),a+=t);return a}const Lf=(e,t)=>{const o=new Array(e.length+t.length);for(let a=0;a<e.length;a++)o[a]=e[a];for(let a=0;a<t.length;a++)o[e.length+a]=t[a];return o},$f=(e,t)=>({classGroupId:e,validator:t}),li=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),$o="-",ci=[],Wf="arbitrary..",jf=e=>{const t=Hf(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Uf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return di(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=o[i];return c?d?Lf(d,c):c:d||ci}return o[i]||ci}}},di=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const r=e[t],s=o.nextPart.get(r);if(s){const d=di(e,t+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=t===0?e.join($o):e.slice(t).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Uf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?Wf+a:void 0})(),Hf=e=>{const{theme:t,classGroups:o}=e;return qf(o,t)},qf=(e,t)=>{const o=li();for(const a in e){const r=e[a];mr(r,o,a,t)}return o},mr=(e,t,o,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];Gf(i,t,o,a)}},Gf=(e,t,o,a)=>{if(typeof e=="string"){Xf(e,t,o);return}if(typeof e=="function"){Yf(e,t,o,a);return}Kf(e,t,o,a)},Xf=(e,t,o)=>{const a=e===""?t:ui(t,e);a.classGroupId=o},Yf=(e,t,o,a)=>{if(Jf(e)){mr(e(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push($f(o,e))},Kf=(e,t,o,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];mr(c,ui(t,l),o,a)}},ui=(e,t)=>{let o=e;const a=t.split($o),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=o.nextPart.get(i);l||(l=li(),o.nextPart.set(i,l)),o=l}return o},Jf=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Qf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const r=(s,i)=>{o[s]=i,t++,t>e&&(t=0,a=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in o?o[s]=i:r(s,i)}}},pr="!",fi=":",Zf=[],hi=(e,t,o,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:r}),eh=e=>{const{prefix:t,experimentalParseClassName:o}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let b=0;b<u;b++){const y=r[b];if(i===0&&l===0){if(y===fi){s.push(r.slice(c,b)),c=b+1;continue}if(y==="/"){d=b;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(pr)?(h=f.slice(0,-1),m=!0):f.startsWith(pr)&&(h=f.slice(1),m=!0);const p=d&&d>c?d-c:void 0;return hi(s,m,h,p)};if(t){const r=t+fi,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):hi(Zf,!1,i,void 0,!0)}if(o){const r=a;a=s=>o({className:s,parseClassName:r})}return a},th=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let r=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},nh=e=>({cache:Qf(e.cacheSize),parseClassName:eh(e),sortModifiers:th(e),...jf(e)}),oh=/\s+/,ah=(e,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(oh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:b}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!b,g=a(y?p.substring(0,b):p);if(!g){if(!y){c=u+(c.length>0?" "+c:c);continue}if(g=a(p),!g){c=u+(c.length>0?" "+c:c);continue}y=!1}const B=h.length===0?"":h.length===1?h[0]:s(h).join(":"),w=m?B+pr:B,C=w+g;if(i.indexOf(C)>-1)continue;i.push(C);const E=r(g,y);for(let _=0;_<E.length;++_){const k=E[_];i.push(w+k)}c=u+(c.length>0?" "+c:c)}return c},rh=(...e)=>{let t=0,o,a,r="";for(;t<e.length;)(o=e[t++])&&(a=mi(o))&&(r&&(r+=" "),r+=a);return r},mi=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=mi(e[a]))&&(o&&(o+=" "),o+=t);return o},sh=(e,...t)=>{let o,a,r,s;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return o=nh(d),a=o.cache.get,r=o.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=ah(c,o);return r(c,u),u};return s=i,(...c)=>s(rh(...c))},ih=[],Ge=e=>{const t=o=>o[e]||ih;return t.isThemeGetter=!0,t},pi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ch=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jt=e=>lh.test(e),_e=e=>!!e&&!Number.isNaN(Number(e)),Qt=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&_e(e.slice(0,-1)),Rt=e=>ch.test(e),bi=()=>!0,mh=e=>dh.test(e)&&!uh.test(e),br=()=>!1,ph=e=>fh.test(e),gh=e=>hh.test(e),bh=e=>!fe(e)&&!he(e),yh=e=>Zt(e,Bi,br),fe=e=>pi.test(e),mn=e=>Zt(e,_i,mh),yi=e=>Zt(e,Sh,_e),xh=e=>Zt(e,Si,bi),kh=e=>Zt(e,Ei,br),xi=e=>Zt(e,wi,br),wh=e=>Zt(e,Ci,gh),Wo=e=>Zt(e,Ai,ph),he=e=>gi.test(e),no=e=>pn(e,_i),Ch=e=>pn(e,Ei),ki=e=>pn(e,wi),Bh=e=>pn(e,Bi),_h=e=>pn(e,Ci),jo=e=>pn(e,Ai,!0),Eh=e=>pn(e,Si,!0),Zt=(e,t,o)=>{const a=pi.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},pn=(e,t,o=!1)=>{const a=gi.exec(e);return a?a[1]?t(a[1]):o:!1},wi=e=>e==="position"||e==="percentage",Ci=e=>e==="image"||e==="url",Bi=e=>e==="length"||e==="size"||e==="bg-size",_i=e=>e==="length",Sh=e=>e==="number",Ei=e=>e==="family-name",Si=e=>e==="number"||e==="weight",Ai=e=>e==="shadow",Ah=sh(()=>{const e=Ge("color"),t=Ge("font"),o=Ge("text"),a=Ge("font-weight"),r=Ge("tracking"),s=Ge("leading"),i=Ge("breakpoint"),l=Ge("container"),c=Ge("spacing"),d=Ge("radius"),u=Ge("shadow"),f=Ge("inset-shadow"),h=Ge("text-shadow"),m=Ge("drop-shadow"),p=Ge("blur"),b=Ge("perspective"),y=Ge("aspect"),g=Ge("ease"),B=Ge("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),he,fe],_=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],x=()=>[he,fe,c],A=()=>[Jt,"full","auto",...x()],D=()=>[Qt,"none","subgrid",he,fe],M=()=>["auto",{span:["full",Qt,he,fe]},Qt,he,fe],V=()=>[Qt,"auto",he,fe],N=()=>["auto","min","max","fr",he,fe],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...x()],I=()=>[Jt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],q=()=>[Jt,"screen","full","dvw","lvw","svw","min","max","fit",...x()],ne=()=>[Jt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],W=()=>[e,he,fe],U=()=>[...C(),ki,xi,{position:[he,fe]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],v=()=>["auto","cover","contain",Bh,yh,{size:[he,fe]}],O=()=>[gr,no,mn],$=()=>["","none","full",d,he,fe],X=()=>["",_e,no,mn],te=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[_e,gr,ki,xi],z=()=>["","none",p,he,fe],P=()=>["none",_e,he,fe],H=()=>["none",_e,he,fe],Y=()=>[_e,he,fe],oe=()=>[Jt,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rt],breakpoint:[Rt],color:[bi],container:[Rt],"drop-shadow":[Rt],ease:["in","out","in-out"],font:[bh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rt],shadow:[Rt],spacing:["px",_e],text:[Rt],"text-shadow":[Rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jt,fe,he,y]}],container:["container"],columns:[{columns:[_e,fe,he,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Qt,"auto",he,fe]}],basis:[{basis:[Jt,"full","auto",l,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Jt,"auto","initial","none",fe]}],grow:[{grow:["",_e,he,fe]}],shrink:[{shrink:["",_e,he,fe]}],order:[{order:[Qt,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[l,"screen",...I()]}],"min-w":[{"min-w":[l,"screen","none",...I()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",o,no,mn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Eh,xh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gr,fe]}],"font-family":[{font:[Ch,kh,t]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,he,fe]}],"line-clamp":[{"line-clamp":[_e,"none",he,yi]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",he,mn]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[_e,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:v()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qt,he,fe],radial:["",he,fe],conic:[Qt,he,fe]},_h,wh]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,he,fe]}],"outline-w":[{outline:["",_e,no,mn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,jo,Wo]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",f,jo,Wo]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[_e,mn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",h,jo,Wo]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[_e,he,fe]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:v()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:z()}],brightness:[{brightness:[_e,he,fe]}],contrast:[{contrast:[_e,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",m,jo,Wo]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",_e,he,fe]}],"hue-rotate":[{"hue-rotate":[_e,he,fe]}],invert:[{invert:["",_e,he,fe]}],saturate:[{saturate:[_e,he,fe]}],sepia:[{sepia:["",_e,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[_e,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[_e,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",_e,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[_e,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[_e,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",he,fe]}],ease:[{ease:["linear","initial",g,he,fe]}],delay:[{delay:[_e,he,fe]}],animate:[{animate:["none",B,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,he,fe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:P()}],"rotate-x":[{"rotate-x":P()}],"rotate-y":[{"rotate-y":P()}],"rotate-z":[{"rotate-z":P()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[_e,no,mn,yi]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ee(...e){return Ah(ii(e))}function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr={},xr={},Uo={exports:{}},Vi;function Dh(){if(Vi)return Uo.exports;Vi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Uo.exports=t(),Uo.exports.createColors=t,Uo.exports}var Di;function Mh(){return Di||(Di=1,(function(e){var t={};Object.defineProperty(e,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(e,{dim:function(){return l},default:function(){return c}});const a=r(Dh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&t.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return a.default.dim(d)}const c={info(d,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(xr)),xr}var Mi;function Nh(){return Mi||(Mi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const t=o(Mh());function o(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){t.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const r={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(yr)),yr}var kr,Ni;function Ph(){if(Ni)return kr;Ni=1;let e=Nh();return kr=(e.__esModule?e:{default:e}).default,kr}var vh=Ph();const Th=Vh(vh),Pi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vi=ii,oo=(e,t)=>o=>{var a;if((t==null?void 0:t.variants)==null)return vi(e,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Pi(u)||Pi(f);return r[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(p=>{let[b,y]=p;return Array.isArray(y)?y.includes({...s,...l}[b]):{...s,...l}[b]===y})?[...d,f,h]:d},[]);return vi(e,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},mt=n.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.Primitive),{as:e.as,"as-child":e.asChild,class:n.normalizeClass(n.unref(Ee)(n.unref(vn)({variant:e.variant,size:e.size}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),vn=oo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Ti=n.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ue.TooltipRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Oi=n.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const o=e,a=t,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ue.TooltipPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ue.TooltipContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Ee)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),zi=n.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.TooltipProvider),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Fi=n.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.TooltipTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Oh={class:"relative z-10"},zh="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] shadow-[0_3px_0_0_rgba(0,0,0,0.12),0_12px_22px_-10px_rgba(0,0,0,0.35)] hover:shadow-[0_6px_20px_-4px_rgba(0,0,0,0.3),0_10px_40px_-10px_rgba(0,0,0,0.2)] active:shadow-[0_1px_0_0_rgba(0,0,0,0.2),0_4px_8px_-4px_rgba(0,0,0,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Fh=n.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Et[o.icon]||null),r=n.computed(()=>!!o.tooltip),s=n.computed(()=>o.visible??!0),i=n.computed(()=>{const v=String(o.variant||"default").toLowerCase();return v==="tonal"?"secondary":v==="elevated"?"default":v}),l=n.computed(()=>String(o.bgColor||"").toLowerCase()),c=n.computed(()=>String(o.type||"button").toLowerCase()),d=n.computed(()=>{const{class:v,...O}=t;return O}),u=n.computed(()=>Ee(t.class)),f=n.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=n.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=n.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=n.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),b=n.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),y=n.computed(()=>Ee("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,h.value,m.value,f.value)),g=n.computed(()=>{const O=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),B=n.computed(()=>{const O=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),w=n.computed(()=>!!g.value),C=n.computed(()=>/\bborder-/.test(u.value??"")),E=n.computed(()=>/\bhover:/.test(u.value??"")),_=n.computed(()=>{const v=u.value??"";return i.value!=="outline"?v:v.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=n.ref(null),x=v=>{const O=v.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return O?{r:Number(O[1]),g:Number(O[2]),b:Number(O[3]),a:O[4]?Number(O[4]):1}:null},A=(v,O)=>{const $=x(v);if(!$)return v;const X=te=>Math.max(0,Math.min(255,Math.round(te)));return`rgba(${X($.r*(1-O))}, ${X($.g*(1-O))}, ${X($.b*(1-O))}, ${$.a})`},D=v=>{if(globalThis.window===void 0)return null;const O=document.createElement("div");O.className=v,O.style.position="absolute",O.style.visibility="hidden",O.style.pointerEvents="none",O.style.width="1px",O.style.height="1px",document.body.appendChild(O);const $=globalThis.getComputedStyle(O).backgroundColor;return O.remove(),!$||$==="transparent"||$==="rgba(0, 0, 0, 0)"?null:$},M=[50,100,200,300,400,500,600,700,800,900,950],V=v=>{const O=M.indexOf(v);return O===-1?v:M[Math.min(M.length-1,O+2)]},N=(v,O)=>{const $=Th[v];if(!$)return null;if(typeof $=="string")return $;if(!O)return null;const X=$[O];return typeof X=="string"?X:null},T=(v,O=!1)=>{if(!v)return null;const $=O?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,X=v.match($);return X?{colorName:X[1],shade:X[2]?Number.parseInt(X[2],10):null}:null},K=()=>{const v=g.value;if(!v){k.value=null;return}const O=T(v),$=O==null?void 0:O.colorName,X=(O==null?void 0:O.shade)??null,te=($?N($,X):null)??D(v);if(!te){k.value=null;return}let ie;const re=T(B.value,!0),z=re?N(re.colorName,re.shade??null):null;if(z)ie=z;else if($&&X){const P=V(X);ie=N($,P)??A(te,.2)}else ie=A(te,.2);k.value={"--btn-color":te,"--btn-color-hover":ie}};n.onMounted(()=>{K()}),n.watch([g,B],async()=>{await n.nextTick(),K()});const R=n.computed(()=>{const v=/\bdark:bg-/.test(u.value??"");return!w.value||i.value==="outline"||v?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":E.value?"":"hover:brightness-90"}),I=n.computed(()=>{if(!w.value||i.value!=="outline")return"";const v=["dcode-btn--outline","dcode-btn--outline-hover"];return C.value||v.push("border"),!k.value&&!E.value&&v.push("hover:brightness-90"),v.join(" ")}),q=n.computed(()=>k.value??void 0),ne={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},W={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",hover:"hover:from-blue-600 hover:to-cyan-600"},"gradient-purple":{bg:"bg-gradient-to-r from-purple-500 to-pink-500",text:"text-white",hover:"hover:from-purple-600 hover:to-pink-600"},"gradient-sunset":{bg:"bg-gradient-to-r from-orange-500 to-red-500",text:"text-white",hover:"hover:from-orange-600 hover:to-red-600"},"gradient-emerald":{bg:"bg-gradient-to-r from-emerald-500 to-teal-500",text:"text-white",hover:"hover:from-emerald-600 hover:to-teal-600"}},U=n.computed(()=>{const v=[],O=l.value,$=String(o.borderColor||"").toLowerCase(),X=O?ne[O]:null,te=O?W[O]:null,ie=$?ne[$]:null;return O&&(X?ie&&$!==O?(v.push(X.bg,ie.hoverBg),o.textColor||v.push(X.text,ie.hoverText)):(v.push(X.bg,X.hoverBg),o.textColor||v.push(X.text,X.hoverText)):te?(v.push(te.bg,te.hover),o.textColor||v.push(te.text)):O==="transparent"?ie?(v.push("bg-transparent",ie.hoverBg),o.textColor||v.push("text-inherit",ie.hoverText)):v.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):v.push(O)),$?ie?v.push(ie.border,ie.hoverBorder):v.push($):X&&i.value!=="ghost"&&i.value!=="link"&&v.push(X.border,X.hoverBorder),o.textColor&&v.push(o.textColor),v.join(" ")}),ee=n.computed(()=>Ee(zh,p.value,b.value,_.value,R.value,I.value,U.value));return(v,O)=>s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.skeleton?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(n.openBlock(),n.createBlock(n.unref(zi),{key:1,"delay-duration":0},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(mt),n.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:q.value},d.value),{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),n.createVNode(n.unref(Oi),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:n.withCtx(()=>[n.createElementVNode("span",Oh,n.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(n.openBlock(),n.createBlock(n.unref(mt),n.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:q.value},d.value),{default:n.withCtx(()=>[n.renderSlot(v.$slots,"default",{},()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):n.createCommentVNode("",!0)}}),Ct=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},Xe=Ct(Fh,[["__scopeId","data-v-d4cd902d"]]),Rh={key:0,class:"flex items-center justify-between bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 px-4 py-3"},Ih={class:"flex flex-col gap-1"},Lh={key:0,class:"text-sm font-semibold text-white leading-tight"},$h={key:1,class:"text-xs text-primary-100 dark:text-primary-200"},Wh={key:0,class:"flex items-center gap-2"},jh={name:"DCodeCard"},Ri=n.defineComponent({...jh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(e){const t=e,o=n.computed(()=>{switch(t.level){case 2:return"bg-neutral-50 dark:bg-neutral-800";case 3:return"bg-neutral-100 dark:bg-neutral-700";case 1:default:return"bg-white dark:bg-neutral-900"}});return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":e.shadow},{"border-transparent":!e.border},{"border-neutral-200 dark:border-neutral-800":e.border&&e.level===1},{"border-neutral-300 dark:border-neutral-700":e.border&&e.level!==1},"overflow-hidden"]])},[e.title||a.$slots.header||a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Rh,[n.createElementVNode("div",Ih,[n.renderSlot(a.$slots,"header",{},()=>[e.title?(n.openBlock(),n.createElementBlock("h3",Lh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.subtitle?(n.openBlock(),n.createElementBlock("p",$h,n.toDisplayString(e.subtitle),1)):n.createCommentVNode("",!0)])]),a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Wh,[n.renderSlot(a.$slots,"actions")])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["relative z-10",e.padding])},[n.renderSlot(a.$slots,"default")],2),a.$slots.footer?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800",e.padding])},[n.renderSlot(a.$slots,"footer")],2)):n.createCommentVNode("",!0)],2))}});/*!
|
|
1
|
+
(function(de,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-i18n"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-i18n","vue-router","vue3-lottie"],t):(de=typeof globalThis<"u"?globalThis:de||self,t(de.DynamicUI={},de.Vue,de.LucideIcons,de.rekaUi,de.core,de.VueDatePicker,de.Uppy,de.UppyDashboard,de.UppyImageEditor,de.VueI18n,de.VueRouter,de.Vue3Lottie))})(this,(function(de,t,oe,ue,Re,eu,tu,Fs,nu,Yt,Mn,ou){"use strict";var vS=Object.defineProperty;var TS=(de,t,oe)=>t in de?vS(de,t,{enumerable:!0,configurable:!0,writable:!0,value:oe}):de[t]=oe;var me=(de,t,oe)=>TS(de,typeof t!="symbol"?t+"":t,oe);var qa;function au(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const Et=au(oe);let kt={};function Rs(e){kt={...kt,...e}}function ru(){return kt}function su(){return kt.apiBaseUrl?kt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function iu(){const e={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(kt.getAuthToken?n=kt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(e.Authorization=`Bearer ${n}`),kt.getHeaders){const o=kt.getHeaders();return{...e,...o}}return e}function lu(){kt.onUnauthorized&&kt.onUnauthorized()}async function Is(e,n,o,a){const r=ru();if(r.apiClient)return r.apiClient(e,n||"GET",o);if(!e||!e.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=su(),d=e.startsWith("http")?e:`${c}${e}`,u={method:l,headers:{...iu(),...a||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const p=new URLSearchParams;Object.entries(o).forEach(([y,g])=>{g!=null&&p.append(y,String(g))});const x=p.toString();x&&(f=`${d}${d.includes("?")?"&":"?"}${x}`)}const h=await fetch(f,u);if(h.status===401&&lu(),!h.ok){const p=await h.text();throw new Error(`HTTP ${h.status}: ${p}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function qe(){return{apiUrl:(o,a,r,s)=>Is(o,a,r,s),DCodeApi:(o,a,r,s)=>{let i=o,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${a}`,l="POST")),Is(i,l,c,s==null?void 0:s.headers)}}}const Nn=Math.min,dt=Math.max,To=Math.round,Oo=Math.floor,St=e=>({x:e,y:e}),cu={left:"right",right:"left",bottom:"top",top:"bottom"};function Ls(e,n,o){return dt(e,Nn(n,o))}function Qn(e,n){return typeof e=="function"?e(n):e}function Kt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function Ws(e){return e==="y"?"height":"width"}function zt(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function js(e){return $s(zt(e))}function du(e,n,o){o===void 0&&(o=!1);const a=Zn(e),r=js(e),s=Ws(r);let i=r==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=zo(i)),[i,zo(i)]}function uu(e){const n=zo(e);return[nr(e),n,nr(n)]}function nr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Us=["left","right"],Hs=["right","left"],fu=["top","bottom"],hu=["bottom","top"];function mu(e,n,o){switch(e){case"top":case"bottom":return o?n?Hs:Us:n?Us:Hs;case"left":case"right":return n?fu:hu;default:return[]}}function pu(e,n,o,a){const r=Zn(e);let s=mu(Kt(e),o==="start",a);return r&&(s=s.map(i=>i+"-"+r),n&&(s=s.concat(s.map(nr)))),s}function zo(e){const n=Kt(e);return cu[n]+e.slice(n.length)}function gu(e){return{top:0,right:0,bottom:0,left:0,...e}}function bu(e){return typeof e!="number"?gu(e):{top:e,right:e,bottom:e,left:e}}function Fo(e){const{x:n,y:o,width:a,height:r}=e;return{width:a,height:r,top:o,left:n,right:n+a,bottom:o+r,x:n,y:o}}function qs(e,n,o){let{reference:a,floating:r}=e;const s=zt(n),i=js(n),l=Ws(i),c=Kt(n),d=s==="y",u=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,h=a[l]/2-r[l]/2;let m;switch(c){case"top":m={x:u,y:a.y-r.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-r.width,y:f};break;default:m={x:a.x,y:a.y}}switch(Zn(n)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function yu(e,n){var o;n===void 0&&(n={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Qn(n,e),p=bu(m),y=l[h?f==="floating"?"reference":"floating":f],g=Fo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(y)))==null||o?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),B=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},E=Fo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:B,offsetParent:k,strategy:c}):B);return{top:(g.top-E.top+p.top)/C.y,bottom:(E.bottom-g.bottom+p.bottom)/C.y,left:(g.left-E.left+p.left)/C.x,right:(E.right-g.right+p.right)/C.x}}const xu=50,ku=async(e,n,o)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:yu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:e,floating:n,strategy:r}),{x:u,y:f}=qs(d,a,c),h=a,m=0;const p={};for(let x=0;x<s.length;x++){const y=s[x];if(!y)continue;const{name:g,fn:B}=y,{x:k,y:C,data:E,reset:_}=await B({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:p,rects:d,platform:l,elements:{reference:e,floating:n}});u=k??u,f=C??f,p[g]={...p[g],...E},_&&m<xu&&(m++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(d=_.rects===!0?await i.getElementRects({reference:e,floating:n,strategy:r}):_.rects),{x:u,y:f}=qs(d,h,c)),x=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:p}},wu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var o,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:x=!0,...y}=Qn(e,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const g=Kt(r),B=zt(l),k=Kt(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(k||!x?[zo(l)]:uu(l)),_=p!=="none";!h&&_&&E.push(...pu(l,x,p,C));const w=[l,...E],b=await c.detectOverflow(n,y),A=[];let D=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&A.push(b[g]),f){const T=du(r,i,C);A.push(b[T[0]],b[T[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(T=>T<=0)){var M,V;const T=(((M=s.flip)==null?void 0:M.index)||0)+1,K=w[T];if(K&&(!(f==="alignment"?B!==zt(K):!1)||D.every(q=>zt(q.placement)===B?q.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:K}};let R=(V=D.filter(I=>I.overflows[0]<=0).sort((I,q)=>I.overflows[1]-q.overflows[1])[0])==null?void 0:V.placement;if(!R)switch(m){case"bestFit":{var N;const I=(N=D.filter(q=>{if(_){const ne=zt(q.placement);return ne===B||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:N[0];I&&(R=I);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}},Cu=new Set(["left","top"]);async function Bu(e,n){const{placement:o,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Kt(o),l=Zn(o),c=zt(o)==="y",d=Cu.has(i)?-1:1,u=s&&c?-1:1,f=Qn(n,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const _u=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var o,a;const{x:r,y:s,placement:i,middlewareData:l}=n,c=await Bu(n,e);return i===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},Eu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:o,y:a,placement:r,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:g=>{let{x:B,y:k}=g;return{x:B,y:k}}},...d}=Qn(e,n),u={x:o,y:a},f=await s.detectOverflow(n,d),h=zt(Kt(r)),m=$s(h);let p=u[m],x=u[h];if(i){const g=m==="y"?"top":"left",B=m==="y"?"bottom":"right",k=p+f[g],C=p-f[B];p=Ls(k,p,C)}if(l){const g=h==="y"?"top":"left",B=h==="y"?"bottom":"right",k=x+f[g],C=x-f[B];x=Ls(k,x,C)}const y=c.fn({...n,[m]:p,[h]:x});return{...y,data:{x:y.x-o,y:y.y-a,enabled:{[m]:i,[h]:l}}}}}},Su=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var o,a;const{placement:r,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Qn(e,n),u=await i.detectOverflow(n,d),f=Kt(r),h=Zn(r),m=zt(r)==="y",{width:p,height:x}=s.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,y=h==="end"?"top":"bottom");const B=x-u.top-u.bottom,k=p-u.left-u.right,C=Nn(x-u[y],B),E=Nn(p-u[g],k),_=!n.middlewareData.shift;let w=C,b=E;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=k),(a=n.middlewareData.shift)!=null&&a.enabled.y&&(w=B),_&&!h){const D=dt(u.left,0),M=dt(u.right,0),V=dt(u.top,0),N=dt(u.bottom,0);m?b=p-2*(D!==0||M!==0?D+M:dt(u.left,u.right)):w=x-2*(V!==0||N!==0?V+N:dt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:w});const A=await i.getDimensions(l.floating);return p!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function Ro(){return typeof window<"u"}function fn(e){return or(e)?(e.nodeName||"").toLowerCase():"#document"}function ut(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function At(e){var n;return(n=(or(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function or(e){return Ro()?e instanceof Node||e instanceof ut(e).Node:!1}function wt(e){return Ro()?e instanceof Element||e instanceof ut(e).Element:!1}function Ft(e){return Ro()?e instanceof HTMLElement||e instanceof ut(e).HTMLElement:!1}function Gs(e){return!Ro()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ut(e).ShadowRoot}function eo(e){const{overflow:n,overflowX:o,overflowY:a,display:r}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(n+a+o)&&r!=="inline"&&r!=="contents"}function Au(e){return/^(table|td|th)$/.test(fn(e))}function Io(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Vu=/transform|translate|scale|rotate|perspective|filter/,Du=/paint|layout|strict|content/,hn=e=>!!e&&e!=="none";let ar;function rr(e){const n=wt(e)?Ct(e):e;return hn(n.transform)||hn(n.translate)||hn(n.scale)||hn(n.rotate)||hn(n.perspective)||!sr()&&(hn(n.backdropFilter)||hn(n.filter))||Vu.test(n.willChange||"")||Du.test(n.contain||"")}function Mu(e){let n=Jt(e);for(;Ft(n)&&!Pn(n);){if(rr(n))return n;if(Io(n))return null;n=Jt(n)}return null}function sr(){return ar==null&&(ar=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ar}function Pn(e){return/^(html|body|#document)$/.test(fn(e))}function Ct(e){return ut(e).getComputedStyle(e)}function Lo(e){return wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(fn(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Gs(e)&&e.host||At(e);return Gs(n)?n.host:n}function Xs(e){const n=Jt(e);return Pn(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(n)&&eo(n)?n:Xs(n)}function to(e,n,o){var a;n===void 0&&(n=[]),o===void 0&&(o=!0);const r=Xs(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=ut(r);if(s){const l=ir(i);return n.concat(i,i.visualViewport||[],eo(r)?r:[],l&&o?to(l):[])}else return n.concat(r,to(r,[],o))}function ir(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ys(e){const n=Ct(e);let o=parseFloat(n.width)||0,a=parseFloat(n.height)||0;const r=Ft(e),s=r?e.offsetWidth:o,i=r?e.offsetHeight:a,l=To(o)!==s||To(a)!==i;return l&&(o=s,a=i),{width:o,height:a,$:l}}function lr(e){return wt(e)?e:e.contextElement}function vn(e){const n=lr(e);if(!Ft(n))return St(1);const o=n.getBoundingClientRect(),{width:a,height:r,$:s}=Ys(n);let i=(s?To(o.width):o.width)/a,l=(s?To(o.height):o.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Nu=St(0);function Ks(e){const n=ut(e);return!sr()||!n.visualViewport?Nu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Pu(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==ut(e)?!1:n}function mn(e,n,o,a){n===void 0&&(n=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=lr(e);let i=St(1);n&&(a?wt(a)&&(i=vn(a)):i=vn(e));const l=Pu(s,o,a)?Ks(s):St(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const h=ut(s),m=a&&wt(a)?ut(a):a;let p=h,x=ir(p);for(;x&&a&&m!==p;){const y=vn(x),g=x.getBoundingClientRect(),B=Ct(x),k=g.left+(x.clientLeft+parseFloat(B.paddingLeft))*y.x,C=g.top+(x.clientTop+parseFloat(B.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=k,d+=C,p=ut(x),x=ir(p)}}return Fo({width:u,height:f,x:c,y:d})}function $o(e,n){const o=Lo(e).scrollLeft;return n?n.left+o:mn(At(e)).left+o}function Js(e,n){const o=e.getBoundingClientRect(),a=o.left+n.scrollLeft-$o(e,o),r=o.top+n.scrollTop;return{x:a,y:r}}function vu(e){let{elements:n,rect:o,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=At(a),l=n?Io(n.floating):!1;if(a===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=St(1);const u=St(0),f=Ft(a);if((f||!f&&!s)&&((fn(a)!=="body"||eo(i))&&(c=Lo(a)),f)){const m=mn(a);d=vn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?Js(i,c):St(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Tu(e){return Array.from(e.getClientRects())}function Ou(e){const n=At(e),o=Lo(e),a=e.ownerDocument.body,r=dt(n.scrollWidth,n.clientWidth,a.scrollWidth,a.clientWidth),s=dt(n.scrollHeight,n.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+$o(e);const l=-o.scrollTop;return Ct(a).direction==="rtl"&&(i+=dt(n.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Qs=25;function zu(e,n){const o=ut(e),a=At(e),r=o.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=sr();(!u||u&&n==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=$o(a);if(d<=0){const u=a.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(a.clientWidth-f.clientWidth-m);p<=Qs&&(s-=p)}else d<=Qs&&(s+=d);return{width:s,height:i,x:l,y:c}}function Fu(e,n){const o=mn(e,!0,n==="fixed"),a=o.top+e.clientTop,r=o.left+e.clientLeft,s=Ft(e)?vn(e):St(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function Zs(e,n,o){let a;if(n==="viewport")a=zu(e,o);else if(n==="document")a=Ou(At(e));else if(wt(n))a=Fu(n,o);else{const r=Ks(e);a={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Fo(a)}function ei(e,n){const o=Jt(e);return o===n||!wt(o)||Pn(o)?!1:Ct(o).position==="fixed"||ei(o,n)}function Ru(e,n){const o=n.get(e);if(o)return o;let a=to(e,[],!1).filter(l=>wt(l)&&fn(l)!=="body"),r=null;const s=Ct(e).position==="fixed";let i=s?Jt(e):e;for(;wt(i)&&!Pn(i);){const l=Ct(i),c=rr(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||eo(i)&&!c&&ei(e,i))?a=a.filter(u=>u!==i):r=l,i=Jt(i)}return n.set(e,a),a}function Iu(e){let{element:n,boundary:o,rootBoundary:a,strategy:r}=e;const i=[...o==="clippingAncestors"?Io(n)?[]:Ru(n,this._c):[].concat(o),a],l=Zs(n,i[0],r);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=Zs(n,i[h],r);c=dt(m.top,c),d=Nn(m.right,d),u=Nn(m.bottom,u),f=dt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Lu(e){const{width:n,height:o}=Ys(e);return{width:n,height:o}}function $u(e,n,o){const a=Ft(n),r=At(n),s=o==="fixed",i=mn(e,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=St(0);function d(){c.x=$o(r)}if(a||!a&&!s)if((fn(n)!=="body"||eo(r))&&(l=Lo(n)),a){const m=mn(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?Js(r,l):St(0),f=i.left+l.scrollLeft-c.x-u.x,h=i.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function cr(e){return Ct(e).position==="static"}function ti(e,n){if(!Ft(e)||Ct(e).position==="fixed")return null;if(n)return n(e);let o=e.offsetParent;return At(e)===o&&(o=o.ownerDocument.body),o}function ni(e,n){const o=ut(e);if(Io(e))return o;if(!Ft(e)){let r=Jt(e);for(;r&&!Pn(r);){if(wt(r)&&!cr(r))return r;r=Jt(r)}return o}let a=ti(e,n);for(;a&&Au(a)&&cr(a);)a=ti(a,n);return a&&Pn(a)&&cr(a)&&!rr(a)?o:a||Mu(e)||o}const Wu=async function(e){const n=this.getOffsetParent||ni,o=this.getDimensions,a=await o(e.floating);return{reference:$u(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function ju(e){return Ct(e).direction==="rtl"}const Uu={convertOffsetParentRelativeRectToViewportRelativeRect:vu,getDocumentElement:At,getClippingRect:Iu,getOffsetParent:ni,getElementRects:Wu,getClientRects:Tu,getDimensions:Lu,getScale:vn,isElement:wt,isRTL:ju};function oi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Hu(e,n){let o=null,a;const r=At(e);function s(){var l;clearTimeout(a),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||n(),!h||!m)return;const p=Oo(f),x=Oo(r.clientWidth-(u+h)),y=Oo(r.clientHeight-(f+m)),g=Oo(u),k={rootMargin:-p+"px "+-x+"px "+-y+"px "+-g+"px",threshold:dt(0,Nn(1,c))||1};let C=!0;function E(_){const w=_[0].intersectionRatio;if(w!==c){if(!C)return i();w?i(!1,w):a=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!oi(d,e.getBoundingClientRect())&&i(),C=!1}try{o=new IntersectionObserver(E,{...k,root:r.ownerDocument})}catch{o=new IntersectionObserver(E,k)}o.observe(e)}return i(!0),s}function dr(e,n,o,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=lr(e),u=r||s?[...d?to(d):[],...n?to(n):[]]:[];u.forEach(g=>{r&&g.addEventListener("scroll",o,{passive:!0}),s&&g.addEventListener("resize",o)});const f=d&&l?Hu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(g=>{let[B]=g;B&&B.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=m)==null||k.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let p,x=c?mn(e):null;c&&y();function y(){const g=mn(e);x&&!oi(x,g)&&o(),x=g,p=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(B=>{r&&B.removeEventListener("scroll",o),s&&B.removeEventListener("resize",o)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const ur=_u,fr=Eu,hr=wu,mr=Su,qu=(e,n,o)=>{const a=new Map,r={platform:Uu,...o},s={...r.platform,_c:a};return ku(e,n,{...r,platform:s})};function Gu(e){return e!=null&&typeof e=="object"&&"$el"in e}function ai(e){if(Gu(e)){const n=e.$el;return or(n)&&fn(n)==="#comment"?null:n}return e}function no(e){return typeof e=="function"?e():t.unref(e)}function ri(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function si(e,n){const o=ri(e);return Math.round(n*o)/o}function pr(e,n,o){o===void 0&&(o={});const a=o.whileElementsMounted,r=t.computed(()=>{var w;return(w=no(o.open))!=null?w:!0}),s=t.computed(()=>no(o.middleware)),i=t.computed(()=>{var w;return(w=no(o.placement))!=null?w:"bottom"}),l=t.computed(()=>{var w;return(w=no(o.strategy))!=null?w:"absolute"}),c=t.computed(()=>{var w;return(w=no(o.transform))!=null?w:!0}),d=t.computed(()=>ai(e.value)),u=t.computed(()=>ai(n.value)),f=t.ref(0),h=t.ref(0),m=t.ref(l.value),p=t.ref(i.value),x=t.shallowRef({}),y=t.ref(!1),g=t.computed(()=>{const w={position:m.value,left:"0",top:"0"};if(!u.value)return w;const b=si(u.value,f.value),A=si(u.value,h.value);return c.value?{...w,transform:"translate("+b+"px, "+A+"px)",...ri(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:A+"px"}});let B;function k(){if(d.value==null||u.value==null)return;const w=r.value;qu(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,h.value=b.y,m.value=b.strategy,p.value=b.placement,x.value=b.middlewareData,y.value=w!==!1})}function C(){typeof B=="function"&&(B(),B=void 0)}function E(){if(C(),a===void 0){k();return}if(d.value!=null&&u.value!=null){B=a(d.value,u.value,k);return}}function _(){r.value||(y.value=!1)}return t.watch([s,i,l,r],k,{flush:"sync"}),t.watch([d,u],E,{flush:"sync"}),t.watch(r,_,{flush:"sync"}),t.getCurrentScope()&&t.onScopeDispose(C),{x:t.shallowReadonly(f),y:t.shallowReadonly(h),strategy:t.shallowReadonly(m),placement:t.shallowReadonly(p),middlewareData:t.shallowReadonly(x),isPositioned:t.shallowReadonly(y),floatingStyles:g,update:k}}const Xu=["aria-busy"],Yu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Ku=["for"],Ju={key:0,class:"ml-1 text-destructive"},Qu={class:"relative"},Zu={key:0,class:"flex items-center text-gray-500 gap-2"},ef=["id","placeholder","disabled","readonly","value"],tf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},nf=["disabled"],of={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},af=["onMouseenter","onClick"],rf={key:0},sf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},lf={key:0},cf={key:1},df={key:2},uf={key:1,class:"mt-1 text-xs text-red-600"},Wo=t.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,r=t.useAttrs(),s=t.computed(()=>r.label??void 0),i=G=>{const le=r[G];return le===""||le===!0||le==="true"||le===1||le==="1"},l=t.ref(!1),c=t.computed(()=>o.itemTitle||r["item-title"]||r.itemTitle||"name"),d=t.computed(()=>o.itemValue||r["item-value"]||r.itemValue||"id"),u=t.computed(()=>o.disabled),f=t.computed(()=>i("required")),h=t.computed(()=>i("readonly")),m=t.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=t.computed(()=>f.value||i("aria-required")),x=t.computed(()=>o.error||o.errorMessage||r["error-message"]),y=t.computed(()=>r.placeholder??""),g=t.computed(()=>{const G=r.minChars??r["min-chars"];if(G==null||G==="")return 0;const le=typeof G=="number"?G:Number.parseInt(String(G),10);return Number.isFinite(le)&&le>0?le:0}),B=t.computed(()=>{const G=r.rules;return Array.isArray(G)?G:[]}),k=t.computed(()=>{const G=r.id||r.label;return G?`app-autocomplete-${G}-${Math.random().toString(36).slice(2,7)}`:void 0}),C=t.ref(o.modelValue),E=t.ref([]),_=t.ref(!1),w=t.ref(!1),b=t.computed(()=>r.items),A=t.computed(()=>{const G=T.value;return G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems?E.value:b.value??[]}),D=t.computed(()=>!!r.loading),M=t.computed(()=>D.value||_.value),V=t.computed(()=>{const{label:G,items:le,loading:be,rules:Oe,"item-title":De,"item-value":Z,itemTitle:se,itemValue:ce,minChars:we,"min-chars":je,clearable:Tt,required:Ga,"aria-required":Id,disabled:Xa,readonly:Ld,visible:rt,"return-object":$d,returnObject:Ya,class:Wd,"fetch-items":Ka,fetchItems:jd,error:Os,errorMessage:Ud,"error-message":Hd,...Ja}=r||{};return Ja}),N=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=t.computed(()=>{const G=o.endpoint||{};return{apiModule:o.apiModule||G.apiModule,apiAction:o.apiAction||G.apiAction,apiUrl:G.apiUrl,apiMethod:G.apiMethod||"GET"}}),K=t.ref(null),R=t.ref(null),I=t.ref(null),{floatingStyles:q}=pr(R,I,{placement:"bottom-start",whileElementsMounted:dr,middleware:[ur(4),hr(),fr(),mr({apply({rects:G,elements:le,availableHeight:be}){Object.assign(le.floating.style,{width:`${G.reference.width}px`,maxHeight:`${be}px`})}})]}),ne=t.ref(!1),W=t.ref(""),U=t.ref(-1),ee=t.ref(null),v=t.computed(()=>!g.value||(W.value||"").trim().length>=g.value?"":`Ketik minimal ${g.value} karakter`),O=G=>{if(G==null)return"";if(typeof G=="string"||typeof G=="number")return String(G);const le=c.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.name)??(G==null?void 0:G.nama)??(G==null?void 0:G.label)??(G==null?void 0:G.title)??"-"},$=G=>{if(G==null)return null;if(typeof G=="string"||typeof G=="number")return G;const le=d.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.id)??(G==null?void 0:G.value)??(G==null?void 0:G.code)??null},X=t.computed(()=>{const G=C.value;if(G==null||G==="")return"";if(Array.isArray(G))return G.length?G.map(Oe=>{if(m.value&&typeof Oe=="object"||typeof Oe=="object")return O(Oe);const De=A.value.find(Z=>$(Z)==Oe);return De?O(De):String(Oe)}).join(", "):"";if(typeof G=="object")return O(G);const le=A.value.find(be=>$(be)==G);return le?O(le):String(G)}),te=t.computed(()=>{const G=A.value||[],le=(W.value||"").trim().toLowerCase(),be=(X.value||"").toLowerCase(),Oe=!le||le===be;let De=G;if(Oe||(De=G.filter(Z=>O(Z).toLowerCase().includes(le))),De.length>0){const Z=se=>{const ce=$(se);return Array.isArray(C.value)?C.value.some(we=>we==ce):C.value==ce};De=[...De].sort((se,ce)=>{const we=Z(se),je=Z(ce);return we&&!je?-1:!we&&je?1:0})}return De}),ie=G=>Array.isArray(G)?G.length===0:G==null||G==="",re=G=>{if(ee.value=null,f.value&&ie(G)&&!B.value.length)return ee.value="This field is required",!1;for(const le of B.value){const be=le(G);if(be===!1)return ee.value="Invalid value",!1;if(typeof be=="string")return ee.value=be,!1}return!0},z=async()=>{if(u.value||h.value)return;ne.value=!0,U.value=te.value.length?0:-1,W.value=X.value||"";const G=T.value,le=G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems;o.autoFetchOnOpen&&le&&!w.value&&(await pe(),U.value=te.value.length?0:-1)},P=()=>{ne.value=!1,U.value=-1,W.value=X.value||""},H=G=>{const le=m.value?G:$(G);let be=le;Array.isArray(C.value)&&(be=[le]),C.value=be,a("update:modelValue",be),ee.value=null,re(be),W.value=O(G),P()},Y=()=>{E.value=[],w.value=!1,C.value=Array.isArray(C.value)?[]:null,a("update:modelValue",C.value),W.value="",ee.value=null},ae=()=>{l.value=!0,Y(),P(),setTimeout(()=>{l.value=!1},0)},ye=G=>{if(u.value||h.value)return;const le=G.target.value;W.value=le,ee.value&&(ee.value=null),ne.value||(ne.value=!0),U.value=te.value.length?0:-1;const be=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&be&&!M.value&&!w.value&&pe()},xe=G=>{var be;if(u.value||h.value)return;const le={ArrowDown:()=>{if(G.preventDefault(),!ne.value){z();return}te.value.length&&(U.value=Math.min(U.value+1,te.value.length-1))},ArrowUp:()=>{!ne.value||!te.value.length||(G.preventDefault(),U.value=Math.max(U.value-1,0))},Enter:()=>{if(!ne.value)return;G.preventDefault();const Oe=te.value[U.value];Oe&&H(Oe)},Escape:()=>{G.preventDefault(),P()},Tab:()=>{P()}};(be=le[G.key])==null||be.call(le)},pe=async()=>{const G=T.value;if(G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems){_.value=!0;try{let be;if(o.fetchItems){const Oe=N()||{},De={page:1,perPage:100,search:(W.value||"").trim(),...Oe,...o.apiParams},Z=await o.fetchItems(De),se=(Z==null?void 0:Z.data)??Z;be=(se==null?void 0:se.data)??se}else{const De=qe().DCodeApi;if(typeof De!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const se={page:1,perPage:100,...N()||{},...o.apiParams};let ce;G.apiUrl?ce=await De("","",se,{_url:G.apiUrl,_method:G.apiMethod||"POST"}):ce=await De(G.apiModule,G.apiAction,se);const we=(ce==null?void 0:ce.data)??ce;be=(we==null?void 0:we.data)??we}E.value=Array.isArray(be)?be:[],w.value=!0}catch(be){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",be),ee.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(be==null?void 0:be.message)||(be==null?void 0:be.toString())||"Failed to load options"}`,E.value=[],w.value=!0}finally{_.value=!1}}},ke=G=>{const le=$(G);return m.value?C.value?Array.isArray(C.value)?C.value.some(be=>$(be)==le):$(C.value)==le:!1:Array.isArray(C.value)?C.value.some(be=>be==le):C.value==le};t.watch(()=>[N(),T.value,o.apiParams],([G,le,be],[Oe,De,Z])=>{const se=T.value;if(!(se.apiModule&&se.apiAction||se.apiUrl||o.fetchItems)){Y();return}const we=JSON.stringify(G??null)===JSON.stringify(Oe??null),je=JSON.stringify(be??null)===JSON.stringify(Z??null);we&&je||(Y(),je||pe())},{deep:!0}),t.watch(()=>o.modelValue,(G,le)=>{C.value=G,!l.value&&(G==null||G==="")&&le!=null&&o.apiModule&&o.apiAction&&(E.value=[],w.value=!1),W.value=X.value||""},{immediate:!0});const Fe=T.value;(Fe.apiModule&&Fe.apiAction||Fe.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ie(o.modelValue))&&pe();const it=G=>{const le=K.value,be=I.value,Oe=G.target;le&&le.contains(Oe)||be&&be.contains(Oe)||ne.value&&P()},_t=t.computed(()=>{const G=o.modelValue;return G==null?!1:typeof G=="string"?G.trim().length>0:Array.isArray(G)?G.length>0:typeof G=="object"?Object.keys(G).length>0:!0}),et=t.computed(()=>!!o.clearable&&_t.value&&!o.disabled);return t.onMounted(()=>{document.addEventListener("mousedown",it)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",it)}),(G,le)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref_key:"rootEl",ref:K,class:t.normalizeClass(["w-full",t.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.value?(t.openBlock(),t.createElementBlock("div",Yu)):t.createCommentVNode("",!0),le[6]||(le[6]=t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.value?(t.openBlock(),t.createElementBlock("label",{key:0,for:k.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[t.createTextVNode(t.toDisplayString(s.value)+" ",1),p.value?(t.openBlock(),t.createElementBlock("span",Ju,"*")):t.createCommentVNode("",!0)],8,Ku)):t.createCommentVNode("",!0),t.createElementVNode("div",Qu,[t.createElementVNode("div",{ref_key:"reference",ref:R,class:t.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||h.value?"opacity-60 cursor-not-allowed":"",ee.value||x.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||G.$slots["prepend-inner"]?(t.openBlock(),t.createElementBlock("div",Zu,[t.renderSlot(G.$slots,"prepend-inner",{},()=>[o.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("input",t.mergeProps(V.value,{id:k.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||h.value?"cursor-not-allowed":"cursor-text"],placeholder:y.value,disabled:u.value,readonly:h.value,value:ne.value?W.value:X.value||W.value,onFocus:le[0]||(le[0]=()=>{ne.value||z()}),onClick:le[1]||(le[1]=()=>{ne.value||z()}),onInput:ye,onKeydown:xe,onBlur:le[2]||(le[2]=()=>re(C.value))}),null,16,ef),M.value?(t.openBlock(),t.createElementBlock("svg",tf,[...le[7]||(le[7]=[t.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),t.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):et.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:le[3]||(le[3]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers(ae,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(t.openBlock(),t.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||h.value,onClick:le[4]||(le[4]=be=>ne.value?P():z()),"aria-label":"Toggle"},[t.createVNode(t.unref(oe.ChevronDown),{class:t.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":ne.value}])},null,8,["class"])],8,nf))],2),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[ne.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"floating",ref:I,style:t.normalizeStyle(t.unref(q)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[t.createElementVNode("div",of,[te.value.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(te.value,(be,Oe)=>(t.openBlock(),t.createElementBlock("button",{key:$(be)??Oe,type:"button",class:t.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Oe===U.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:De=>U.value=Oe,onMousedown:le[5]||(le[5]=t.withModifiers(()=>{},["prevent"])),onClick:De=>H(be)},[t.createTextVNode(t.toDisplayString(O(be))+" ",1),ke(be)?(t.openBlock(),t.createElementBlock("span",rf," ✓ ")):t.createCommentVNode("",!0)],42,af))),128)):t.renderSlot(G.$slots,"no-data",{key:1},()=>[t.createElementVNode("div",sf,[M.value?(t.openBlock(),t.createElementBlock("span",lf,"Loading data…")):v.value?(t.openBlock(),t.createElementBlock("span",cf,t.toDisplayString(v.value),1)):(t.openBlock(),t.createElementBlock("span",df,"No data available"))])])])],4)):t.createCommentVNode("",!0)]))]),ee.value||x.value?(t.openBlock(),t.createElementBlock("p",uf,t.toDisplayString(ee.value||x.value),1)):t.createCommentVNode("",!0)],64))],10,Xu)),[[t.vShow,e.visible]])}}),ff=["aria-busy"],hf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mf=["for"],pf={key:0,class:"ml-1 text-destructive"},gf={class:"relative"},bf={key:0,class:"flex items-center text-gray-500 gap-2"},yf=["id","placeholder","disabled","value"],xf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},kf=["disabled"],wf={key:0,class:"p-3 space-y-2"},Cf=["onMouseenter","onClick"],Bf={class:"flex items-center space-x-3"},_f={class:"flex-1"},Ef={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Sf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Af={key:0},Vf={key:2,class:"p-3 text-center"},Df={class:"inline-flex items-center space-x-2"},Mf={class:"text-sm text-gray-500"},Nf={key:3,class:"p-3 text-center"},Pf={class:"text-xs text-gray-400"},vf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Tf={key:1,class:"mt-1 text-xs text-red-600"},Of={key:2,class:"mt-1 text-xs text-gray-500"},ii=t.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(e,{emit:n}){const o=e,a=n,r=t.useAttrs(),s=t.ref(),i=t.ref(),l=t.ref(),c=t.ref(),d=t.ref(),u=t.computed(()=>{const U=o.label||o.placeholder;return U?`app-infinite-autocomplete-${U}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=t.ref(""),h=t.ref([]),m=t.ref(!1),p=t.ref(!1),x=t.ref(-1),y=t.ref(1),g=t.ref(!0),B=t.ref(0),k=t.ref(),{floatingStyles:C}=pr(c,d,{placement:"bottom-start",whileElementsMounted:dr,middleware:[ur(4),hr(),fr(),mr({apply({rects:U,elements:ee}){Object.assign(ee.floating.style,{width:`${U.reference.width}px`})}})]});t.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const E=t.computed(()=>f.value?h.value.filter(U=>A(U).toLowerCase().includes(f.value.toLowerCase())):h.value),_=t.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const U=h.value.find(ee=>D(ee)===o.modelValue);return U?A(U):String(o.modelValue)}}return""}),w=()=>{p.value=!0},b=()=>{p.value=!1},A=U=>typeof o.itemTitle=="function"?o.itemTitle(U):U[o.itemTitle]||"",D=U=>typeof o.itemValue=="function"?o.itemValue(U):U[o.itemValue]||U,M=U=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(U):U[o.itemSubtitle]||"":"",V=U=>o.modelValue?o.returnObject?D(U)===D(o.modelValue):D(U)===o.modelValue:!1,N=U=>{var v;const ee=o.returnObject?U:D(U);a("update:modelValue",ee),a("select",U),p.value=!1,f.value="",(v=s.value)==null||v.blur()},T=()=>{var U;a("update:modelValue",null),f.value="",(U=s.value)==null||U.focus()},K=U=>{p.value=!0,a("focus",U),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&W(!0)},R=U=>{setTimeout(()=>{p.value=!1,a("blur",U)},200)},I=U=>{const ee=U.target;f.value=ee.value,k.value&&clearTimeout(k.value),k.value=setTimeout(()=>{a("search",f.value),y.value=1,g.value=!0,W(!0)},o.debounceMs)},q=U=>{if(p.value)switch(U.key){case"ArrowDown":U.preventDefault(),x.value=Math.min(x.value+1,E.value.length-1);break;case"ArrowUp":U.preventDefault(),x.value=Math.max(x.value-1,0);break;case"Enter":U.preventDefault(),x.value>=0&&E.value[x.value]&&N(E.value[x.value]);break;case"Escape":p.value=!1;break}},ne=U=>{if(!g.value||m.value)return;const ee=U.target,{scrollTop:v,scrollHeight:O,clientHeight:$}=ee;v+$>=O-o.threshold&&W()},W=async(U=!1)=>{var ee,v;if(!m.value){m.value=!0;try{let O=[];if(o.fetchItems)O=await o.fetchItems();else{const $=qe(),X=((ee=o.endpoint)==null?void 0:ee.apiModule)||o.apiModule,te=((v=o.endpoint)==null?void 0:v.apiAction)||o.apiAction;if(!X||!te)throw new Error("API module and action are required");const ie={page:U?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},re=await $.apiUrl(`/${X}/${te}`,"GET",ie);O=re.data||re.items||re||[],B.value=re.total||re.totalItems||O.length}U?(h.value=O,y.value=1):(h.value.push(...O),y.value++),g.value=O.length>=o.pageSize,g.value||a("end-of-results"),a("load-more",{items:O,page:y.value,hasMore:g.value,total:B.value})}catch(O){console.error("Error fetching items:",O),a("error",O)}finally{m.value=!1}}};return t.onMounted(()=>{o.autoFetchOnMount&&W()}),t.onUnmounted(()=>{k.value&&clearTimeout(k.value)}),t.watch(()=>o.modelValue,U=>{U||(f.value="")}),(U,ee)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref_key:"rootEl",ref:l,class:t.normalizeClass(["w-full",t.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.label?(t.openBlock(),t.createElementBlock("div",hf)):t.createCommentVNode("",!0),ee[3]||(ee[3]=t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",pf,"*")):t.createCommentVNode("",!0)],8,mf)):t.createCommentVNode("",!0),t.createElementVNode("div",gf,[t.createElementVNode("div",{ref_key:"reference",ref:c,class:t.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[e.disabled?"opacity-60 cursor-not-allowed":"",e.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(t.openBlock(),t.createElementBlock("div",bf,[o.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("input",t.mergeProps({ref_key:"inputRef",ref:s},U.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",e.disabled?"cursor-not-allowed":"cursor-text"],placeholder:e.placeholder,disabled:e.disabled,value:_.value,onFocus:K,onBlur:R,onInput:I,onKeydown:q}),null,16,yf),m.value?(t.openBlock(),t.createElementBlock("svg",xf,[...ee[4]||(ee[4]=[t.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),t.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.clearable&&e.modelValue?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:ee[0]||(ee[0]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(t.openBlock(),t.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:e.disabled,onClick:ee[1]||(ee[1]=v=>p.value?b():w()),"aria-label":"Toggle"},[t.createVNode(t.unref(oe.ChevronDown),{class:t.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":p.value}])},null,8,["class"])],8,kf))],2),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[p.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:t.normalizeStyle(t.unref(C)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[t.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:ne},[m.value&&h.value.length===0?(t.openBlock(),t.createElementBlock("div",wf,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(5,v=>t.createElementVNode("div",{key:v,class:"flex items-center space-x-3"},[...ee[5]||(ee[5]=[t.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),t.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):E.value.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(E.value,(v,O)=>(t.openBlock(),t.createElementBlock("button",{key:D(v)??O,type:"button",class:t.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",O===x.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:$=>x.value=O,onMousedown:ee[2]||(ee[2]=t.withModifiers(()=>{},["prevent"])),onClick:$=>N(v)},[t.renderSlot(U.$slots,"item",{item:v,index:O},()=>[t.createElementVNode("div",Bf,[t.createElementVNode("div",_f,[t.createElementVNode("div",Ef,t.toDisplayString(A(v)),1),e.itemSubtitle?(t.openBlock(),t.createElementBlock("div",Sf,t.toDisplayString(M(v)),1)):t.createCommentVNode("",!0)])])]),V(v)?(t.openBlock(),t.createElementBlock("span",Af," ✓ ")):t.createCommentVNode("",!0)],42,Cf))),128)):t.createCommentVNode("",!0),m.value&&h.value.length>0?(t.openBlock(),t.createElementBlock("div",Vf,[t.createElementVNode("div",Df,[ee[6]||(ee[6]=t.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),t.createElementVNode("span",Mf,t.toDisplayString(e.loadingText),1)])])):t.createCommentVNode("",!0),!g.value&&h.value.length>0?(t.openBlock(),t.createElementBlock("div",Nf,[t.createElementVNode("div",Pf,t.toDisplayString(e.endOfResultsText),1)])):!m.value&&h.value.length===0?(t.openBlock(),t.createElementBlock("div",vf,t.toDisplayString(e.noResultsText),1)):t.createCommentVNode("",!0)],544)],4)):t.createCommentVNode("",!0)]))]),e.error?(t.openBlock(),t.createElementBlock("p",Tf,t.toDisplayString(e.errorMessage||e.error),1)):e.helperText?(t.openBlock(),t.createElementBlock("p",Of,t.toDisplayString(e.helperText),1)):t.createCommentVNode("",!0)],64))],10,ff)),[[t.vShow,e.visible]])}});function li(e){var n,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(o=li(e[n]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function ci(){for(var e,n,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(n=li(e))&&(a&&(a+=" "),a+=n);return a}const zf=(e,n)=>{const o=new Array(e.length+n.length);for(let a=0;a<e.length;a++)o[a]=e[a];for(let a=0;a<n.length;a++)o[e.length+a]=n[a];return o},Ff=(e,n)=>({classGroupId:e,validator:n}),di=(e=new Map,n=null,o)=>({nextPart:e,validators:n,classGroupId:o}),jo="-",ui=[],Rf="arbitrary..",If=e=>{const n=$f(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Lf(i);const l=i.split(jo),c=l[0]===""&&l.length>1?1:0;return fi(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=o[i];return c?d?zf(d,c):c:d||ui}return o[i]||ui}}},fi=(e,n,o)=>{if(e.length-n===0)return o.classGroupId;const r=e[n],s=o.nextPart.get(r);if(s){const d=fi(e,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?e.join(jo):e.slice(n).join(jo),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Lf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),o=n.indexOf(":"),a=n.slice(0,o);return a?Rf+a:void 0})(),$f=e=>{const{theme:n,classGroups:o}=e;return Wf(o,n)},Wf=(e,n)=>{const o=di();for(const a in e){const r=e[a];gr(r,o,a,n)}return o},gr=(e,n,o,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];jf(i,n,o,a)}},jf=(e,n,o,a)=>{if(typeof e=="string"){Uf(e,n,o);return}if(typeof e=="function"){Hf(e,n,o,a);return}qf(e,n,o,a)},Uf=(e,n,o)=>{const a=e===""?n:hi(n,e);a.classGroupId=o},Hf=(e,n,o,a)=>{if(Gf(e)){gr(e(a),n,o,a);return}n.validators===null&&(n.validators=[]),n.validators.push(Ff(o,e))},qf=(e,n,o,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];gr(c,hi(n,l),o,a)}},hi=(e,n)=>{let o=e;const a=n.split(jo),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=o.nextPart.get(i);l||(l=di(),o.nextPart.set(i,l)),o=l}return o},Gf=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),a=Object.create(null);const r=(s,i)=>{o[s]=i,n++,n>e&&(n=0,a=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in o?o[s]=i:r(s,i)}}},br="!",mi=":",Yf=[],pi=(e,n,o,a,r)=>({modifiers:e,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:a,isExternal:r}),Kf=e=>{const{prefix:n,experimentalParseClassName:o}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let x=0;x<u;x++){const y=r[x];if(i===0&&l===0){if(y===mi){s.push(r.slice(c,x)),c=x+1;continue}if(y==="/"){d=x;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(br)?(h=f.slice(0,-1),m=!0):f.startsWith(br)&&(h=f.slice(1),m=!0);const p=d&&d>c?d-c:void 0;return pi(s,m,h,p)};if(n){const r=n+mi,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):pi(Yf,!1,i,void 0,!0)}if(o){const r=a;a=s=>o({className:s,parseClassName:r})}return a},Jf=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((o,a)=>{n.set(o,1e6+a)}),o=>{const a=[];let r=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},Qf=e=>({cache:Xf(e.cacheSize),parseClassName:Kf(e),sortModifiers:Jf(e),...If(e)}),Zf=/\s+/,eh=(e,n)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=n,i=[],l=e.trim().split(Zf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:x}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!x,g=a(y?p.substring(0,x):p);if(!g){if(!y){c=u+(c.length>0?" "+c:c);continue}if(g=a(p),!g){c=u+(c.length>0?" "+c:c);continue}y=!1}const B=h.length===0?"":h.length===1?h[0]:s(h).join(":"),k=m?B+br:B,C=k+g;if(i.indexOf(C)>-1)continue;i.push(C);const E=r(g,y);for(let _=0;_<E.length;++_){const w=E[_];i.push(k+w)}c=u+(c.length>0?" "+c:c)}return c},th=(...e)=>{let n=0,o,a,r="";for(;n<e.length;)(o=e[n++])&&(a=gi(o))&&(r&&(r+=" "),r+=a);return r},gi=e=>{if(typeof e=="string")return e;let n,o="";for(let a=0;a<e.length;a++)e[a]&&(n=gi(e[a]))&&(o&&(o+=" "),o+=n);return o},nh=(e,...n)=>{let o,a,r,s;const i=c=>{const d=n.reduce((u,f)=>f(u),e());return o=Qf(d),a=o.cache.get,r=o.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=eh(c,o);return r(c,u),u};return s=i,(...c)=>s(th(...c))},oh=[],Xe=e=>{const n=o=>o[e]||oh;return n.isThemeGetter=!0,n},bi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ah=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ih=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>ah.test(e),_e=e=>!!e&&!Number.isNaN(Number(e)),Zt=e=>!!e&&Number.isInteger(Number(e)),yr=e=>e.endsWith("%")&&_e(e.slice(0,-1)),Rt=e=>rh.test(e),xi=()=>!0,dh=e=>sh.test(e)&&!ih.test(e),xr=()=>!1,uh=e=>lh.test(e),fh=e=>ch.test(e),hh=e=>!fe(e)&&!he(e),mh=e=>en(e,Ei,xr),fe=e=>bi.test(e),pn=e=>en(e,Si,dh),ki=e=>en(e,Ch,_e),ph=e=>en(e,Vi,xi),gh=e=>en(e,Ai,xr),wi=e=>en(e,Bi,xr),bh=e=>en(e,_i,fh),Uo=e=>en(e,Di,uh),he=e=>yi.test(e),oo=e=>gn(e,Si),yh=e=>gn(e,Ai),Ci=e=>gn(e,Bi),xh=e=>gn(e,Ei),kh=e=>gn(e,_i),Ho=e=>gn(e,Di,!0),wh=e=>gn(e,Vi,!0),en=(e,n,o)=>{const a=bi.exec(e);return a?a[1]?n(a[1]):o(a[2]):!1},gn=(e,n,o=!1)=>{const a=yi.exec(e);return a?a[1]?n(a[1]):o:!1},Bi=e=>e==="position"||e==="percentage",_i=e=>e==="image"||e==="url",Ei=e=>e==="length"||e==="size"||e==="bg-size",Si=e=>e==="length",Ch=e=>e==="number",Ai=e=>e==="family-name",Vi=e=>e==="number"||e==="weight",Di=e=>e==="shadow",Bh=nh(()=>{const e=Xe("color"),n=Xe("font"),o=Xe("text"),a=Xe("font-weight"),r=Xe("tracking"),s=Xe("leading"),i=Xe("breakpoint"),l=Xe("container"),c=Xe("spacing"),d=Xe("radius"),u=Xe("shadow"),f=Xe("inset-shadow"),h=Xe("text-shadow"),m=Xe("drop-shadow"),p=Xe("blur"),x=Xe("perspective"),y=Xe("aspect"),g=Xe("ease"),B=Xe("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),he,fe],_=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto","contain","none"],b=()=>[he,fe,c],A=()=>[Qt,"full","auto",...b()],D=()=>[Zt,"none","subgrid",he,fe],M=()=>["auto",{span:["full",Zt,he,fe]},Zt,he,fe],V=()=>[Zt,"auto",he,fe],N=()=>["auto","min","max","fr",he,fe],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...b()],I=()=>[Qt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],q=()=>[Qt,"screen","full","dvw","lvw","svw","min","max","fit",...b()],ne=()=>[Qt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],W=()=>[e,he,fe],U=()=>[...C(),Ci,wi,{position:[he,fe]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],v=()=>["auto","cover","contain",xh,mh,{size:[he,fe]}],O=()=>[yr,oo,pn],$=()=>["","none","full",d,he,fe],X=()=>["",_e,oo,pn],te=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[_e,yr,Ci,wi],z=()=>["","none",p,he,fe],P=()=>["none",_e,he,fe],H=()=>["none",_e,he,fe],Y=()=>[_e,he,fe],ae=()=>[Qt,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rt],breakpoint:[Rt],color:[xi],container:[Rt],"drop-shadow":[Rt],ease:["in","out","in-out"],font:[hh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rt],shadow:[Rt],spacing:["px",_e],text:[Rt],"text-shadow":[Rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qt,fe,he,y]}],container:["container"],columns:[{columns:[_e,fe,he,l]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Zt,"auto",he,fe]}],basis:[{basis:[Qt,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Qt,"auto","initial","none",fe]}],grow:[{grow:["",_e,he,fe]}],shrink:[{shrink:["",_e,he,fe]}],order:[{order:[Zt,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[l,"screen",...I()]}],"min-w":[{"min-w":[l,"screen","none",...I()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",o,oo,pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,wh,ph]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yr,fe]}],"font-family":[{font:[yh,gh,n]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,he,fe]}],"line-clamp":[{"line-clamp":[_e,"none",he,ki]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",he,pn]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[_e,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:v()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zt,he,fe],radial:["",he,fe],conic:[Zt,he,fe]},kh,bh]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,he,fe]}],"outline-w":[{outline:["",_e,oo,pn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,Ho,Uo]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",f,Ho,Uo]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[_e,pn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",h,Ho,Uo]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[_e,he,fe]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:v()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:z()}],brightness:[{brightness:[_e,he,fe]}],contrast:[{contrast:[_e,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",m,Ho,Uo]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",_e,he,fe]}],"hue-rotate":[{"hue-rotate":[_e,he,fe]}],invert:[{invert:["",_e,he,fe]}],saturate:[{saturate:[_e,he,fe]}],sepia:[{sepia:["",_e,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[_e,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[_e,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",_e,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[_e,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[_e,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",he,fe]}],ease:[{ease:["linear","initial",g,he,fe]}],delay:[{delay:[_e,he,fe]}],animate:[{animate:["none",B,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,he,fe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:P()}],"rotate-x":[{"rotate-x":P()}],"rotate-y":[{"rotate-y":P()}],"rotate-z":[{"rotate-z":P()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[_e,oo,pn,ki]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ee(...e){return Bh(ci(e))}function _h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kr={},wr={},qo={exports:{}},Mi;function Eh(){if(Mi)return qo.exports;Mi=1;var e=String,n=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return qo.exports=n(),qo.exports.createColors=n,qo.exports}var Ni;function Sh(){return Ni||(Ni=1,(function(e){var n={};Object.defineProperty(e,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(e,{dim:function(){return l},default:function(){return c}});const a=r(Eh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return a.default.dim(d)}const c={info(d,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(wr)),wr}var Pi;function Ah(){return Pi||(Pi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const n=o(Sh());function o(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const r={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(kr)),kr}var Cr,vi;function Vh(){if(vi)return Cr;vi=1;let e=Ah();return Cr=(e.__esModule?e:{default:e}).default,Cr}var Dh=Vh();const Mh=_h(Dh),Ti=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Oi=ci,ao=(e,n)=>o=>{var a;if((n==null?void 0:n.variants)==null)return Oi(e,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:r,defaultVariants:s}=n,i=Object.keys(r).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Ti(u)||Ti(f);return r[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=n==null||(a=n.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(p=>{let[x,y]=p;return Array.isArray(y)?y.includes({...s,...l}[x]):{...s,...l}[x]===y})?[...d,f,h]:d},[]);return Oi(e,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},mt=t.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.Primitive),{as:e.as,"as-child":e.asChild,class:t.normalizeClass(t.unref(Ee)(t.unref(Tn)({variant:e.variant,size:e.size}),n.class))},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Tn=ao("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),zi=t.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const o=e,a=n,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(t.openBlock(),t.createBlock(t.unref(ue.TooltipRoot),t.normalizeProps(t.guardReactiveProps(t.unref(r))),{default:t.withCtx(()=>[t.renderSlot(s.$slots,"default")]),_:3},16))}}),Fi=t.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:n}){const o=e,a=n,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(t.openBlock(),t.createBlock(t.unref(ue.TooltipPortal),null,{default:t.withCtx(()=>[t.createVNode(t.unref(ue.TooltipContent),t.mergeProps({...t.unref(s),...i.$attrs},{class:t.unref(Ee)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:t.withCtx(()=>[t.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Ri=t.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.TooltipProvider),t.normalizeProps(t.guardReactiveProps(n)),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),Ii=t.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.TooltipTrigger),t.normalizeProps(t.guardReactiveProps(n)),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),Nh={class:"relative z-10"},Ph="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] shadow-[0_3px_0_0_rgba(0,0,0,0.12),0_12px_22px_-10px_rgba(0,0,0,0.35)] hover:shadow-[0_6px_20px_-4px_rgba(0,0,0,0.3),0_10px_40px_-10px_rgba(0,0,0,0.2)] active:shadow-[0_1px_0_0_rgba(0,0,0,0.2),0_4px_8px_-4px_rgba(0,0,0,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",vh=t.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(e){const n=t.useAttrs(),o=e,a=t.computed(()=>o.icon&&Et[o.icon]||null),r=t.computed(()=>!!o.tooltip),s=t.computed(()=>o.visible??!0),i=t.computed(()=>{const v=String(o.variant||"default").toLowerCase();return v==="tonal"?"secondary":v==="elevated"?"default":v}),l=t.computed(()=>String(o.bgColor||"").toLowerCase()),c=t.computed(()=>String(o.type||"button").toLowerCase()),d=t.computed(()=>{const{class:v,...O}=n;return O}),u=t.computed(()=>Ee(n.class)),f=t.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=t.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=t.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=t.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),x=t.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),y=t.computed(()=>Ee("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,h.value,m.value,f.value)),g=t.computed(()=>{const O=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),B=t.computed(()=>{const O=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),k=t.computed(()=>!!g.value),C=t.computed(()=>/\bborder-/.test(u.value??"")),E=t.computed(()=>/\bhover:/.test(u.value??"")),_=t.computed(()=>{const v=u.value??"";return i.value!=="outline"?v:v.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),w=t.ref(null),b=v=>{const O=v.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return O?{r:Number(O[1]),g:Number(O[2]),b:Number(O[3]),a:O[4]?Number(O[4]):1}:null},A=(v,O)=>{const $=b(v);if(!$)return v;const X=te=>Math.max(0,Math.min(255,Math.round(te)));return`rgba(${X($.r*(1-O))}, ${X($.g*(1-O))}, ${X($.b*(1-O))}, ${$.a})`},D=v=>{if(globalThis.window===void 0)return null;const O=document.createElement("div");O.className=v,O.style.position="absolute",O.style.visibility="hidden",O.style.pointerEvents="none",O.style.width="1px",O.style.height="1px",document.body.appendChild(O);const $=globalThis.getComputedStyle(O).backgroundColor;return O.remove(),!$||$==="transparent"||$==="rgba(0, 0, 0, 0)"?null:$},M=[50,100,200,300,400,500,600,700,800,900,950],V=v=>{const O=M.indexOf(v);return O===-1?v:M[Math.min(M.length-1,O+2)]},N=(v,O)=>{const $=Mh[v];if(!$)return null;if(typeof $=="string")return $;if(!O)return null;const X=$[O];return typeof X=="string"?X:null},T=(v,O=!1)=>{if(!v)return null;const $=O?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,X=v.match($);return X?{colorName:X[1],shade:X[2]?Number.parseInt(X[2],10):null}:null},K=()=>{const v=g.value;if(!v){w.value=null;return}const O=T(v),$=O==null?void 0:O.colorName,X=(O==null?void 0:O.shade)??null,te=($?N($,X):null)??D(v);if(!te){w.value=null;return}let ie;const re=T(B.value,!0),z=re?N(re.colorName,re.shade??null):null;if(z)ie=z;else if($&&X){const P=V(X);ie=N($,P)??A(te,.2)}else ie=A(te,.2);w.value={"--btn-color":te,"--btn-color-hover":ie}};t.onMounted(()=>{K()}),t.watch([g,B],async()=>{await t.nextTick(),K()});const R=t.computed(()=>{const v=/\bdark:bg-/.test(u.value??"");return!k.value||i.value==="outline"||v?"":w.value?"dcode-btn--fill dcode-btn--fill-hover":E.value?"":"hover:brightness-90"}),I=t.computed(()=>{if(!k.value||i.value!=="outline")return"";const v=["dcode-btn--outline","dcode-btn--outline-hover"];return C.value||v.push("border"),!w.value&&!E.value&&v.push("hover:brightness-90"),v.join(" ")}),q=t.computed(()=>w.value??void 0),ne={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},W={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",hover:"hover:from-blue-600 hover:to-cyan-600"},"gradient-purple":{bg:"bg-gradient-to-r from-purple-500 to-pink-500",text:"text-white",hover:"hover:from-purple-600 hover:to-pink-600"},"gradient-sunset":{bg:"bg-gradient-to-r from-orange-500 to-red-500",text:"text-white",hover:"hover:from-orange-600 hover:to-red-600"},"gradient-emerald":{bg:"bg-gradient-to-r from-emerald-500 to-teal-500",text:"text-white",hover:"hover:from-emerald-600 hover:to-teal-600"}},U=t.computed(()=>{const v=[],O=l.value,$=String(o.borderColor||"").toLowerCase(),X=O?ne[O]:null,te=O?W[O]:null,ie=$?ne[$]:null;return O&&(X?ie&&$!==O?(v.push(X.bg,ie.hoverBg),o.textColor||v.push(X.text,ie.hoverText)):(v.push(X.bg,X.hoverBg),o.textColor||v.push(X.text,X.hoverText)):te?(v.push(te.bg,te.hover),o.textColor||v.push(te.text)):O==="transparent"?ie?(v.push("bg-transparent",ie.hoverBg),o.textColor||v.push("text-inherit",ie.hoverText)):v.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):v.push(O)),$?ie?v.push(ie.border,ie.hoverBorder):v.push($):X&&i.value!=="ghost"&&i.value!=="link"&&v.push(X.border,X.hoverBorder),o.textColor&&v.push(o.textColor),v.join(" ")}),ee=t.computed(()=>Ee(Ph,p.value,x.value,_.value,R.value,I.value,U.value));return(v,O)=>s.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.skeleton?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(t.openBlock(),t.createBlock(t.unref(Ri),{key:1,"delay-duration":0},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createBlock(t.unref(zi),{key:0},{default:t.withCtx(()=>[t.createVNode(t.unref(Ii),{"as-child":""},{default:t.withCtx(()=>[t.createVNode(t.unref(mt),t.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:q.value},d.value),{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):t.createCommentVNode("",!0),o.text?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(a.value?"ml-1":"")},t.toDisplayString(o.text),3)):t.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),t.createVNode(t.unref(Fi),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:t.withCtx(()=>[t.createElementVNode("span",Nh,t.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(t.openBlock(),t.createBlock(t.unref(mt),t.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:q.value},d.value),{default:t.withCtx(()=>[t.renderSlot(v.$slots,"default",{},()=>[a.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):t.createCommentVNode("",!0),o.text?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(a.value?"ml-1":"")},t.toDisplayString(o.text),3)):t.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):t.createCommentVNode("",!0)}}),pt=(e,n)=>{const o=e.__vccOpts||e;for(const[a,r]of n)o[a]=r;return o},Ye=pt(vh,[["__scopeId","data-v-d4cd902d"]]),Th={key:0,class:"flex items-center justify-between bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 px-4 py-3"},Oh={class:"flex flex-col gap-1"},zh={key:0,class:"text-sm font-semibold text-white leading-tight"},Fh={key:1,class:"text-xs text-primary-100 dark:text-primary-200"},Rh={key:0,class:"flex items-center gap-2"},Ih={name:"DCodeCard"},Li=t.defineComponent({...Ih,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(e){const n=e,o=t.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-800";case 3:return"bg-neutral-100 dark:bg-neutral-700";case 1:default:return"bg-white dark:bg-neutral-900"}});return(a,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":e.shadow},{"border-transparent":!e.border},{"border-neutral-200 dark:border-neutral-800":e.border&&e.level===1},{"border-neutral-300 dark:border-neutral-700":e.border&&e.level!==1},"overflow-hidden"]])},[e.title||a.$slots.header||a.$slots.actions?(t.openBlock(),t.createElementBlock("div",Th,[t.createElementVNode("div",Oh,[t.renderSlot(a.$slots,"header",{},()=>[e.title?(t.openBlock(),t.createElementBlock("h3",zh,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.subtitle?(t.openBlock(),t.createElementBlock("p",Fh,t.toDisplayString(e.subtitle),1)):t.createCommentVNode("",!0)])]),a.$slots.actions?(t.openBlock(),t.createElementBlock("div",Rh,[t.renderSlot(a.$slots,"actions")])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["relative z-10",e.padding])},[t.renderSlot(a.$slots,"default")],2),a.$slots.footer?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800",e.padding])},[t.renderSlot(a.$slots,"footer")],2)):t.createCommentVNode("",!0)],2))}});/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function
|
|
6
|
+
*/function ro(e){return e+.5|0}const tn=(e,n,o)=>Math.max(Math.min(e,o),n);function so(e){return tn(ro(e*2.55),0,255)}function nn(e){return tn(ro(e*255),0,255)}function It(e){return tn(ro(e/2.55)/100,0,1)}function $i(e){return tn(ro(e*100),0,100)}const gt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Br=[..."0123456789ABCDEF"],Lh=e=>Br[e&15],$h=e=>Br[(e&240)>>4]+Br[e&15],Go=e=>(e&240)>>4===(e&15),Wh=e=>Go(e.r)&&Go(e.g)&&Go(e.b)&&Go(e.a);function jh(e){var n=e.length,o;return e[0]==="#"&&(n===4||n===5?o={r:255>[e[1]]*17,g:255>[e[2]]*17,b:255>[e[3]]*17,a:n===5?gt[e[4]]*17:255}:(n===7||n===9)&&(o={r:gt[e[1]]<<4|gt[e[2]],g:gt[e[3]]<<4|gt[e[4]],b:gt[e[5]]<<4|gt[e[6]],a:n===9?gt[e[7]]<<4|gt[e[8]]:255})),o}const Uh=(e,n)=>e<255?n(e):"";function Hh(e){var n=Wh(e)?Lh:$h;return e?"#"+n(e.r)+n(e.g)+n(e.b)+Uh(e.a,n):void 0}const qh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wi(e,n,o){const a=n*Math.min(o,1-o),r=(s,i=(s+e/30)%12)=>o-a*Math.max(Math.min(i-3,9-i,1),-1);return[r(0),r(8),r(4)]}function Gh(e,n,o){const a=(r,s=(r+e/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[a(5),a(3),a(1)]}function Xh(e,n,o){const a=Wi(e,1,.5);let r;for(n+o>1&&(r=1/(n+o),n*=r,o*=r),r=0;r<3;r++)a[r]*=1-n-o,a[r]+=n;return a}function Yh(e,n,o,a,r){return e===r?(n-o)/a+(n<o?6:0):n===r?(o-e)/a+2:(e-n)/a+4}function _r(e){const o=e.r/255,a=e.g/255,r=e.b/255,s=Math.max(o,a,r),i=Math.min(o,a,r),l=(s+i)/2;let c,d,u;return s!==i&&(u=s-i,d=l>.5?u/(2-s-i):u/(s+i),c=Yh(o,a,r,u,s),c=c*60+.5),[c|0,d||0,l]}function Er(e,n,o,a){return(Array.isArray(n)?e(n[0],n[1],n[2]):e(n,o,a)).map(nn)}function Sr(e,n,o){return Er(Wi,e,n,o)}function Kh(e,n,o){return Er(Xh,e,n,o)}function Jh(e,n,o){return Er(Gh,e,n,o)}function ji(e){return(e%360+360)%360}function Qh(e){const n=qh.exec(e);let o=255,a;if(!n)return;n[5]!==a&&(o=n[6]?so(+n[5]):nn(+n[5]));const r=ji(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?a=Kh(r,s,i):n[1]==="hsv"?a=Jh(r,s,i):a=Sr(r,s,i),{r:a[0],g:a[1],b:a[2],a:o}}function Zh(e,n){var o=_r(e);o[0]=ji(o[0]+n),o=Sr(o),e.r=o[0],e.g=o[1],e.b=o[2]}function em(e){if(!e)return;const n=_r(e),o=n[0],a=$i(n[1]),r=$i(n[2]);return e.a<255?`hsla(${o}, ${a}%, ${r}%, ${It(e.a)})`:`hsl(${o}, ${a}%, ${r}%)`}const Ui={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function tm(){const e={},n=Object.keys(Hi),o=Object.keys(Ui);let a,r,s,i,l;for(a=0;a<n.length;a++){for(i=l=n[a],r=0;r<o.length;r++)s=o[r],l=l.replace(s,Ui[s]);s=parseInt(Hi[i],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let Xo;function nm(e){Xo||(Xo=tm(),Xo.transparent=[0,0,0,0]);const n=Xo[e.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const om=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function am(e){const n=om.exec(e);let o=255,a,r,s;if(n){if(n[7]!==a){const i=+n[7];o=n[8]?so(i):tn(i*255,0,255)}return a=+n[1],r=+n[3],s=+n[5],a=255&(n[2]?so(a):tn(a,0,255)),r=255&(n[4]?so(r):tn(r,0,255)),s=255&(n[6]?so(s):tn(s,0,255)),{r:a,g:r,b:s,a:o}}}function rm(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${It(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ar=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,On=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function sm(e,n,o){const a=On(It(e.r)),r=On(It(e.g)),s=On(It(e.b));return{r:nn(Ar(a+o*(On(It(n.r))-a))),g:nn(Ar(r+o*(On(It(n.g))-r))),b:nn(Ar(s+o*(On(It(n.b))-s))),a:e.a+o*(n.a-e.a)}}function Yo(e,n,o){if(e){let a=_r(e);a[n]=Math.max(0,Math.min(a[n]+a[n]*o,n===0?360:1)),a=Sr(a),e.r=a[0],e.g=a[1],e.b=a[2]}}function qi(e,n){return e&&Object.assign(n||{},e)}function Gi(e){var n={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(n={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(n.a=nn(e[3]))):(n=qi(e,{r:0,g:0,b:0,a:1}),n.a=nn(n.a)),n}function im(e){return e.charAt(0)==="r"?am(e):Qh(e)}class io{constructor(n){if(n instanceof io)return n;const o=typeof n;let a;o==="object"?a=Gi(n):o==="string"&&(a=jh(n)||nm(n)||im(n)),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var n=qi(this._rgb);return n&&(n.a=It(n.a)),n}set rgb(n){this._rgb=Gi(n)}rgbString(){return this._valid?rm(this._rgb):void 0}hexString(){return this._valid?Hh(this._rgb):void 0}hslString(){return this._valid?em(this._rgb):void 0}mix(n,o){if(n){const a=this.rgb,r=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=a.a-r.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,a.r=255&d*a.r+s*r.r+.5,a.g=255&d*a.g+s*r.g+.5,a.b=255&d*a.b+s*r.b+.5,a.a=i*a.a+(1-i)*r.a,this.rgb=a}return this}interpolate(n,o){return n&&(this._rgb=sm(this._rgb,n._rgb,o)),this}clone(){return new io(this.rgb)}alpha(n){return this._rgb.a=nn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=ro(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=o,this}opaquer(n){const o=this._rgb;return o.a*=1+n,this}negate(){const n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return Yo(this._rgb,2,n),this}darken(n){return Yo(this._rgb,2,-n),this}saturate(n){return Yo(this._rgb,1,n),this}desaturate(n){return Yo(this._rgb,1,-n),this}rotate(n){return Zh(this._rgb,n),this}}/*!
|
|
7
7
|
* Chart.js v4.5.1
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Lt(){}const fm=(()=>{let e=0;return()=>e++})();function Ne(e){return e==null}function qe(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Se(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function tt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Dt(e,t){return tt(e)?e:t}function Be(e,t){return typeof e>"u"?t:e}const hm=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qi=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ie(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function Pe(e,t,o,a){let r,s,i;if(qe(e))for(s=e.length,r=0;r<s;r++)t.call(o,e[r],r);else if(Se(e))for(i=Object.keys(e),s=i.length,r=0;r<s;r++)t.call(o,e[i[r]],i[r])}function Xo(e,t){let o,a,r,s;if(!e||!t||e.length!==t.length)return!1;for(o=0,a=e.length;o<a;++o)if(r=e[o],s=t[o],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Yo(e){if(qe(e))return e.map(Yo);if(Se(e)){const t=Object.create(null),o=Object.keys(e),a=o.length;let r=0;for(;r<a;++r)t[o[r]]=Yo(e[o[r]]);return t}return e}function Gi(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function mm(e,t,o,a){if(!Gi(e))return;const r=t[e],s=o[e];Se(r)&&Se(s)?io(r,s,a):t[e]=Yo(s)}function io(e,t,o){const a=qe(t)?t:[t],r=a.length;if(!Se(e))return e;o=o||{};const s=o.merger||mm;let i;for(let l=0;l<r;++l){if(i=a[l],!Se(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],e,i,o)}return e}function lo(e,t){return io(e,t,{merger:pm})}function pm(e,t,o){if(!Gi(e))return;const a=t[e],r=o[e];Se(a)&&Se(r)?lo(a,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Yo(r))}const Xi={"":e=>e,x:e=>e.x,y:e=>e.y};function gm(e){const t=e.split("."),o=[];let a="";for(const r of t)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(o.push(a),a="");return o}function bm(e){const t=gm(e);return o=>{for(const a of t){if(a==="")break;o=o&&o[a]}return o}}function gn(e,t){return(Xi[t]||(Xi[t]=bm(t)))(e)}function Sr(e){return e.charAt(0).toUpperCase()+e.slice(1)}const co=e=>typeof e<"u",nn=e=>typeof e=="function",Yi=(e,t)=>{if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0};function ym(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ve=Math.PI,We=2*ve,xm=We+ve,Ko=Number.POSITIVE_INFINITY,km=ve/180,Ye=ve/2,bn=ve/4,Ki=ve*2/3,Ji=Math.log10,Mt=Math.sign;function uo(e,t,o){return Math.abs(e-t)<o}function Qi(e){const t=Math.round(e);e=uo(e,t,e/1e3)?t:e;const o=Math.pow(10,Math.floor(Ji(e))),a=e/o;return(a<=1?1:a<=2?2:a<=5?5:10)*o}function wm(e){const t=[],o=Math.sqrt(e);let a;for(a=1;a<o;a++)e%a===0&&(t.push(a),t.push(e/a));return o===(o|0)&&t.push(o),t.sort((r,s)=>r-s).pop(),t}function Cm(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function fo(e){return!Cm(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Bm(e,t){const o=Math.round(e);return o-t<=e&&o+t>=e}function _m(e,t,o){let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a][o],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function $t(e){return e*(ve/180)}function Em(e){return e*(180/ve)}function Zi(e){if(!tt(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function el(e,t){const o=t.x-e.x,a=t.y-e.y,r=Math.sqrt(o*o+a*a);let s=Math.atan2(a,o);return s<-.5*ve&&(s+=We),{angle:s,distance:r}}function Ar(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Sm(e,t){return(e-t+xm)%We-ve}function ft(e){return(e%We+We)%We}function ho(e,t,o,a){const r=ft(e),s=ft(t),i=ft(o),l=ft(s-r),c=ft(i-r),d=ft(r-s),u=ft(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function nt(e,t,o){return Math.max(t,Math.min(o,e))}function Am(e){return nt(e,-32768,32767)}function Wt(e,t,o,a=1e-6){return e>=Math.min(t,o)-a&&e<=Math.max(t,o)+a}function Vr(e,t,o){o=o||(i=>e[i]<t);let a=e.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,o(s)?r=s:a=s;return{lo:r,hi:a}}const yn=(e,t,o,a)=>Vr(e,o,a?r=>{const s=e[r][t];return s<o||s===o&&e[r+1][t]===o}:r=>e[r][t]<o),Vm=(e,t,o)=>Vr(e,o,a=>e[a][t]>=o);function Dm(e,t,o){let a=0,r=e.length;for(;a<r&&e[a]<t;)a++;for(;r>a&&e[r-1]>o;)r--;return a>0||r<e.length?e.slice(a,r):e}const tl=["push","pop","shift","splice","unshift"];function Mm(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),tl.forEach(o=>{const a="_onData"+Sr(o),r=e[o];Object.defineProperty(e,o,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function nl(e,t){const o=e._chartjs;if(!o)return;const a=o.listeners,r=a.indexOf(t);r!==-1&&a.splice(r,1),!(a.length>0)&&(tl.forEach(s=>{delete e[s]}),delete e._chartjs)}function ol(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const al=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function rl(e,t){let o=[],a=!1;return function(...r){o=r,a||(a=!0,al.call(window,()=>{a=!1,e.apply(t,o)}))}}function Nm(e,t){let o;return function(...a){return t?(clearTimeout(o),o=setTimeout(e,t,a)):e.apply(this,a),t}}const Dr=e=>e==="start"?"left":e==="end"?"right":"center",ot=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,Pm=(e,t,o,a)=>e===(a?"left":"right")?o:e==="center"?(t+o)/2:t;function vm(e,t,o){const a=t.length;let r=0,s=a;if(e._sorted){const{iScale:i,vScale:l,_parsed:c}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:p}=i.getUserBounds();if(m){if(r=Math.min(yn(c,u,f).lo,o?a:yn(t,u,i.getPixelForValue(f)).lo),d){const b=c.slice(0,r+1).reverse().findIndex(y=>!Ne(y[l.axis]));r-=Math.max(0,b)}r=nt(r,0,a-1)}if(p){let b=Math.max(yn(c,i.axis,h,!0).hi+1,o?0:yn(t,u,i.getPixelForValue(h),!0).hi+1);if(d){const y=c.slice(b-1).findIndex(g=>!Ne(g[l.axis]));b+=Math.max(0,y)}s=nt(b,r,a)-r}else s=a-r}return{start:r,count:s}}function Tm(e){const{xScale:t,yScale:o,_scaleRanges:a}=e,r={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!a)return e._scaleRanges=r,!0;const s=a.xmin!==t.min||a.xmax!==t.max||a.ymin!==o.min||a.ymax!==o.max;return Object.assign(a,r),s}const Jo=e=>e===0||e===1,sl=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*We/o)),il=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*We/o)+1,mo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ye)+1,easeOutSine:e=>Math.sin(e*Ye),easeInOutSine:e=>-.5*(Math.cos(ve*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Jo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Jo(e)?e:sl(e,.075,.3),easeOutElastic:e=>Jo(e)?e:il(e,.075,.3),easeInOutElastic(e){return Jo(e)?e:e<.5?.5*sl(e*2,.1125,.45):.5+.5*il(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-mo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?mo.easeInBounce(e*2)*.5:mo.easeOutBounce(e*2-1)*.5+.5};function Mr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ll(e){return Mr(e)?e:new so(e)}function Nr(e){return Mr(e)?e:new so(e).saturate(.5).darken(.1).hexString()}const Om=["x","y","borderWidth","radius","tension"],zm=["color","borderColor","backgroundColor"];function Fm(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:zm},numbers:{type:"number",properties:Om}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Rm(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const cl=new Map;function Im(e,t){t=t||{};const o=e+JSON.stringify(t);let a=cl.get(o);return a||(a=new Intl.NumberFormat(e,t),cl.set(o,a)),a}function Pr(e,t,o){return Im(t,o).format(e)}const Lm={values(e){return qe(e)?e:""+e},numeric(e,t,o){if(e===0)return"0";const a=this.chart.options.locale;let r,s=e;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=$m(e,o)}const i=Ji(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pr(e,a,c)}};function $m(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var dl={formatters:Lm};function Wm(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,o)=>o.lineWidth,tickColor:(t,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:dl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const xn=Object.create(null),vr=Object.create(null);function po(e,t){if(!t)return e;const o=t.split(".");for(let a=0,r=o.length;a<r;++a){const s=o[a];e=e[s]||(e[s]=Object.create(null))}return e}function Tr(e,t,o){return typeof t=="string"?io(po(e,t),o):io(po(e,""),t)}class jm{constructor(t,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=a=>a.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(a,r)=>Nr(r.backgroundColor),this.hoverBorderColor=(a,r)=>Nr(r.borderColor),this.hoverColor=(a,r)=>Nr(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(o)}set(t,o){return Tr(this,t,o)}get(t){return po(this,t)}describe(t,o){return Tr(vr,t,o)}override(t,o){return Tr(xn,t,o)}route(t,o,a,r){const s=po(this,t),i=po(this,a),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[r];return Se(c)?Object.assign({},d,c):Be(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(o=>o(this))}}var Ue=new jm({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Fm,Rm,Wm]);function Um(e){return!e||Ne(e.size)||Ne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ul(e,t,o,a,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,o.push(r)),s>a&&(a=s),a}function kn(e,t,o){const a=e.currentDevicePixelRatio,r=o!==0?Math.max(o/2,.5):0;return Math.round((t-r)*a)/a+r}function fl(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Or(e,t,o,a){hl(e,t,o,a,null)}function hl(e,t,o,a,r){let s,i,l,c,d,u,f,h;const m=t.pointStyle,p=t.rotation,b=t.radius;let y=(p||0)*km;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(o,a),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),m){default:r?e.ellipse(o,a,r/2,b,0,0,We):e.arc(o,a,b,0,We),e.closePath();break;case"triangle":u=r?r/2:b,e.moveTo(o+Math.sin(y)*u,a-Math.cos(y)*b),y+=Ki,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*b),y+=Ki,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*b),e.closePath();break;case"rectRounded":d=b*.516,c=b-d,i=Math.cos(y+bn)*c,f=Math.cos(y+bn)*(r?r/2-d:c),l=Math.sin(y+bn)*c,h=Math.sin(y+bn)*(r?r/2-d:c),e.arc(o-f,a-l,d,y-ve,y-Ye),e.arc(o+h,a-i,d,y-Ye,y),e.arc(o+f,a+l,d,y,y+Ye),e.arc(o-h,a+i,d,y+Ye,y+ve),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*b,u=r?r/2:c,e.rect(o-u,a-c,2*u,2*c);break}y+=bn;case"rectRot":f=Math.cos(y)*(r?r/2:b),i=Math.cos(y)*b,l=Math.sin(y)*b,h=Math.sin(y)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+h,a-i),e.lineTo(o+f,a+l),e.lineTo(o-h,a+i),e.closePath();break;case"crossRot":y+=bn;case"cross":f=Math.cos(y)*(r?r/2:b),i=Math.cos(y)*b,l=Math.sin(y)*b,h=Math.sin(y)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"star":f=Math.cos(y)*(r?r/2:b),i=Math.cos(y)*b,l=Math.sin(y)*b,h=Math.sin(y)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i),y+=bn,f=Math.cos(y)*(r?r/2:b),i=Math.cos(y)*b,l=Math.sin(y)*b,h=Math.sin(y)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"line":i=r?r/2:Math.cos(y)*b,l=Math.sin(y)*b,e.moveTo(o-i,a-l),e.lineTo(o+i,a+l);break;case"dash":e.moveTo(o,a),e.lineTo(o+Math.cos(y)*(r?r/2:b),a+Math.sin(y)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function go(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function Qo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Zo(e){e.restore()}function Hm(e,t,o,a,r){if(!t)return e.lineTo(o.x,o.y);if(r==="middle"){const s=(t.x+o.x)/2;e.lineTo(s,t.y),e.lineTo(s,o.y)}else r==="after"!=!!a?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y)}function qm(e,t,o,a){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(a?t.cp1x:t.cp2x,a?t.cp1y:t.cp2y,a?o.cp2x:o.cp1x,a?o.cp2y:o.cp1y,o.x,o.y)}function Gm(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ne(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Xm(e,t,o,a,r){if(r.strikethrough||r.underline){const s=e.measureText(a),i=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(i,u),e.lineTo(l,u),e.stroke()}}function Ym(e,t){const o=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=o}function bo(e,t,o,a,r,s={}){const i=qe(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(e.save(),e.font=r.string,Gm(e,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Ym(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ne(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,o,a,s.maxWidth)),e.fillText(d,o,a,s.maxWidth),Xm(e,o,a,d,s),a+=Number(r.lineHeight);e.restore()}function ea(e,t){const{x:o,y:a,w:r,h:s,radius:i}=t;e.arc(o+i.topLeft,a+i.topLeft,i.topLeft,1.5*ve,ve,!0),e.lineTo(o,a+s-i.bottomLeft),e.arc(o+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,ve,Ye,!0),e.lineTo(o+r-i.bottomRight,a+s),e.arc(o+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Ye,0,!0),e.lineTo(o+r,a+i.topRight),e.arc(o+r-i.topRight,a+i.topRight,i.topRight,0,-Ye,!0),e.lineTo(o+i.topLeft,a)}const Km=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Jm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Qm(e,t){const o=(""+e).match(Km);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case"px":return e;case"%":e/=100;break}return t*e}const Zm=e=>+e||0;function zr(e,t){const o={},a=Se(t),r=a?Object.keys(t):t,s=Se(e)?a?i=>Be(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of r)o[i]=Zm(s(i));return o}function ml(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function On(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function gt(e){const t=ml(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function at(e,t){e=e||{},t=t||Ue.font;let o=Be(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let a=Be(e.style,t.style);a&&!(""+a).match(Jm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:Be(e.family,t.family),lineHeight:Qm(Be(e.lineHeight,t.lineHeight),o),size:o,style:a,weight:Be(e.weight,t.weight),string:""};return r.string=Um(r),r}function ta(e,t,o,a){let r,s,i;for(r=0,s=e.length;r<s;++r)if(i=e[r],i!==void 0&&i!==void 0)return i}function ep(e,t,o){const{min:a,max:r}=e,s=qi(t,(r-a)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function wn(e,t){return Object.assign(Object.create(e),t)}function Fr(e,t=[""],o,a,r=()=>e[0]){const s=o||e;typeof a>"u"&&(a=xl("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>Fr([l,...e],t,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return gl(l,c,()=>lp(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return kl(l).includes(c)},ownKeys(l){return kl(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function zn(e,t,o,a){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:pl(e,a),setContext:s=>zn(e,s,o,a),override:s=>zn(e.override(s),t,o,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete e[i],!0},get(s,i,l){return gl(s,i,()=>np(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(s,i,l){return e[i]=l,delete s[i],!0}})}function pl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:o=t.scriptable,_indexable:a=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:o,indexable:a,isScriptable:nn(o)?o:()=>o,isIndexable:nn(a)?a:()=>a}}const tp=(e,t)=>e?e+Sr(t):t,Rr=(e,t)=>Se(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gl(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const a=o();return e[t]=a,a}function np(e,t,o){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=e;let l=a[t];return nn(l)&&i.isScriptable(t)&&(l=op(t,l,e,o)),qe(l)&&l.length&&(l=ap(t,l,e,i.isIndexable)),Rr(t,l)&&(l=zn(l,r,s&&s[t],i)),l}function op(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=o;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(s,i||a);return l.delete(e),Rr(e,c)&&(c=Ir(r._scopes,r,e,c)),c}function ap(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&a(e))return t[s.index%t.length];if(Se(t[0])){const c=t,d=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const f=Ir(d,r,e,u);t.push(zn(f,s,i&&i[e],l))}}return t}function bl(e,t,o){return nn(e)?e(t,o):e}const rp=(e,t)=>e===!0?t:typeof e=="string"?gn(t,e):void 0;function sp(e,t,o,a,r){for(const s of t){const i=rp(o,s);if(i){e.add(i);const l=bl(i._fallback,o,r);if(typeof l<"u"&&l!==o&&l!==a)return l}else if(i===!1&&typeof a<"u"&&o!==a)return null}return!1}function Ir(e,t,o,a){const r=t._rootScopes,s=bl(t._fallback,o,a),i=[...e,...r],l=new Set;l.add(a);let c=yl(l,i,o,s||o,a);return c===null||typeof s<"u"&&s!==o&&(c=yl(l,i,s,c,a),c===null)?!1:Fr(Array.from(l),[""],r,s,()=>ip(t,o,a))}function yl(e,t,o,a,r){for(;o;)o=sp(e,t,o,a,r);return o}function ip(e,t,o){const a=e._getTarget();t in a||(a[t]={});const r=a[t];return qe(r)&&Se(o)?o:r||{}}function lp(e,t,o,a){let r;for(const s of t)if(r=xl(tp(s,e),o),typeof r<"u")return Rr(e,r)?Ir(o,a,e,r):r}function xl(e,t){for(const o of t){if(!o)continue;const a=o[e];if(typeof a<"u")return a}}function kl(e){let t=e._keys;return t||(t=e._keys=cp(e._scopes)),t}function cp(e){const t=new Set;for(const o of e)for(const a of Object.keys(o).filter(r=>!r.startsWith("_")))t.add(a);return Array.from(t)}const dp=Number.EPSILON||1e-14,Fn=(e,t)=>t<e.length&&!e[t].skip&&e[t],wl=e=>e==="x"?"y":"x";function up(e,t,o,a){const r=e.skip?t:e,s=t,i=o.skip?t:o,l=Ar(s,r),c=Ar(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=a*d,h=a*u;return{previous:{x:s.x-f*(i.x-r.x),y:s.y-f*(i.y-r.y)},next:{x:s.x+h*(i.x-r.x),y:s.y+h*(i.y-r.y)}}}function fp(e,t,o){const a=e.length;let r,s,i,l,c,d=Fn(e,0);for(let u=0;u<a-1;++u)if(c=d,d=Fn(e,u+1),!(!c||!d)){if(uo(t[u],0,dp)){o[u]=o[u+1]=0;continue}r=o[u]/t[u],s=o[u+1]/t[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=r*i*t[u],o[u+1]=s*i*t[u])}}function hp(e,t,o="x"){const a=wl(o),r=e.length;let s,i,l,c=Fn(e,0);for(let d=0;d<r;++d){if(i=l,l=c,c=Fn(e,d+1),!l)continue;const u=l[o],f=l[a];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${a}`]=f-s*t[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${a}`]=f+s*t[d])}}function mp(e,t="x"){const o=wl(t),a=e.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=Fn(e,0);for(i=0;i<a;++i)if(l=c,c=d,d=Fn(e,i+1),!!c){if(d){const u=d[t]-c[t];r[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Mt(r[i-1])!==Mt(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}fp(e,r,s),hp(e,s,t)}function na(e,t,o){return Math.max(Math.min(e,o),t)}function pp(e,t){let o,a,r,s,i,l=go(e[0],t);for(o=0,a=e.length;o<a;++o)i=s,s=l,l=o<a-1&&go(e[o+1],t),s&&(r=e[o],i&&(r.cp1x=na(r.cp1x,t.left,t.right),r.cp1y=na(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=na(r.cp2x,t.left,t.right),r.cp2y=na(r.cp2y,t.top,t.bottom)))}function gp(e,t,o,a,r){let s,i,l,c;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")mp(e,r);else{let d=a?e[e.length-1]:e[0];for(s=0,i=e.length;s<i;++s)l=e[s],c=up(d,l,e[Math.min(s+1,i-(a?0:1))%i],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&pp(e,o)}function Lr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oa(e,t,o){let a;return typeof e=="string"?(a=parseInt(e,10),e.indexOf("%")!==-1&&(a=a/100*t.parentNode[o])):a=e,a}const aa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function bp(e,t){return aa(e).getPropertyValue(t)}const yp=["top","right","bottom","left"];function Cn(e,t,o){const a={};o=o?"-"+o:"";for(let r=0;r<4;r++){const s=yp[r];a[s]=parseFloat(e[t+"-"+s+o])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const xp=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function kp(e,t){const o=e.touches,a=o&&o.length?o[0]:e,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(xp(r,s,e.target))l=r,c=s;else{const d=t.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Bn(e,t){if("native"in e)return e;const{canvas:o,currentDevicePixelRatio:a}=t,r=aa(o),s=r.boxSizing==="border-box",i=Cn(r,"padding"),l=Cn(r,"border","width"),{x:c,y:d,box:u}=kp(e,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:p}=t;return s&&(m-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/m*o.width/a),y:Math.round((d-h)/p*o.height/a)}}function wp(e,t,o){let a,r;if(t===void 0||o===void 0){const s=e&&$r(e);if(!s)t=e.clientWidth,o=e.clientHeight;else{const i=s.getBoundingClientRect(),l=aa(s),c=Cn(l,"border","width"),d=Cn(l,"padding");t=i.width-d.width-c.width,o=i.height-d.height-c.height,a=oa(l.maxWidth,s,"clientWidth"),r=oa(l.maxHeight,s,"clientHeight")}}return{width:t,height:o,maxWidth:a||Ko,maxHeight:r||Ko}}const on=e=>Math.round(e*10)/10;function Cp(e,t,o,a){const r=aa(e),s=Cn(r,"margin"),i=oa(r.maxWidth,e,"clientWidth")||Ko,l=oa(r.maxHeight,e,"clientHeight")||Ko,c=wp(e,t,o);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=Cn(r,"border","width"),m=Cn(r,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,a?d/a:u-s.height),d=on(Math.min(d,i,c.maxWidth)),u=on(Math.min(u,l,c.maxHeight)),d&&!u&&(u=on(d/2)),(t!==void 0||o!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=on(Math.floor(u*a))),{width:d,height:u}}function Cl(e,t,o){const a=t||1,r=on(e.height*a),s=on(e.width*a);e.height=on(e.height),e.width=on(e.width);const i=e.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(e.currentDevicePixelRatio=a,i.height=r,i.width=s,e.ctx.setTransform(a,0,0,a,0,0),!0):!1}const Bp=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Lr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Bl(e,t){const o=bp(e,t),a=o&&o.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function _n(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function _p(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:a==="middle"?o<.5?e.y:t.y:a==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function Ep(e,t,o,a){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},i=_n(e,r,o),l=_n(r,s,o),c=_n(s,t,o),d=_n(i,l,o),u=_n(l,c,o);return _n(d,u,o)}const Sp=function(e,t){return{x(o){return e+e+t-o},setWidth(o){t=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,a){return o-a},leftForLtr(o,a){return o-a}}},Ap=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Rn(e,t,o){return e?Sp(t,o):Ap()}function _l(e,t){let o,a;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,a=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=a)}function El(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Sl(e){return e==="angle"?{between:ho,compare:Sm,normalize:ft}:{between:Wt,compare:(t,o)=>t-o,normalize:t=>t}}function Al({start:e,end:t,count:o,loop:a,style:r}){return{start:e%o,end:t%o,loop:a&&(t-e+1)%o===0,style:r}}function Vp(e,t,o){const{property:a,start:r,end:s}=o,{between:i,normalize:l}=Sl(a),c=t.length;let{start:d,end:u,loop:f}=e,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(t[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:e.style}}function Vl(e,t,o){if(!o)return[e];const{property:a,start:r,end:s}=o,i=t.length,{compare:l,between:c,normalize:d}=Sl(a),{start:u,end:f,loop:h,style:m}=Vp(e,t,o),p=[];let b=!1,y=null,g,B,w;const C=()=>c(r,w,g)&&l(r,w)!==0,E=()=>l(s,g)===0||c(s,w,g),_=()=>b||C(),k=()=>!b||E();for(let x=u,A=u;x<=f;++x)B=t[x%i],!B.skip&&(g=d(B[a]),g!==w&&(b=c(g,r,s),y===null&&_()&&(y=l(g,r)===0?x:A),y!==null&&k()&&(p.push(Al({start:y,end:x,loop:h,count:i,style:m})),y=null),A=x,w=g));return y!==null&&p.push(Al({start:y,end:f,loop:h,count:i,style:m})),p}function Dl(e,t){const o=[],a=e.segments;for(let r=0;r<a.length;r++){const s=Vl(a[r],e.points,t);s.length&&o.push(...s)}return o}function Dp(e,t,o,a){let r=0,s=t-1;if(o&&!a)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,o&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Mp(e,t,o,a){const r=e.length,s=[];let i=t,l=e[t],c;for(c=t+1;c<=o;++c){const d=e[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:t%r,end:(c-1)%r,loop:a}),t=i=d.stop?c:null):(i=c,l.skip&&(t=c)),l=d}return i!==null&&s.push({start:t%r,end:i%r,loop:a}),s}function Np(e,t){const o=e.points,a=e.options.spanGaps,r=o.length;if(!r)return[];const s=!!e._loop,{start:i,end:l}=Dp(o,r,s,a);if(a===!0)return Ml(e,[{start:i,end:l,loop:s}],o,t);const c=l<i?l+r:l,d=!!e._fullLoop&&i===0&&l===r-1;return Ml(e,Mp(o,i,c,d),o,t)}function Ml(e,t,o,a){return!a||!a.setContext||!o?t:Pp(e,t,o,a)}function Pp(e,t,o,a){const r=e._chart.getContext(),s=Nl(e.options),{_datasetIndex:i,options:{spanGaps:l}}=e,c=o.length,d=[];let u=s,f=t[0].start,h=f;function m(p,b,y,g){const B=l?-1:1;if(p!==b){for(p+=c;o[p%c].skip;)p-=B;for(;o[b%c].skip;)b+=B;p%c!==b%c&&(d.push({start:p%c,end:b%c,loop:y,style:g}),u=g,f=b%c)}}for(const p of t){f=l?f:p.start;let b=o[f%c],y;for(h=f+1;h<=p.end;h++){const g=o[h%c];y=Nl(a.setContext(wn(r,{type:"segment",p0:b,p1:g,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),vp(y,u)&&m(f,h-1,p.loop,u),b=g,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function Nl(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function vp(e,t){if(!t)return!1;const o=[],a=function(r,s){return Mr(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(e,a)!==JSON.stringify(t,a)}function ra(e,t,o){return e.options.clip?e[o]:t[o]}function Tp(e,t){const{xScale:o,yScale:a}=e;return o&&a?{left:ra(o,t,"left"),right:ra(o,t,"right"),top:ra(a,t,"top"),bottom:ra(a,t,"bottom")}:t}function Pl(e,t){const o=t._clip;if(o.disabled)return!1;const a=Tp(t,e.chartArea);return{left:o.left===!1?0:a.left-(o.left===!0?0:o.left),right:o.right===!1?e.width:a.right+(o.right===!0?0:o.right),top:o.top===!1?0:a.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?e.height:a.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
11
|
+
*/function Lt(){}const lm=(()=>{let e=0;return()=>e++})();function Ne(e){return e==null}function Ge(e){if(Array.isArray&&Array.isArray(e))return!0;const n=Object.prototype.toString.call(e);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Se(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function tt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vt(e,n){return tt(e)?e:n}function Be(e,n){return typeof e>"u"?n:e}const cm=(e,n)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/n,Xi=(e,n)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*n:+e;function Ie(e,n,o){if(e&&typeof e.call=="function")return e.apply(o,n)}function Pe(e,n,o,a){let r,s,i;if(Ge(e))for(s=e.length,r=0;r<s;r++)n.call(o,e[r],r);else if(Se(e))for(i=Object.keys(e),s=i.length,r=0;r<s;r++)n.call(o,e[i[r]],i[r])}function Ko(e,n){let o,a,r,s;if(!e||!n||e.length!==n.length)return!1;for(o=0,a=e.length;o<a;++o)if(r=e[o],s=n[o],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Jo(e){if(Ge(e))return e.map(Jo);if(Se(e)){const n=Object.create(null),o=Object.keys(e),a=o.length;let r=0;for(;r<a;++r)n[o[r]]=Jo(e[o[r]]);return n}return e}function Yi(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function dm(e,n,o,a){if(!Yi(e))return;const r=n[e],s=o[e];Se(r)&&Se(s)?lo(r,s,a):n[e]=Jo(s)}function lo(e,n,o){const a=Ge(n)?n:[n],r=a.length;if(!Se(e))return e;o=o||{};const s=o.merger||dm;let i;for(let l=0;l<r;++l){if(i=a[l],!Se(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],e,i,o)}return e}function co(e,n){return lo(e,n,{merger:um})}function um(e,n,o){if(!Yi(e))return;const a=n[e],r=o[e];Se(a)&&Se(r)?co(a,r):Object.prototype.hasOwnProperty.call(n,e)||(n[e]=Jo(r))}const Ki={"":e=>e,x:e=>e.x,y:e=>e.y};function fm(e){const n=e.split("."),o=[];let a="";for(const r of n)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(o.push(a),a="");return o}function hm(e){const n=fm(e);return o=>{for(const a of n){if(a==="")break;o=o&&o[a]}return o}}function bn(e,n){return(Ki[n]||(Ki[n]=hm(n)))(e)}function Vr(e){return e.charAt(0).toUpperCase()+e.slice(1)}const uo=e=>typeof e<"u",on=e=>typeof e=="function",Ji=(e,n)=>{if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0};function mm(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ve=Math.PI,We=2*ve,pm=We+ve,Qo=Number.POSITIVE_INFINITY,gm=ve/180,Ke=ve/2,yn=ve/4,Qi=ve*2/3,Zi=Math.log10,Dt=Math.sign;function fo(e,n,o){return Math.abs(e-n)<o}function el(e){const n=Math.round(e);e=fo(e,n,e/1e3)?n:e;const o=Math.pow(10,Math.floor(Zi(e))),a=e/o;return(a<=1?1:a<=2?2:a<=5?5:10)*o}function bm(e){const n=[],o=Math.sqrt(e);let a;for(a=1;a<o;a++)e%a===0&&(n.push(a),n.push(e/a));return o===(o|0)&&n.push(o),n.sort((r,s)=>r-s).pop(),n}function ym(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ho(e){return!ym(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function xm(e,n){const o=Math.round(e);return o-n<=e&&o+n>=e}function km(e,n,o){let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function $t(e){return e*(ve/180)}function wm(e){return e*(180/ve)}function tl(e){if(!tt(e))return;let n=1,o=0;for(;Math.round(e*n)/n!==e;)n*=10,o++;return o}function nl(e,n){const o=n.x-e.x,a=n.y-e.y,r=Math.sqrt(o*o+a*a);let s=Math.atan2(a,o);return s<-.5*ve&&(s+=We),{angle:s,distance:r}}function Dr(e,n){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function Cm(e,n){return(e-n+pm)%We-ve}function ft(e){return(e%We+We)%We}function mo(e,n,o,a){const r=ft(e),s=ft(n),i=ft(o),l=ft(s-r),c=ft(i-r),d=ft(r-s),u=ft(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function nt(e,n,o){return Math.max(n,Math.min(o,e))}function Bm(e){return nt(e,-32768,32767)}function Wt(e,n,o,a=1e-6){return e>=Math.min(n,o)-a&&e<=Math.max(n,o)+a}function Mr(e,n,o){o=o||(i=>e[i]<n);let a=e.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,o(s)?r=s:a=s;return{lo:r,hi:a}}const xn=(e,n,o,a)=>Mr(e,o,a?r=>{const s=e[r][n];return s<o||s===o&&e[r+1][n]===o}:r=>e[r][n]<o),_m=(e,n,o)=>Mr(e,o,a=>e[a][n]>=o);function Em(e,n,o){let a=0,r=e.length;for(;a<r&&e[a]<n;)a++;for(;r>a&&e[r-1]>o;)r--;return a>0||r<e.length?e.slice(a,r):e}const ol=["push","pop","shift","splice","unshift"];function Sm(e,n){if(e._chartjs){e._chartjs.listeners.push(n);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),ol.forEach(o=>{const a="_onData"+Vr(o),r=e[o];Object.defineProperty(e,o,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function al(e,n){const o=e._chartjs;if(!o)return;const a=o.listeners,r=a.indexOf(n);r!==-1&&a.splice(r,1),!(a.length>0)&&(ol.forEach(s=>{delete e[s]}),delete e._chartjs)}function rl(e){const n=new Set(e);return n.size===e.length?e:Array.from(n)}const sl=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function il(e,n){let o=[],a=!1;return function(...r){o=r,a||(a=!0,sl.call(window,()=>{a=!1,e.apply(n,o)}))}}function Am(e,n){let o;return function(...a){return n?(clearTimeout(o),o=setTimeout(e,n,a)):e.apply(this,a),n}}const Nr=e=>e==="start"?"left":e==="end"?"right":"center",ot=(e,n,o)=>e==="start"?n:e==="end"?o:(n+o)/2,Vm=(e,n,o,a)=>e===(a?"left":"right")?o:e==="center"?(n+o)/2:n;function Dm(e,n,o){const a=n.length;let r=0,s=a;if(e._sorted){const{iScale:i,vScale:l,_parsed:c}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:p}=i.getUserBounds();if(m){if(r=Math.min(xn(c,u,f).lo,o?a:xn(n,u,i.getPixelForValue(f)).lo),d){const x=c.slice(0,r+1).reverse().findIndex(y=>!Ne(y[l.axis]));r-=Math.max(0,x)}r=nt(r,0,a-1)}if(p){let x=Math.max(xn(c,i.axis,h,!0).hi+1,o?0:xn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const y=c.slice(x-1).findIndex(g=>!Ne(g[l.axis]));x+=Math.max(0,y)}s=nt(x,r,a)-r}else s=a-r}return{start:r,count:s}}function Mm(e){const{xScale:n,yScale:o,_scaleRanges:a}=e,r={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!a)return e._scaleRanges=r,!0;const s=a.xmin!==n.min||a.xmax!==n.max||a.ymin!==o.min||a.ymax!==o.max;return Object.assign(a,r),s}const Zo=e=>e===0||e===1,ll=(e,n,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-n)*We/o)),cl=(e,n,o)=>Math.pow(2,-10*e)*Math.sin((e-n)*We/o)+1,po={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ke)+1,easeOutSine:e=>Math.sin(e*Ke),easeInOutSine:e=>-.5*(Math.cos(ve*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Zo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Zo(e)?e:ll(e,.075,.3),easeOutElastic:e=>Zo(e)?e:cl(e,.075,.3),easeInOutElastic(e){return Zo(e)?e:e<.5?.5*ll(e*2,.1125,.45):.5+.5*cl(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let n=1.70158;return(e/=.5)<1?.5*(e*e*(((n*=1.525)+1)*e-n)):.5*((e-=2)*e*(((n*=1.525)+1)*e+n)+2)},easeInBounce:e=>1-po.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?po.easeInBounce(e*2)*.5:po.easeOutBounce(e*2-1)*.5+.5};function Pr(e){if(e&&typeof e=="object"){const n=e.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function dl(e){return Pr(e)?e:new io(e)}function vr(e){return Pr(e)?e:new io(e).saturate(.5).darken(.1).hexString()}const Nm=["x","y","borderWidth","radius","tension"],Pm=["color","borderColor","backgroundColor"];function vm(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),e.set("animations",{colors:{type:"color",properties:Pm},numbers:{type:"number",properties:Nm}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Tm(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ul=new Map;function Om(e,n){n=n||{};const o=e+JSON.stringify(n);let a=ul.get(o);return a||(a=new Intl.NumberFormat(e,n),ul.set(o,a)),a}function Tr(e,n,o){return Om(n,o).format(e)}const zm={values(e){return Ge(e)?e:""+e},numeric(e,n,o){if(e===0)return"0";const a=this.chart.options.locale;let r,s=e;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=Fm(e,o)}const i=Zi(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Tr(e,a,c)}};function Fm(e,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var fl={formatters:zm};function Rm(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const kn=Object.create(null),Or=Object.create(null);function go(e,n){if(!n)return e;const o=n.split(".");for(let a=0,r=o.length;a<r;++a){const s=o[a];e=e[s]||(e[s]=Object.create(null))}return e}function zr(e,n,o){return typeof n=="string"?lo(go(e,n),o):lo(go(e,""),n)}class Im{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=a=>a.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(a,r)=>vr(r.backgroundColor),this.hoverBorderColor=(a,r)=>vr(r.borderColor),this.hoverColor=(a,r)=>vr(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return zr(this,n,o)}get(n){return go(this,n)}describe(n,o){return zr(Or,n,o)}override(n,o){return zr(kn,n,o)}route(n,o,a,r){const s=go(this,n),i=go(this,a),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[r];return Se(c)?Object.assign({},d,c):Be(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var Ue=new Im({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vm,Tm,Rm]);function Lm(e){return!e||Ne(e.size)||Ne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function hl(e,n,o,a,r){let s=n[r];return s||(s=n[r]=e.measureText(r).width,o.push(r)),s>a&&(a=s),a}function wn(e,n,o){const a=e.currentDevicePixelRatio,r=o!==0?Math.max(o/2,.5):0;return Math.round((n-r)*a)/a+r}function ml(e,n){!n&&!e||(n=n||e.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,e.width,e.height),n.restore())}function Fr(e,n,o,a){pl(e,n,o,a,null)}function pl(e,n,o,a,r){let s,i,l,c,d,u,f,h;const m=n.pointStyle,p=n.rotation,x=n.radius;let y=(p||0)*gm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(o,a),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),m){default:r?e.ellipse(o,a,r/2,x,0,0,We):e.arc(o,a,x,0,We),e.closePath();break;case"triangle":u=r?r/2:x,e.moveTo(o+Math.sin(y)*u,a-Math.cos(y)*x),y+=Qi,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*x),y+=Qi,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*x),e.closePath();break;case"rectRounded":d=x*.516,c=x-d,i=Math.cos(y+yn)*c,f=Math.cos(y+yn)*(r?r/2-d:c),l=Math.sin(y+yn)*c,h=Math.sin(y+yn)*(r?r/2-d:c),e.arc(o-f,a-l,d,y-ve,y-Ke),e.arc(o+h,a-i,d,y-Ke,y),e.arc(o+f,a+l,d,y,y+Ke),e.arc(o-h,a+i,d,y+Ke,y+ve),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*x,u=r?r/2:c,e.rect(o-u,a-c,2*u,2*c);break}y+=yn;case"rectRot":f=Math.cos(y)*(r?r/2:x),i=Math.cos(y)*x,l=Math.sin(y)*x,h=Math.sin(y)*(r?r/2:x),e.moveTo(o-f,a-l),e.lineTo(o+h,a-i),e.lineTo(o+f,a+l),e.lineTo(o-h,a+i),e.closePath();break;case"crossRot":y+=yn;case"cross":f=Math.cos(y)*(r?r/2:x),i=Math.cos(y)*x,l=Math.sin(y)*x,h=Math.sin(y)*(r?r/2:x),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"star":f=Math.cos(y)*(r?r/2:x),i=Math.cos(y)*x,l=Math.sin(y)*x,h=Math.sin(y)*(r?r/2:x),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i),y+=yn,f=Math.cos(y)*(r?r/2:x),i=Math.cos(y)*x,l=Math.sin(y)*x,h=Math.sin(y)*(r?r/2:x),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"line":i=r?r/2:Math.cos(y)*x,l=Math.sin(y)*x,e.moveTo(o-i,a-l),e.lineTo(o+i,a+l);break;case"dash":e.moveTo(o,a),e.lineTo(o+Math.cos(y)*(r?r/2:x),a+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),n.borderWidth>0&&e.stroke()}}function bo(e,n,o){return o=o||.5,!n||e&&e.x>n.left-o&&e.x<n.right+o&&e.y>n.top-o&&e.y<n.bottom+o}function ea(e,n){e.save(),e.beginPath(),e.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),e.clip()}function ta(e){e.restore()}function $m(e,n,o,a,r){if(!n)return e.lineTo(o.x,o.y);if(r==="middle"){const s=(n.x+o.x)/2;e.lineTo(s,n.y),e.lineTo(s,o.y)}else r==="after"!=!!a?e.lineTo(n.x,o.y):e.lineTo(o.x,n.y);e.lineTo(o.x,o.y)}function Wm(e,n,o,a){if(!n)return e.lineTo(o.x,o.y);e.bezierCurveTo(a?n.cp1x:n.cp2x,a?n.cp1y:n.cp2y,a?o.cp2x:o.cp1x,a?o.cp2y:o.cp1y,o.x,o.y)}function jm(e,n){n.translation&&e.translate(n.translation[0],n.translation[1]),Ne(n.rotation)||e.rotate(n.rotation),n.color&&(e.fillStyle=n.color),n.textAlign&&(e.textAlign=n.textAlign),n.textBaseline&&(e.textBaseline=n.textBaseline)}function Um(e,n,o,a,r){if(r.strikethrough||r.underline){const s=e.measureText(a),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(i,u),e.lineTo(l,u),e.stroke()}}function Hm(e,n){const o=e.fillStyle;e.fillStyle=n.color,e.fillRect(n.left,n.top,n.width,n.height),e.fillStyle=o}function yo(e,n,o,a,r,s={}){const i=Ge(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(e.save(),e.font=r.string,jm(e,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Hm(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ne(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,o,a,s.maxWidth)),e.fillText(d,o,a,s.maxWidth),Um(e,o,a,d,s),a+=Number(r.lineHeight);e.restore()}function na(e,n){const{x:o,y:a,w:r,h:s,radius:i}=n;e.arc(o+i.topLeft,a+i.topLeft,i.topLeft,1.5*ve,ve,!0),e.lineTo(o,a+s-i.bottomLeft),e.arc(o+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,ve,Ke,!0),e.lineTo(o+r-i.bottomRight,a+s),e.arc(o+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Ke,0,!0),e.lineTo(o+r,a+i.topRight),e.arc(o+r-i.topRight,a+i.topRight,i.topRight,0,-Ke,!0),e.lineTo(o+i.topLeft,a)}const qm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Gm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Xm(e,n){const o=(""+e).match(qm);if(!o||o[1]==="normal")return n*1.2;switch(e=+o[2],o[3]){case"px":return e;case"%":e/=100;break}return n*e}const Ym=e=>+e||0;function Rr(e,n){const o={},a=Se(n),r=a?Object.keys(n):n,s=Se(e)?a?i=>Be(e[i],e[n[i]]):i=>e[i]:()=>e;for(const i of r)o[i]=Ym(s(i));return o}function gl(e){return Rr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function zn(e){return Rr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function bt(e){const n=gl(e);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function at(e,n){e=e||{},n=n||Ue.font;let o=Be(e.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let a=Be(e.style,n.style);a&&!(""+a).match(Gm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:Be(e.family,n.family),lineHeight:Xm(Be(e.lineHeight,n.lineHeight),o),size:o,style:a,weight:Be(e.weight,n.weight),string:""};return r.string=Lm(r),r}function oa(e,n,o,a){let r,s,i;for(r=0,s=e.length;r<s;++r)if(i=e[r],i!==void 0&&i!==void 0)return i}function Km(e,n,o){const{min:a,max:r}=e,s=Xi(n,(r-a)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function Cn(e,n){return Object.assign(Object.create(e),n)}function Ir(e,n=[""],o,a,r=()=>e[0]){const s=o||e;typeof a>"u"&&(a=wl("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>Ir([l,...e],n,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return yl(l,c,()=>ap(c,n,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return Cl(l).includes(c)},ownKeys(l){return Cl(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Fn(e,n,o,a){const r={_cacheable:!1,_proxy:e,_context:n,_subProxy:o,_stack:new Set,_descriptors:bl(e,a),setContext:s=>Fn(e,s,o,a),override:s=>Fn(e.override(s),n,o,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete e[i],!0},get(s,i,l){return yl(s,i,()=>Qm(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(s,i,l){return e[i]=l,delete s[i],!0}})}function bl(e,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:a=n.indexable,_allKeys:r=n.allKeys}=e;return{allKeys:r,scriptable:o,indexable:a,isScriptable:on(o)?o:()=>o,isIndexable:on(a)?a:()=>a}}const Jm=(e,n)=>e?e+Vr(n):n,Lr=(e,n)=>Se(n)&&e!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function yl(e,n,o){if(Object.prototype.hasOwnProperty.call(e,n)||n==="constructor")return e[n];const a=o();return e[n]=a,a}function Qm(e,n,o){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=e;let l=a[n];return on(l)&&i.isScriptable(n)&&(l=Zm(n,l,e,o)),Ge(l)&&l.length&&(l=ep(n,l,e,i.isIndexable)),Lr(n,l)&&(l=Fn(l,r,s&&s[n],i)),l}function Zm(e,n,o,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=o;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=n(s,i||a);return l.delete(e),Lr(e,c)&&(c=$r(r._scopes,r,e,c)),c}function ep(e,n,o,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&a(e))return n[s.index%n.length];if(Se(n[0])){const c=n,d=r._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=$r(d,r,e,u);n.push(Fn(f,s,i&&i[e],l))}}return n}function xl(e,n,o){return on(e)?e(n,o):e}const tp=(e,n)=>e===!0?n:typeof e=="string"?bn(n,e):void 0;function np(e,n,o,a,r){for(const s of n){const i=tp(o,s);if(i){e.add(i);const l=xl(i._fallback,o,r);if(typeof l<"u"&&l!==o&&l!==a)return l}else if(i===!1&&typeof a<"u"&&o!==a)return null}return!1}function $r(e,n,o,a){const r=n._rootScopes,s=xl(n._fallback,o,a),i=[...e,...r],l=new Set;l.add(a);let c=kl(l,i,o,s||o,a);return c===null||typeof s<"u"&&s!==o&&(c=kl(l,i,s,c,a),c===null)?!1:Ir(Array.from(l),[""],r,s,()=>op(n,o,a))}function kl(e,n,o,a,r){for(;o;)o=np(e,n,o,a,r);return o}function op(e,n,o){const a=e._getTarget();n in a||(a[n]={});const r=a[n];return Ge(r)&&Se(o)?o:r||{}}function ap(e,n,o,a){let r;for(const s of n)if(r=wl(Jm(s,e),o),typeof r<"u")return Lr(e,r)?$r(o,a,e,r):r}function wl(e,n){for(const o of n){if(!o)continue;const a=o[e];if(typeof a<"u")return a}}function Cl(e){let n=e._keys;return n||(n=e._keys=rp(e._scopes)),n}function rp(e){const n=new Set;for(const o of e)for(const a of Object.keys(o).filter(r=>!r.startsWith("_")))n.add(a);return Array.from(n)}const sp=Number.EPSILON||1e-14,Rn=(e,n)=>n<e.length&&!e[n].skip&&e[n],Bl=e=>e==="x"?"y":"x";function ip(e,n,o,a){const r=e.skip?n:e,s=n,i=o.skip?n:o,l=Dr(s,r),c=Dr(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=a*d,h=a*u;return{previous:{x:s.x-f*(i.x-r.x),y:s.y-f*(i.y-r.y)},next:{x:s.x+h*(i.x-r.x),y:s.y+h*(i.y-r.y)}}}function lp(e,n,o){const a=e.length;let r,s,i,l,c,d=Rn(e,0);for(let u=0;u<a-1;++u)if(c=d,d=Rn(e,u+1),!(!c||!d)){if(fo(n[u],0,sp)){o[u]=o[u+1]=0;continue}r=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=r*i*n[u],o[u+1]=s*i*n[u])}}function cp(e,n,o="x"){const a=Bl(o),r=e.length;let s,i,l,c=Rn(e,0);for(let d=0;d<r;++d){if(i=l,l=c,c=Rn(e,d+1),!l)continue;const u=l[o],f=l[a];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${a}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${a}`]=f+s*n[d])}}function dp(e,n="x"){const o=Bl(n),a=e.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=Rn(e,0);for(i=0;i<a;++i)if(l=c,c=d,d=Rn(e,i+1),!!c){if(d){const u=d[n]-c[n];r[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Dt(r[i-1])!==Dt(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}lp(e,r,s),cp(e,s,n)}function aa(e,n,o){return Math.max(Math.min(e,o),n)}function up(e,n){let o,a,r,s,i,l=bo(e[0],n);for(o=0,a=e.length;o<a;++o)i=s,s=l,l=o<a-1&&bo(e[o+1],n),s&&(r=e[o],i&&(r.cp1x=aa(r.cp1x,n.left,n.right),r.cp1y=aa(r.cp1y,n.top,n.bottom)),l&&(r.cp2x=aa(r.cp2x,n.left,n.right),r.cp2y=aa(r.cp2y,n.top,n.bottom)))}function fp(e,n,o,a,r){let s,i,l,c;if(n.spanGaps&&(e=e.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")dp(e,r);else{let d=a?e[e.length-1]:e[0];for(s=0,i=e.length;s<i;++s)l=e[s],c=ip(d,l,e[Math.min(s+1,i-(a?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&up(e,o)}function Wr(){return typeof window<"u"&&typeof document<"u"}function jr(e){let n=e.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function ra(e,n,o){let a;return typeof e=="string"?(a=parseInt(e,10),e.indexOf("%")!==-1&&(a=a/100*n.parentNode[o])):a=e,a}const sa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function hp(e,n){return sa(e).getPropertyValue(n)}const mp=["top","right","bottom","left"];function Bn(e,n,o){const a={};o=o?"-"+o:"";for(let r=0;r<4;r++){const s=mp[r];a[s]=parseFloat(e[n+"-"+s+o])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const pp=(e,n,o)=>(e>0||n>0)&&(!o||!o.shadowRoot);function gp(e,n){const o=e.touches,a=o&&o.length?o[0]:e,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(pp(r,s,e.target))l=r,c=s;else{const d=n.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function _n(e,n){if("native"in e)return e;const{canvas:o,currentDevicePixelRatio:a}=n,r=sa(o),s=r.boxSizing==="border-box",i=Bn(r,"padding"),l=Bn(r,"border","width"),{x:c,y:d,box:u}=gp(e,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:p}=n;return s&&(m-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/m*o.width/a),y:Math.round((d-h)/p*o.height/a)}}function bp(e,n,o){let a,r;if(n===void 0||o===void 0){const s=e&&jr(e);if(!s)n=e.clientWidth,o=e.clientHeight;else{const i=s.getBoundingClientRect(),l=sa(s),c=Bn(l,"border","width"),d=Bn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,a=ra(l.maxWidth,s,"clientWidth"),r=ra(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:a||Qo,maxHeight:r||Qo}}const an=e=>Math.round(e*10)/10;function yp(e,n,o,a){const r=sa(e),s=Bn(r,"margin"),i=ra(r.maxWidth,e,"clientWidth")||Qo,l=ra(r.maxHeight,e,"clientHeight")||Qo,c=bp(e,n,o);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=Bn(r,"border","width"),m=Bn(r,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,a?d/a:u-s.height),d=an(Math.min(d,i,c.maxWidth)),u=an(Math.min(u,l,c.maxHeight)),d&&!u&&(u=an(d/2)),(n!==void 0||o!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=an(Math.floor(u*a))),{width:d,height:u}}function _l(e,n,o){const a=n||1,r=an(e.height*a),s=an(e.width*a);e.height=an(e.height),e.width=an(e.width);const i=e.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(e.currentDevicePixelRatio=a,i.height=r,i.width=s,e.ctx.setTransform(a,0,0,a,0,0),!0):!1}const xp=(function(){let e=!1;try{const n={get passive(){return e=!0,!1}};Wr()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return e})();function El(e,n){const o=hp(e,n),a=o&&o.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function En(e,n,o,a){return{x:e.x+o*(n.x-e.x),y:e.y+o*(n.y-e.y)}}function kp(e,n,o,a){return{x:e.x+o*(n.x-e.x),y:a==="middle"?o<.5?e.y:n.y:a==="after"?o<1?e.y:n.y:o>0?n.y:e.y}}function wp(e,n,o,a){const r={x:e.cp2x,y:e.cp2y},s={x:n.cp1x,y:n.cp1y},i=En(e,r,o),l=En(r,s,o),c=En(s,n,o),d=En(i,l,o),u=En(l,c,o);return En(d,u,o)}const Cp=function(e,n){return{x(o){return e+e+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,a){return o-a},leftForLtr(o,a){return o-a}}},Bp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,n){return e+n},leftForLtr(e,n){return e}}};function In(e,n,o){return e?Cp(n,o):Bp()}function Sl(e,n){let o,a;(n==="ltr"||n==="rtl")&&(o=e.canvas.style,a=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),e.prevTextDirection=a)}function Al(e,n){n!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",n[0],n[1]))}function Vl(e){return e==="angle"?{between:mo,compare:Cm,normalize:ft}:{between:Wt,compare:(n,o)=>n-o,normalize:n=>n}}function Dl({start:e,end:n,count:o,loop:a,style:r}){return{start:e%o,end:n%o,loop:a&&(n-e+1)%o===0,style:r}}function _p(e,n,o){const{property:a,start:r,end:s}=o,{between:i,normalize:l}=Vl(a),c=n.length;let{start:d,end:u,loop:f}=e,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:e.style}}function Ml(e,n,o){if(!o)return[e];const{property:a,start:r,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=Vl(a),{start:u,end:f,loop:h,style:m}=_p(e,n,o),p=[];let x=!1,y=null,g,B,k;const C=()=>c(r,k,g)&&l(r,k)!==0,E=()=>l(s,g)===0||c(s,k,g),_=()=>x||C(),w=()=>!x||E();for(let b=u,A=u;b<=f;++b)B=n[b%i],!B.skip&&(g=d(B[a]),g!==k&&(x=c(g,r,s),y===null&&_()&&(y=l(g,r)===0?b:A),y!==null&&w()&&(p.push(Dl({start:y,end:b,loop:h,count:i,style:m})),y=null),A=b,k=g));return y!==null&&p.push(Dl({start:y,end:f,loop:h,count:i,style:m})),p}function Nl(e,n){const o=[],a=e.segments;for(let r=0;r<a.length;r++){const s=Ml(a[r],e.points,n);s.length&&o.push(...s)}return o}function Ep(e,n,o,a){let r=0,s=n-1;if(o&&!a)for(;r<n&&!e[r].skip;)r++;for(;r<n&&e[r].skip;)r++;for(r%=n,o&&(s+=r);s>r&&e[s%n].skip;)s--;return s%=n,{start:r,end:s}}function Sp(e,n,o,a){const r=e.length,s=[];let i=n,l=e[n],c;for(c=n+1;c<=o;++c){const d=e[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:n%r,end:(c-1)%r,loop:a}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%r,end:i%r,loop:a}),s}function Ap(e,n){const o=e.points,a=e.options.spanGaps,r=o.length;if(!r)return[];const s=!!e._loop,{start:i,end:l}=Ep(o,r,s,a);if(a===!0)return Pl(e,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+r:l,d=!!e._fullLoop&&i===0&&l===r-1;return Pl(e,Sp(o,i,c,d),o,n)}function Pl(e,n,o,a){return!a||!a.setContext||!o?n:Vp(e,n,o,a)}function Vp(e,n,o,a){const r=e._chart.getContext(),s=vl(e.options),{_datasetIndex:i,options:{spanGaps:l}}=e,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(p,x,y,g){const B=l?-1:1;if(p!==x){for(p+=c;o[p%c].skip;)p-=B;for(;o[x%c].skip;)x+=B;p%c!==x%c&&(d.push({start:p%c,end:x%c,loop:y,style:g}),u=g,f=x%c)}}for(const p of n){f=l?f:p.start;let x=o[f%c],y;for(h=f+1;h<=p.end;h++){const g=o[h%c];y=vl(a.setContext(Cn(r,{type:"segment",p0:x,p1:g,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Dp(y,u)&&m(f,h-1,p.loop,u),x=g,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function vl(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Dp(e,n){if(!n)return!1;const o=[],a=function(r,s){return Pr(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(e,a)!==JSON.stringify(n,a)}function ia(e,n,o){return e.options.clip?e[o]:n[o]}function Mp(e,n){const{xScale:o,yScale:a}=e;return o&&a?{left:ia(o,n,"left"),right:ia(o,n,"right"),top:ia(a,n,"top"),bottom:ia(a,n,"bottom")}:n}function Tl(e,n){const o=n._clip;if(o.disabled)return!1;const a=Mp(n,e.chartArea);return{left:o.left===!1?0:a.left-(o.left===!0?0:o.left),right:o.right===!1?e.width:a.right+(o.right===!0?0:o.right),top:o.top===!1?0:a.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?e.height:a.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class Op{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,a,r){const s=o.listeners[r],i=o.duration;s.forEach(l=>l({chart:t,initial:o.initial,numSteps:i,currentStep:Math.min(a-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=al.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((a,r)=>{if(!a.running||!a.items.length)return;const s=a.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>a.duration&&(a.duration=c._total),c.tick(t),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,t,"progress")),s.length||(a.running=!1,this._notify(r,a,t,"complete"),a.initial=!1),o+=s.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let a=o.get(t);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,a)),a}listen(t,o,a){this._getAnims(t).listeners[o].push(a)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const a=o.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var jt=new Op;const vl="transparent",zp={boolean(e,t,o){return o>.5?t:e},color(e,t,o){const a=ll(e||vl),r=a.valid&&ll(t||vl);return r&&r.valid?r.mix(a,o).hexString():t},number(e,t,o){return e+(t-e)*o}};class Fp{constructor(t,o,a,r){const s=o[a];r=ta([t.to,r,s,t.from]);const i=ta([t.from,s,r]);this._active=!0,this._fn=t.fn||zp[t.type||typeof i],this._easing=mo[t.easing]||mo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(t,o,a){if(this._active){this._notify(!1);const r=this._target[this._prop],s=a-this._start,i=this._duration-s;this._start=a,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ta([t.to,o,r,t.from]),this._from=ta([t.from,r,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,a=this._duration,r=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<a),!this._active){this._target[r]=l,this._notify(!0);return}if(o<0){this._target[r]=s;return}c=o/a%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,a)=>{t.push({res:o,rej:a})})}_notify(t){const o=t?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][o]()}}class Tl{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o)}configure(t){if(!Se(t))return;const o=Object.keys(Ue.animation),a=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Se(s))return;const i={};for(const l of o)i[l]=s[l];(qe(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(t,o){const a=o.options,r=Ip(t,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Rp(t.options.$animations,a).then(()=>{t.options=a},()=>{}),s}_createAnimations(t,o){const a=this._properties,r=[],s=t.$animations||(t.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,o));continue}const u=o[d];let f=s[d];const h=a.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){t[d]=u;continue}s[d]=f=new Fp(h,t,d,u),r.push(f)}return r}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const a=this._createAnimations(t,o);if(a.length)return jt.add(this._chart,a),!0}}function Rp(e,t){const o=[],a=Object.keys(t);for(let r=0;r<a.length;r++){const s=e[a[r]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Ip(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Ol(e,t){const o=e&&e.options||{},a=o.reverse,r=o.min===void 0?t:0,s=o.max===void 0?t:0;return{start:a?s:r,end:a?r:s}}function Lp(e,t,o){if(o===!1)return!1;const a=Ol(e,o),r=Ol(t,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function $p(e){let t,o,a,r;return Se(e)?(t=e.top,o=e.right,a=e.bottom,r=e.left):t=o=a=r=e,{top:t,right:o,bottom:a,left:r,disabled:e===!1}}function zl(e,t){const o=[],a=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=a.length;r<s;++r)o.push(a[r].index);return o}function Fl(e,t,o,a={}){const r=e.keys,s=a.mode==="single";let i,l,c,d;if(t===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===o){if(u=!0,a.all)continue;break}d=e.values[c],tt(d)&&(s||t===0||Mt(t)===Mt(d))&&(t+=d)}return!u&&!a.all?0:t}function Wp(e,t){const{iScale:o,vScale:a}=t,r=o.axis==="x"?"x":"y",s=a.axis==="x"?"x":"y",i=Object.keys(e),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[r]:u,[s]:e[u]};return l}function Wr(e,t){const o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function jp(e,t,o){return`${e.id}.${t.id}.${o.stack||o.type}`}function Up(e){const{min:t,max:o,minDefined:a,maxDefined:r}=e.getUserBounds();return{min:a?t:Number.NEGATIVE_INFINITY,max:r?o:Number.POSITIVE_INFINITY}}function Hp(e,t,o){const a=e[t]||(e[t]={});return a[o]||(a[o]={})}function Rl(e,t,o,a){for(const r of t.getMatchingVisibleMetas(a).reverse()){const s=e[r.index];if(o&&s>0||!o&&s<0)return r.index}return null}function Il(e,t){const{chart:o,_cachedMeta:a}=e,r=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=jp(s,i,a),f=t.length;let h;for(let m=0;m<f;++m){const p=t[m],{[c]:b,[d]:y}=p,g=p._stacks||(p._stacks={});h=g[d]=Hp(r,u,b),h[l]=y,h._top=Rl(h,i,!0,a.type),h._bottom=Rl(h,i,!1,a.type);const B=h._visualValues||(h._visualValues={});B[l]=y}}function jr(e,t){const o=e.scales;return Object.keys(o).filter(a=>o[a].axis===t).shift()}function qp(e,t){return wn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gp(e,t,o){return wn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function yo(e,t){const o=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[a]===void 0||s[a][o]===void 0)return;delete s[a][o],s[a]._visualValues!==void 0&&s[a]._visualValues[o]!==void 0&&delete s[a]._visualValues[o]}}}const Ur=e=>e==="reset"||e==="none",Ll=(e,t)=>t?e:Object.assign({},e),Xp=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:zl(o,!0),values:null};class En{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Wr(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&yo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,a=this.getDataset(),r=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=o.xAxisID=Be(a.xAxisID,jr(t,"x")),i=o.yAxisID=Be(a.yAxisID,jr(t,"y")),l=o.rAxisID=Be(a.rAxisID,jr(t,"r")),c=o.indexAxis,d=o.iAxisID=r(c,s,i,l),u=o.vAxisID=r(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nl(this._data,this),t._stacked&&yo(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),a=this._data;if(Se(o)){const r=this._cachedMeta;this._data=Wp(o,r)}else if(a!==o){if(a){nl(a,this);const r=this._cachedMeta;yo(r),r._parsed=[]}o&&Object.isExtensible(o)&&Mm(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=o._stacked;o._stacked=Wr(o.vScale,o),o.stack!==a.stack&&(r=!0,yo(o),o.stack=a.stack),this._resyncElements(t),(r||s!==o._stacked)&&(Il(this,o._parsed),o._stacked=Wr(o.vScale,o))}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),a=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=t===0&&o===r.length?!0:a._sorted,d=t>0&&a._parsed[t-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{qe(r[t])?h=this.parseArrayData(a,r,t,o):Se(r[t])?h=this.parseObjectData(a,r,t,o):h=this.parsePrimitiveData(a,r,t,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)a._parsed[u+t]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&Il(this,h)}parsePrimitiveData(t,o,a,r){const{iScale:s,vScale:i}=t,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+a,f[h]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};return f}parseArrayData(t,o,a,r){const{xScale:s,yScale:i}=t,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(t,o,a,r){const{xScale:s,yScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(r);let u,f,h,m;for(u=0,f=r;u<f;++u)h=u+a,m=o[h],d[u]={x:s.parse(gn(m,l),h),y:i.parse(gn(m,c),h)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,a){const r=this.chart,s=this._cachedMeta,i=o[t.axis],l={keys:zl(r,!0),values:o._stacks[t.axis]._visualValues};return Fl(l,i,s.index,{mode:a})}updateRangeFromParsed(t,o,a,r){const s=a[o.axis];let i=s===null?NaN:s;const l=r&&a._stacks[o.axis];r&&l&&(r.values=l,i=Fl(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,o){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&t===a.iScale,i=r.length,l=this._getOtherScale(t),c=Xp(o,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Up(l);let h,m;function p(){m=r[h];const b=m[l.axis];return!tt(m[t.axis])||u>b||f<b}for(h=0;h<i&&!(!p()&&(this.updateRangeFromParsed(d,t,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,t,m,c);break}}return d}getAllParsedValues(t){const o=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=o.length;r<s;++r)i=o[r][t.axis],tt(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(t){const o=this._cachedMeta,a=o.iScale,r=o.vScale,s=this.getParsed(t);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const o=this._cachedMeta;this.update(t||"default"),o._clip=$p(Be(this.options.clip,Lp(o.xScale,o.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,o=this.chart,a=this._cachedMeta,r=a.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(t,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(t,s))}for(u=0;u<i.length;++u)i[u].draw(t,s)}getStyle(t,o){const a=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(t||0,a)}getContext(t,o,a){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];s=i.$context||(i.$context=Gp(this.getContext(),t,i)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=qp(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=a,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",a){const r=o==="active",s=this._cachedDataOpts,i=t+"-"+o,l=s[i],c=this.enableOptionSharing&&co(a);if(l)return Ll(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,t),f=r?[`${t}Hover`,"hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ue.elements[t]),p=()=>this.getContext(a,r,o),b=d.resolveNamedOptions(h,m,p,f);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(Ll(b,c))),b}_resolveAnimations(t,o,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(r.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(t,a,o))}const d=new Tl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const a=this.resolveDataElementOptions(t,o),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(o,s)||s!==r;return this.updateSharedOptions(s,o,a),{sharedOptions:s,includeOptions:i}}updateElement(t,o,a,r){Ur(r)?Object.assign(t,a):this._resolveAnimations(o,r).update(t,a)}updateSharedOptions(t,o,a){t&&!Ur(o)&&this._resolveAnimations(void 0,o).update(t,a)}_setStyle(t,o,a,r){t.active=r;const s=this.getStyle(o,r);this._resolveAnimations(o,a,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,o,a){this._setStyle(t,a,"active",!1)}setHoverStyle(t,o,a){this._setStyle(t,a,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,a=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const r=a.length,s=o.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,o,a=!0){const r=this._cachedMeta,s=r.data,i=t+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=t;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,o),a&&this.updateElements(s,t,o,"reset")}updateElements(t,o,a,r){}_removeElements(t,o){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(t,o);a._stacked&&yo(a,r)}a.data.splice(t,o)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[o,a,r]=t;this[o](a,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);const a=arguments.length-2;a&&this._sync(["_insertElements",t,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(En,"defaults",{}),me(En,"datasetElementType",null),me(En,"dataElementType",null);function Yp(e,t){if(!e._cache.$bar){const o=e.getMatchingVisibleMetas(t);let a=[];for(let r=0,s=o.length;r<s;r++)a=a.concat(o[r].controller.getAllParsedValues(e));e._cache.$bar=ol(a.sort((r,s)=>r-s))}return e._cache.$bar}function Kp(e){const t=e.iScale,o=Yp(t,e.type);let a=t._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(co(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=o.length;r<s;++r)i=t.getPixelForValue(o[r]),c();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)i=t.getPixelForTick(r),c();return a}function Jp(e,t,o,a){const r=o.barThickness;let s,i;return Ne(r)?(s=t.min*o.categoryPercentage,i=o.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:t.pixels[e]-s/2}}function Qp(e,t,o,a){const r=t.pixels,s=r[e];let i=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/a,ratio:o.barPercentage,start:d}}function Zp(e,t,o,a){const r=o.parse(e[0],a),s=o.parse(e[1],a),i=Math.min(r,s),l=Math.max(r,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),t[o.axis]=d,t._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function $l(e,t,o,a){return qe(e)?Zp(e,t,o,a):t[o.axis]=o.parse(e,a),t}function Wl(e,t,o,a){const r=e.iScale,s=e.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=o,u=o+a;d<u;++d)h=t[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push($l(h,f,s,d));return c}function Hr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function eg(e,t,o){return e!==0?Mt(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function tg(e){let t,o,a,r,s;return e.horizontal?(t=e.base>e.x,o="left",a="right"):(t=e.base<e.y,o="bottom",a="top"),t?(r="end",s="start"):(r="start",s="end"),{start:o,end:a,reverse:t,top:r,bottom:s}}function ng(e,t,o,a){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=tg(e);r==="middle"&&o&&(e.enableBorderRadius=!0,(o._top||0)===a?r=d:(o._bottom||0)===a?r=u:(s[jl(u,i,l,c)]=!0,r=d)),s[jl(r,i,l,c)]=!0,e.borderSkipped=s}function jl(e,t,o,a){return a?(e=og(e,t,o),e=Ul(e,o,t)):e=Ul(e,t,o),e}function og(e,t,o){return e===t?o:e===o?t:e}function Ul(e,t,o){return e==="start"?t:e==="end"?o:e}function ag(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t}class sa extends En{parsePrimitiveData(t,o,a,r){return Wl(t,o,a,r)}parseArrayData(t,o,a,r){return Wl(t,o,a,r)}parseObjectData(t,o,a,r){const{iScale:s,vScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,p,b;for(h=a,m=a+r;h<m;++h)b=o[h],p={},p[s.axis]=s.parse(gn(b,d),h),f.push($l(gn(b,u),p,i,h));return f}updateRangeFromParsed(t,o,a,r){super.updateRangeFromParsed(t,o,a,r);const s=a._custom;s&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const o=this._cachedMeta,{iScale:a,vScale:r}=o,s=this.getParsed(t),i=s._custom,l=Hr(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+a.getLabelForValue(s[a.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t)}updateElements(t,o,a,r){const s=r==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,r);for(let m=o;m<o+a;m++){const p=this.getParsed(m),b=s||Ne(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),g=(p._stacks||{})[l.axis],B={horizontal:d,base:b.base,enableBorderRadius:!g||Hr(p._custom)||i===g._top||i===g._bottom,x:d?b.head:y.center,y:d?y.center:b.head,height:d?y.size:Math.abs(b.size),width:d?Math.abs(b.size):y.size};h&&(B.options=f||this.resolveDataElementOptions(m,t[m].active?"active":r));const w=B.options||t[m].options;ng(B,w,g,i),ag(B,w,u.ratio),this.updateElement(t[m],m,B,r)}}_getStacks(t,o){const{iScale:a}=this._cachedMeta,r=a.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=a.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(Ne(h)||isNaN(h))return!0};for(const u of r)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(t).filter(a=>t[a].axis===o).shift()}_getAxis(){const t={},o=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)t[Be(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,o)]=!0;return Object.keys(t)}_getStackIndex(t,o,a){const r=this._getStacks(t,a),s=o!==void 0?r.indexOf(o):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,o=this._cachedMeta,a=o.iScale,r=[];let s,i;for(s=0,i=o.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=t.barThickness;return{min:l||Kp(o),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:o,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(t),d=c._custom,u=Hr(d);let f=c[o.axis],h=0,m=a?this.applyStack(o,c,a):f,p,b;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Mt(f)!==Mt(d.barEnd)&&(h=0),h+=f);const y=!Ne(s)&&!u?s:h;let g=o.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=o.getPixelForValue(h+m):p=g,b=p-g,Math.abs(b)<i){b=eg(b,o,l)*i,f===l&&(g-=b/2);const B=o.getPixelForDecimal(0),w=o.getPixelForDecimal(1),C=Math.min(B,w),E=Math.max(B,w);g=Math.max(Math.min(g,E),C),p=g+b,a&&!u&&(c._stacks[o.axis]._visualValues[r]=o.getValueForPixel(p)-o.getValueForPixel(g))}if(g===o.getPixelForValue(l)){const B=Mt(b)*o.getLineWidthForValue(l)/2;g+=B,b-=B}return{size:b,base:g,head:p,center:p+b/2}}_calculateBarIndexPixels(t,o){const a=o.scale,r=this.options,s=r.skipNull,i=Be(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(t):o.stackCount,f=r.barThickness==="flex"?Qp(t,o,r,u*d):Jp(t,o,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Be(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(t)[a.axis],t),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,o=t.vScale,a=t.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[o.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}me(sa,"id","bar"),me(sa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),me(sa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function rg(e,t,o){let a=1,r=1,s=0,i=0;if(t<We){const l=e,c=l+t,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,C,E)=>ho(w,l,c,!0)?1:Math.max(C,C*o,E,E*o),p=(w,C,E)=>ho(w,l,c,!0)?-1:Math.min(C,C*o,E,E*o),b=m(0,d,f),y=m(Ye,u,h),g=p(ve,d,f),B=p(ve+Ye,u,h);a=(b-g)/2,r=(y-B)/2,s=-(b+g)/2,i=-(y+B)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class In extends En{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(Se(a[t])){const{key:c="value"}=this._parsing;s=d=>+gn(a[d],c)}let i,l;for(i=t,l=t+o;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=We,o=-We;for(let a=0;a<this.chart.data.datasets.length;++a)if(this.chart.isDatasetVisible(a)&&this.chart.getDatasetMeta(a).type===this._type){const r=this.chart.getDatasetMeta(a).controller,s=r._getRotation(),i=r._getCircumference();t=Math.min(t,s),o=Math.max(o,s+i)}return{rotation:t,circumference:o-t}}update(t){const o=this.chart,{chartArea:a}=o,r=this._cachedMeta,s=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(a.width,a.height)-i)/2,0),c=Math.min(hm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:b}=rg(f,u,c),y=(a.width-i)/h,g=(a.height-i)/m,B=Math.max(Math.min(y,g)/2,0),w=qi(this.options.radius,B),C=Math.max(w*c,0),E=(w-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=b*w,r.total=this.calculateTotal(),this.outerRadius=w-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,o){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return o&&a.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/We)}updateElements(t,o,a,r){const s=r==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:y}=this._getSharedOptions(o,r);let g=this._getRotation(),B;for(B=0;B<o;++B)g+=this._circumference(B,s);for(B=o;B<o+a;++B){const w=this._circumference(B,s),C=t[B],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+w,circumference:w,outerRadius:p,innerRadius:m};y&&(E.options=b||this.resolveDataElementOptions(B,C.active?"active":r)),g+=w,this.updateElement(C,B,E,r)}}calculateTotal(){const t=this._cachedMeta,o=t.data;let a=0,r;for(r=0;r<o.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!o[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(t){const o=this._cachedMeta.total;return o>0&&!isNaN(t)?We*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=Pr(o._parsed[t],a.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let o=0;const a=this.chart;let r,s,i,l,c;if(!t){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),t=i.data,l=i.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let a=0,r=t.length;a<r;++a){const s=this.resolveDataElementOptions(a);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(t){let o=0;for(let a=0;a<t;++a)this.chart.isDatasetVisible(a)&&(o+=this._getRingWeight(a));return o}_getRingWeight(t){return Math.max(Be(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}me(In,"id","doughnut"),me(In,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),me(In,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),me(In,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=t.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:r,pointStyle:a,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(t,o,a){a.chart.toggleDataVisibility(o.index),a.chart.update()}}}});class ia extends En{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=vm(o,r,i);this._drawStart=l,this._drawCount=c,Tm(o)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},t),this.updateElements(r,l,c,t)}updateElements(t,o,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,r),h=i.axis,m=l.axis,{spanGaps:p,segment:b}=this.options,y=fo(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||s||r==="none",B=o+a,w=t.length;let C=o>0&&this.getParsed(o-1);for(let E=0;E<w;++E){const _=t[E],k=g?_:{};if(E<o||E>=B){k.skip=!0;continue}const x=this.getParsed(E),A=Ne(x[m]),D=k[h]=i.getPixelForValue(x[h],E),M=k[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,x,c):x[m],E);k.skip=isNaN(D)||isNaN(M)||A,k.stop=E>0&&Math.abs(x[h]-C[h])>y,b&&(k.parsed=x,k.raw=d.data[E]),f&&(k.options=u||this.resolveDataElementOptions(E,_.active?"active":r)),g||this.updateElement(_,E,k,r),C=x}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,a=o.options&&o.options.borderWidth||0,r=t.data||[];if(!r.length)return a;const s=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(a,s,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}me(ia,"id","line"),me(ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class qr extends In{}me(qr,"id","pie"),me(qr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Sn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gr{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Gr.prototype,t)}init(){}formats(){return Sn()}parse(){return Sn()}format(){return Sn()}add(){return Sn()}diff(){return Sn()}startOf(){return Sn()}endOf(){return Sn()}}var sg={_date:Gr};function ig(e,t,o,a){const{controller:r,data:s,_sorted:i}=e,l=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&i&&s.length){const d=l._reversePixels?Vm:yn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=d(s,t,o-f),m=d(s,t,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,t,o);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=e,m=h.slice(0,u.lo+1).reverse().findIndex(b=>!Ne(b[f.axis]));u.lo-=Math.max(0,m);const p=h.slice(u.hi).findIndex(b=>!Ne(b[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function la(e,t,o,a,r){const s=e.getSortedVisibleDatasetMetas(),i=o[t];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=ig(s[l],t,i,r);for(let m=f;m<=h;++m){const p=u[m];p.skip||a(p,d,m)}}}function lg(e){const t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(a,r){const s=t?Math.abs(a.x-r.x):0,i=o?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Xr(e,t,o,a,r){const s=[];return!r&&!e.isPointInArea(t)||la(e,o,t,function(l,c,d){!r&&!go(l,e.chartArea,0)||l.inRange(t.x,t.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function cg(e,t,o,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=el(i,{x:t.x,y:t.y});ho(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return la(e,o,t,s),r}function dg(e,t,o,a,r,s){let i=[];const l=lg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(t.x,t.y,r);if(a&&!m)return;const p=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(p))&&!m)return;const y=l(t,p);y<c?(i=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:h})}return la(e,o,t,d),i}function Yr(e,t,o,a,r,s){return!s&&!e.isPointInArea(t)?[]:o==="r"&&!a?cg(e,t,o,r):dg(e,t,o,a,r,s)}function Hl(e,t,o,a,r){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return la(e,o,t,(c,d,u)=>{c[i]&&c[i](t[o],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(t.x,t.y,r))}),a&&!l?[]:s}var ug={modes:{index(e,t,o,a){const r=Bn(t,e),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i),c=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(e,t,o,a){const r=Bn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i);if(l.length>0){const c=l[0].datasetIndex,d=e.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(e,t,o,a){const r=Bn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Xr(e,r,s,a,i)},nearest(e,t,o,a){const r=Bn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Yr(e,r,s,o.intersect,a,i)},x(e,t,o,a){const r=Bn(t,e);return Hl(e,r,"x",o.intersect,a)},y(e,t,o,a){const r=Bn(t,e);return Hl(e,r,"y",o.intersect,a)}}};const ql=["left","top","right","bottom"];function xo(e,t){return e.filter(o=>o.pos===t)}function Gl(e,t){return e.filter(o=>ql.indexOf(o.pos)===-1&&o.box.axis===t)}function ko(e,t){return e.sort((o,a)=>{const r=t?a:o,s=t?o:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function fg(e){const t=[];let o,a,r,s,i,l;for(o=0,a=(e||[]).length;o<a;++o)r=e[o],{position:s,options:{stack:i,stackWeight:l=1}}=r,t.push({index:o,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return t}function hg(e){const t={};for(const o of e){const{stack:a,pos:r,stackWeight:s}=o;if(!a||!ql.includes(r))continue;const i=t[a]||(t[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return t}function mg(e,t){const o=hg(e),{vBoxMaxWidth:a,hBoxMaxHeight:r}=t;let s,i,l;for(s=0,i=e.length;s<i;++s){l=e[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&t.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&t.availableHeight)}return o}function pg(e){const t=fg(e),o=ko(t.filter(d=>d.box.fullSize),!0),a=ko(xo(t,"left"),!0),r=ko(xo(t,"right")),s=ko(xo(t,"top"),!0),i=ko(xo(t,"bottom")),l=Gl(t,"x"),c=Gl(t,"y");return{fullSize:o,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:xo(t,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function Xl(e,t,o,a){return Math.max(e[o],t[o])+Math.max(e[a],t[a])}function Yl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function gg(e,t,o,a){const{pos:r,box:s}=o,i=e.maxPadding;if(!Se(r)){o.size&&(e[r]-=o.size);const f=a[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,e[r]+=o.size}s.getPadding&&Yl(i,s.getPadding());const l=Math.max(0,t.outerWidth-Xl(i,e,"left","right")),c=Math.max(0,t.outerHeight-Xl(i,e,"top","bottom")),d=l!==e.w,u=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function bg(e){const t=e.maxPadding;function o(a){const r=Math.max(t[a]-e[a],0);return e[a]+=r,r}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function yg(e,t){const o=t.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(t[i],o[i])}),s}return a(e?["left","right"]:["top","bottom"])}function wo(e,t,o,a){const r=[];let s,i,l,c,d,u;for(s=0,i=e.length,d=0;s<i;++s){l=e[s],c=l.box,c.update(l.width||t.w,l.height||t.h,yg(l.horizontal,t));const{same:f,other:h}=gg(t,o,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&wo(r,t,o,a)||u}function ca(e,t,o,a,r){e.top=o,e.left=t,e.right=t+a,e.bottom=o+r,e.width=a,e.height=r}function Kl(e,t,o,a){const r=o.padding;let{x:s,y:i}=t;for(const l of e){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*u,h=d.size||c.height;co(d.start)&&(i=d.start),c.fullSize?ca(c,r.left,i,o.outerWidth-r.right-r.left,h):ca(c,t.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=t.h*u,h=d.size||c.width;co(d.start)&&(s=d.start),c.fullSize?ca(c,s,r.top,h,o.outerHeight-r.bottom-r.top):ca(c,s,t.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}t.x=s,t.y=i}var bt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(o){t.draw(o)}}]},e.boxes.push(t)},removeBox(e,t){const o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1)},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight},update(e,t,o,a){if(!e)return;const r=gt(e.options.layout.padding),s=Math.max(t-r.width,0),i=Math.max(o-r.height,0),l=pg(e.boxes),c=l.vertical,d=l.horizontal;Pe(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,y)=>y.box.options&&y.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:o,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);Yl(h,gt(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),p=mg(c.concat(d),f);wo(l.fullSize,m,f,p),wo(c,m,f,p),wo(d,m,f,p)&&wo(c,m,f,p),bg(m),Kl(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Kl(l.rightAndBottom,m,f,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Pe(l.chartArea,b=>{const y=b.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Jl{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,a){}removeEventListener(t,o,a){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,a,r){return o=Math.max(0,o||t.width),a=a||t.height,{width:o,height:Math.max(0,r?Math.floor(o/r):a)}}isAttached(t){return!0}updateConfig(t){}}class xg extends Jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const da="$chartjs",kg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ql=e=>e===null||e==="";function wg(e,t){const o=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e[da]={initial:{height:a,width:r,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Ql(r)){const s=Bl(e,"width");s!==void 0&&(e.width=s)}if(Ql(a))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Bl(e,"height");s!==void 0&&(e.height=s)}return e}const Zl=Bp?{passive:!0}:!1;function Cg(e,t,o){e&&e.addEventListener(t,o,Zl)}function Bg(e,t,o){e&&e.canvas&&e.canvas.removeEventListener(t,o,Zl)}function _g(e,t){const o=kg[e.type]||e.type,{x:a,y:r}=Bn(e,t);return{type:o,chart:t,native:e,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ua(e,t){for(const o of e)if(o===t||o.contains(t))return!0}function Eg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.addedNodes,a),i=i&&!ua(l.removedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}function Sg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.removedNodes,a),i=i&&!ua(l.addedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}const Co=new Map;let ec=0;function tc(){const e=window.devicePixelRatio;e!==ec&&(ec=e,Co.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t()}))}function Ag(e,t){Co.size||window.addEventListener("resize",tc),Co.set(e,t)}function Vg(e){Co.delete(e),Co.size||window.removeEventListener("resize",tc)}function Dg(e,t,o){const a=e.canvas,r=a&&$r(a);if(!r)return;const s=rl((l,c)=>{const d=r.clientWidth;o(l,c),d<r.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(r),Ag(e,s),i}function Kr(e,t,o){o&&o.disconnect(),t==="resize"&&Vg(e)}function Mg(e,t,o){const a=e.canvas,r=rl(s=>{e.ctx!==null&&o(_g(s,e))},e);return Cg(a,t,r),r}class Ng extends Jl{acquireContext(t,o){const a=t&&t.getContext&&t.getContext("2d");return a&&a.canvas===t?(wg(t,o),a):null}releaseContext(t){const o=t.canvas;if(!o[da])return!1;const a=o[da].initial;["height","width"].forEach(s=>{const i=a[s];Ne(i)?o.removeAttribute(s):o.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{o.style[s]=r[s]}),o.width=o.width,delete o[da],!0}addEventListener(t,o,a){this.removeEventListener(t,o);const r=t.$proxies||(t.$proxies={}),i={attach:Eg,detach:Sg,resize:Dg}[o]||Mg;r[o]=i(t,o,a)}removeEventListener(t,o){const a=t.$proxies||(t.$proxies={}),r=a[o];if(!r)return;({attach:Kr,detach:Kr,resize:Kr}[o]||Bg)(t,o,r),a[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,a,r){return Cp(t,o,a,r)}isAttached(t){const o=t&&$r(t);return!!(o&&o.isConnected)}}function Pg(e){return!Lr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?xg:Ng}let Ut=(Ha=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:o,y:a}=this.getProps(["x","y"],t);return{x:o,y:a}}hasValue(){return fo(this.x)&&fo(this.y)}getProps(t,o){const a=this.$animations;if(!o||!a)return this;const r={};return t.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},me(Ha,"defaults",{}),me(Ha,"defaultRoutes"),Ha);function vg(e,t){const o=e.options.ticks,a=Tg(e),r=Math.min(o.maxTicksLimit||a,a),s=o.major.enabled?zg(t):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Fg(t,d,s,i/r),d;const u=Og(s,t,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(fa(t,d,u,Ne(m)?0:l-m,l),f=0,h=i-1;f<h;f++)fa(t,d,u,s[f],s[f+1]);return fa(t,d,u,c,Ne(m)?t.length:c+m),d}return fa(t,d,u),d}function Tg(e){const t=e.options.offset,o=e._tickSize(),a=e._length/o+(t?0:1),r=e._maxLength/o;return Math.floor(Math.min(a,r))}function Og(e,t,o){const a=Rg(e),r=t.length/o;if(!a)return Math.max(r,1);const s=wm(a);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>r)return c}return Math.max(r,1)}function zg(e){const t=[];let o,a;for(o=0,a=e.length;o<a;o++)e[o].major&&t.push(o);return t}function Fg(e,t,o,a){let r=0,s=o[0],i;for(a=Math.ceil(a),i=0;i<e.length;i++)i===s&&(t.push(e[i]),r++,s=o[r*a])}function fa(e,t,o,a,r){const s=Be(a,0),i=Math.min(Be(r,e.length),e.length);let l=0,c,d,u;for(o=Math.ceil(o),r&&(c=r-a,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(t.push(e[d]),l++,u=Math.round(s+l*o))}function Rg(e){const t=e.length;let o,a;if(t<2)return!1;for(a=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==a)return!1;return a}const Ig=e=>e==="left"?"right":e==="right"?"left":e,nc=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o,oc=(e,t)=>Math.min(t||e,e);function ac(e,t){const o=[],a=e.length/t,r=e.length;let s=0;for(;s<r;s+=a)o.push(e[Math.floor(s)]);return o}function Lg(e,t,o){const a=e.ticks.length,r=Math.min(t,a-1),s=e._startPixel,i=e._endPixel,l=1e-6;let c=e.getPixelForTick(r),d;if(!(o&&(a===1?d=Math.max(c-s,i-c):t===0?d=(e.getPixelForTick(1)-c)/2:d=(c-e.getPixelForTick(r-1))/2,c+=r<t?d:-d,c<s-l||c>i+l)))return c}function $g(e,t){Pe(e,o=>{const a=o.gc,r=a.length/2;let s;if(r>t){for(s=0;s<r;++s)delete o.data[a[s]];a.splice(0,r)}})}function Bo(e){return e.drawTicks?e.tickLength:0}function rc(e,t){if(!e.display)return 0;const o=at(e.font,t),a=gt(e.padding);return(qe(e.text)?e.text.length:1)*o.lineHeight+a.height}function Wg(e,t){return wn(e,{scale:t,type:"scale"})}function jg(e,t,o){return wn(e,{tick:o,index:t,type:"tick"})}function Ug(e,t,o){let a=Dr(e);return(o&&t!=="right"||!o&&t==="right")&&(a=Ig(a)),a}function Hg(e,t,o,a){const{top:r,left:s,bottom:i,right:l,chart:c}=e,{chartArea:d,scales:u}=c;let f=0,h,m,p;const b=i-r,y=l-s;if(e.isHorizontal()){if(m=ot(a,s,l),Se(o)){const g=Object.keys(o)[0],B=o[g];p=u[g].getPixelForValue(B)+b-t}else o==="center"?p=(d.bottom+d.top)/2+b-t:p=nc(e,o,t);h=l-s}else{if(Se(o)){const g=Object.keys(o)[0],B=o[g];m=u[g].getPixelForValue(B)-y+t}else o==="center"?m=(d.left+d.right)/2-y+t:m=nc(e,o,t);p=ot(a,i,r),f=o==="left"?-Ye:Ye}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class Ln extends Ut{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:a,_suggestedMax:r}=this;return t=Dt(t,Number.POSITIVE_INFINITY),o=Dt(o,Number.NEGATIVE_INFINITY),a=Dt(a,Number.POSITIVE_INFINITY),r=Dt(r,Number.NEGATIVE_INFINITY),{min:Dt(t,a),max:Dt(o,r),minDefined:tt(t),maxDefined:tt(o)}}getMinMax(t){let{min:o,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:o,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,t),r||(o=Math.min(o,i.min)),s||(a=Math.max(a,i.max));return o=s&&o>a?a:o,a=r&&o>a?o:a,{min:Dt(o,Dt(a,o)),max:Dt(a,Dt(o,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ie(this.options.beforeUpdate,[this])}update(t,o,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=a=Object.assign({left:0,right:0,top:0,bottom:0},a),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+a.left+a.right:this.height+a.top+a.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ep(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ac(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=vg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,o,a;this.isHorizontal()?(o=this.left,a=this.right):(o=this.top,a=this.bottom,t=!t),this._startPixel=o,this._endPixel=a,this._reversePixels=t,this._length=a-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ie(this.options.afterUpdate,[this])}beforeSetDimensions(){Ie(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ie(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ie(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ie(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const o=this.options.ticks;let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a],s.label=Ie(o.callback,[s.value,a,t],this)}afterTickToLabelConversion(){Ie(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ie(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,o=t.ticks,a=oc(this.ticks.length,t.ticks.maxTicksLimit),r=o.minRotation||0,s=o.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!o.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=nt(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(t.offset?.5:1)),c=this.maxHeight-Bo(t.grid)-o.padding-rc(t.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Em(Math.min(Math.asin(nt((u.highest.height+6)/l,-1,1)),Math.asin(nt(c/d,-1,1))-Math.asin(nt(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Ie(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ie(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=rc(r,o.options.font);if(l?(t.width=this.maxWidth,t.height=Bo(s)+c):(t.height=this.maxHeight,t.width=Bo(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,p=$t(this.labelRotation),b=Math.cos(p),y=Math.sin(p);if(l){const g=a.mirror?0:y*f.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+g+m)}else{const g=a.mirror?0:b*f.width+y*h.height;t.width=Math.min(this.maxWidth,t.width+g+m)}this._calculatePadding(d,u,y,b)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,a,r){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=r*t.width,m=a*o.height):(h=a*t.height,m=r*o.width):s==="start"?m=o.width:s==="end"?h=t.width:s!=="inner"&&(h=t.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=t.height/2;s==="start"?(u=0,f=t.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ie(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,a;for(o=0,a=t.length;o<a;o++)Ne(t[o].label)&&(t.splice(o,1),a--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const o=this.options.ticks.sampleSize;let a=this.ticks;o<a.length&&(a=ac(a,o)),this._labelSizes=t=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,o,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/oc(o,a));let d=0,u=0,f,h,m,p,b,y,g,B,w,C,E;for(f=0;f<o;f+=c){if(p=t[f].label,b=this._resolveTickFontOptions(f),r.font=y=b.string,g=s[y]=s[y]||{data:{},gc:[]},B=b.lineHeight,w=C=0,!Ne(p)&&!qe(p))w=ul(r,g.data,g.gc,w,p),C=B;else if(qe(p))for(h=0,m=p.length;h<m;++h)E=p[h],!Ne(E)&&!qe(E)&&(w=ul(r,g.data,g.gc,w,E),C+=B);i.push(w),l.push(C),d=Math.max(w,d),u=Math.max(C,u)}$g(s,o);const _=i.indexOf(d),k=l.indexOf(u),x=A=>({width:i[A]||0,height:l[A]||0});return{first:x(0),last:x(o-1),widest:x(_),highest:x(k),widths:i,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return Am(this._alignToPixels?kn(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&t<o.length){const a=o[t];return a.$context||(a.$context=jg(this.getContext(),t,a))}return this.$context||(this.$context=Wg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,o=$t(this.labelRotation),a=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=t.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*a>l*r?l/a:c/r:c*r<l*a?c/a:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const o=this.axis,a=this.chart,r=this.options,{grid:s,position:i,border:l}=r,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Bo(s),m=[],p=l.setContext(this.getContext()),b=p.display?p.width:0,y=b/2,g=function(R){return kn(a,R,b)};let B,w,C,E,_,k,x,A,D,M,V,N;if(i==="top")B=g(this.bottom),k=this.bottom-h,A=B-y,M=g(t.top)+y,N=t.bottom;else if(i==="bottom")B=g(this.top),M=t.top,N=g(t.bottom)-y,k=B+y,A=this.top+h;else if(i==="left")B=g(this.right),_=this.right-h,x=B-y,D=g(t.left)+y,V=t.right;else if(i==="right")B=g(this.left),D=t.left,V=g(t.right)-y,_=B+y,x=this.left+h;else if(o==="x"){if(i==="center")B=g((t.top+t.bottom)/2+.5);else if(Se(i)){const R=Object.keys(i)[0],I=i[R];B=g(this.chart.scales[R].getPixelForValue(I))}M=t.top,N=t.bottom,k=B+y,A=k+h}else if(o==="y"){if(i==="center")B=g((t.left+t.right)/2);else if(Se(i)){const R=Object.keys(i)[0],I=i[R];B=g(this.chart.scales[R].getPixelForValue(I))}_=B-y,x=_-h,D=t.left,V=t.right}const T=Be(r.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/T));for(w=0;w<f;w+=K){const R=this.getContext(w),I=s.setContext(R),q=l.setContext(R),ne=I.lineWidth,W=I.color,U=q.dash||[],ee=q.dashOffset,v=I.tickWidth,O=I.tickColor,$=I.tickBorderDash||[],X=I.tickBorderDashOffset;C=Lg(this,w,c),C!==void 0&&(E=kn(a,C,ne),d?_=x=D=V=E:k=A=M=N=E,m.push({tx1:_,ty1:k,tx2:x,ty2:A,x1:D,y1:M,x2:V,y2:N,width:ne,color:W,borderDash:U,borderDashOffset:ee,tickWidth:v,tickColor:O,tickBorderDash:$,tickBorderDashOffset:X}))}return this._ticksLength=f,this._borderValue=B,m}_computeLabelItems(t){const o=this.axis,a=this.options,{position:r,ticks:s}=a,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Bo(a.grid),m=h+u,p=f?-u:m,b=-$t(this.labelRotation),y=[];let g,B,w,C,E,_,k,x,A,D,M,V,N="middle";if(r==="top")_=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")_=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const K=this._getYAxisLabelAlignment(h);k=K.textAlign,E=K.x}else if(r==="right"){const K=this._getYAxisLabelAlignment(h);k=K.textAlign,E=K.x}else if(o==="x"){if(r==="center")_=(t.top+t.bottom)/2+m;else if(Se(r)){const K=Object.keys(r)[0],R=r[K];_=this.chart.scales[K].getPixelForValue(R)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(r==="center")E=(t.left+t.right)/2-m;else if(Se(r)){const K=Object.keys(r)[0],R=r[K];E=this.chart.scales[K].getPixelForValue(R)}k=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?N="top":c==="end"&&(N="bottom"));const T=this._getLabelSizes();for(g=0,B=l.length;g<B;++g){w=l[g],C=w.label;const K=s.setContext(this.getContext(g));x=this.getPixelForTick(g)+s.labelOffset,A=this._resolveTickFontOptions(g),D=A.lineHeight,M=qe(C)?C.length:1;const R=M/2,I=K.color,q=K.textStrokeColor,ne=K.textStrokeWidth;let W=k;i?(E=x,k==="inner"&&(g===B-1?W=this.options.reverse?"left":"right":g===0?W=this.options.reverse?"right":"left":W="center"),r==="top"?d==="near"||b!==0?V=-M*D+D/2:d==="center"?V=-T.highest.height/2-R*D+D:V=-T.highest.height+D/2:d==="near"||b!==0?V=D/2:d==="center"?V=T.highest.height/2-R*D:V=T.highest.height-M*D,f&&(V*=-1),b!==0&&!K.showLabelBackdrop&&(E+=D/2*Math.sin(b))):(_=x,V=(1-M)*D/2);let U;if(K.showLabelBackdrop){const ee=gt(K.backdropPadding),v=T.heights[g],O=T.widths[g];let $=V-ee.top,X=0-ee.left;switch(N){case"middle":$-=v/2;break;case"bottom":$-=v;break}switch(k){case"center":X-=O/2;break;case"right":X-=O;break;case"inner":g===B-1?X-=O:g>0&&(X-=O/2);break}U={left:X,top:$,width:O+ee.width,height:v+ee.height,color:K.backdropColor}}y.push({label:C,font:A,textOffset:V,options:{rotation:b,color:I,strokeColor:q,strokeWidth:ne,textAlign:W,textBaseline:N,translation:[E,_],backdrop:U}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:o}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let r="center";return o.align==="start"?r="left":o.align==="end"?r="right":o.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:o,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=t+s,c=i.widest.width;let d,u;return o==="left"?r?(u=this.right+s,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?r?(u=this.left+s,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:o},left:a,top:r,width:s,height:i}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(a,r,s,i),t.restore())}getLineWidthForValue(t){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?o.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const o=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(a.save(),a.lineWidth=u.width,a.strokeStyle=u.color,a.setLineDash(u.borderDash||[]),a.lineDashOffset=u.borderDashOffset,a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(d.x,d.y),a.stroke(),a.restore())};if(o.display)for(s=0,i=r.length;s<i;++s){const c=r[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:o,options:{border:a,grid:r}}=this,s=a.setContext(this.getContext()),i=a.display?s.width:0;if(!i)return;const l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=kn(t,this.left,i)-i/2,u=kn(t,this.right,l)+l/2,f=h=c):(f=kn(t,this.top,i)-i/2,h=kn(t,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,h),o.stroke(),o.restore()}drawLabels(t){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Qo(a,r);const s=this.getLabelItems(t);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;bo(a,d,0,u,c,l)}r&&Zo(a)}drawTitle(){const{ctx:t,options:{position:o,title:a,reverse:r}}=this;if(!a.display)return;const s=at(a.font),i=gt(a.padding),l=a.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Se(o)?(c+=i.bottom,qe(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Hg(this,c,o,l);bo(t,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:Ug(l,o,r),textBaseline:"middle",translation:[d,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,o=t.ticks&&t.ticks.z||0,a=Be(t.grid&&t.grid.z,-1),r=Be(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ln.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[a]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const o=this.options.ticks.setContext(this.getContext(t));return at(o.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ha{constructor(t,o,a){this.type=t,this.scope=o,this.override=a,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const o=Object.getPrototypeOf(t);let a;Xg(o)&&(a=this.register(o));const r=this.items,s=t.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,qg(t,i,a),this.override&&Ue.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const o=this.items,a=t.id,r=this.scope;a in o&&delete o[a],r&&a in Ue[r]&&(delete Ue[r][a],this.override&&delete xn[a])}}function qg(e,t,o){const a=io(Object.create(null),[o?Ue.get(o):{},Ue.get(t),e.defaults]);Ue.set(t,a),e.defaultRoutes&&Gg(t,e.defaultRoutes),e.descriptors&&Ue.describe(t,e.descriptors)}function Gg(e,t){Object.keys(t).forEach(o=>{const a=o.split("."),r=a.pop(),s=[e].concat(a).join("."),i=t[o].split("."),l=i.pop(),c=i.join(".");Ue.route(s,r,c,l)})}function Xg(e){return"id"in e&&"defaults"in e}class Yg{constructor(){this.controllers=new ha(En,"datasets",!0),this.elements=new ha(Ut,"elements"),this.plugins=new ha(Object,"plugins"),this.scales=new ha(Ln,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,o,a){[...o].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Pe(r,i=>{const l=a||this._getRegistryForType(i);this._exec(t,l,i)})})}_exec(t,o,a){const r=Sr(t);Ie(a["before"+r],[],a),o[t](a),Ie(a["after"+r],[],a)}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){const a=this._typedRegistries[o];if(a.isForType(t))return a}return this.plugins}_get(t,o,a){const r=o.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+a+".");return r}}var Nt=new Yg;class Kg{constructor(){this._init=void 0}notify(t,o,a,r){if(o==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),i=this._notify(s,t,o,a);return o==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,o,a,r){r=r||{};for(const s of t){const i=s.plugin,l=i[a],c=[o,r,s.options];if(Ie(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){Ne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){const a=t&&t.config,r=Be(a.options&&a.options.plugins,{}),s=Jg(a);return r===!1&&!o?[]:Zg(t,s,r,o)}_notifyStateChanges(t){const o=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(o,a),t,"stop"),this._notify(r(a,o),t,"start")}}function Jg(e){const t={},o=[],a=Object.keys(Nt.plugins.items);for(let s=0;s<a.length;s++)o.push(Nt.getPlugin(a[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];o.indexOf(i)===-1&&(o.push(i),t[i.id]=!0)}return{plugins:o,localIds:t}}function Qg(e,t){return!t&&e===!1?null:e===!0?{}:e}function Zg(e,{plugins:t,localIds:o},a,r){const s=[],i=e.getContext();for(const l of t){const c=l.id,d=Qg(a[c],r);d!==null&&s.push({plugin:l,options:e0(e.config,{plugin:l,local:o[c]},d,i)})}return s}function e0(e,{plugin:t,local:o},a,r){const s=e.pluginScopeKeys(t),i=e.getOptionScopes(a,s);return o&&t.defaults&&i.push(t.defaults),e.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jr(e,t){const o=Ue.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function t0(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function n0(e,t){return e===t?"_index_":"_value_"}function sc(e){if(e==="x"||e==="y"||e==="r")return e}function o0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Qr(e,...t){if(sc(e))return e;for(const o of t){const a=o.axis||o0(o.position)||e.length>1&&sc(e[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ic(e,t,o){if(o[t+"AxisID"]===e)return{axis:t}}function a0(e,t){if(t.data&&t.data.datasets){const o=t.data.datasets.filter(a=>a.xAxisID===e||a.yAxisID===e);if(o.length)return ic(e,"x",o[0])||ic(e,"y",o[0])}return{}}function r0(e,t){const o=xn[e.type]||{scales:{}},a=t.scales||{},r=Jr(e.type,t),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!Se(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Qr(i,l,a0(i,e),Ue.scales[l.type]),d=n0(c,r),u=o.scales||{};s[i]=lo(Object.create(null),[{axis:c},l,u[c],u[d]])}),e.data.datasets.forEach(i=>{const l=i.type||e.type,c=i.indexAxis||Jr(l,t),u=(xn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=t0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),lo(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];lo(l,[Ue.scales[l.type],Ue.scale])}),s}function lc(e){const t=e.options||(e.options={});t.plugins=Be(t.plugins,{}),t.scales=r0(e,t)}function cc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function s0(e){return e=e||{},e.data=cc(e.data),lc(e),e}const dc=new Map,uc=new Set;function ma(e,t){let o=dc.get(e);return o||(o=t(),dc.set(e,o),uc.add(o)),o}const _o=(e,t,o)=>{const a=gn(t,o);a!==void 0&&e.add(a)};class i0{constructor(t){this._config=s0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=cc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),lc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ma(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return ma(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return ma(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,a=this.type;return ma(`${a}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const a=this._scopeCache;let r=a.get(t);return(!r||o)&&(r=new Map,a.set(t,r)),r}getOptionScopes(t,o,a){const{options:r,type:s}=this,i=this._cachedScopes(t,a),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{t&&(c.add(t),u.forEach(f=>_o(c,t,f))),u.forEach(f=>_o(c,r,f)),u.forEach(f=>_o(c,xn[s]||{},f)),u.forEach(f=>_o(c,Ue,f)),u.forEach(f=>_o(c,vr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),uc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:t,type:o}=this;return[t,xn[o]||{},Ue.datasets[o]||{},{type:o},Ue,vr]}resolveNamedOptions(t,o,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=fc(this._resolverCache,t,r);let c=i;if(c0(i,o)){s.$shared=!1,a=nn(a)?a():a;const d=this.createResolver(t,a,l);c=zn(i,a,d)}for(const d of o)s[d]=c[d];return s}createResolver(t,o,a=[""],r){const{resolver:s}=fc(this._resolverCache,t,a);return Se(o)?zn(s,o,void 0,r):s}}function fc(e,t,o){let a=e.get(t);a||(a=new Map,e.set(t,a));const r=o.join();let s=a.get(r);return s||(s={resolver:Fr(t,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const l0=e=>Se(e)&&Object.getOwnPropertyNames(e).some(t=>nn(e[t]));function c0(e,t){const{isScriptable:o,isIndexable:a}=pl(e);for(const r of t){const s=o(r),i=a(r),l=(i||s)&&e[r];if(s&&(nn(l)||l0(l))||i&&qe(l))return!0}return!1}var d0="4.5.1";const u0=["top","bottom","left","right","chartArea"];function hc(e,t){return e==="top"||e==="bottom"||u0.indexOf(e)===-1&&t==="x"}function mc(e,t){return function(o,a){return o[e]===a[e]?o[t]-a[t]:o[e]-a[e]}}function pc(e){const t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),Ie(o&&o.onComplete,[e],t)}function f0(e){const t=e.chart,o=t.options.animation;Ie(o&&o.onProgress,[e],t)}function gc(e){return Lr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const pa={},bc=e=>{const t=gc(e);return Object.values(pa).filter(o=>o.canvas===t).pop()};function h0(e,t,o){const a=Object.keys(e);for(const r of a){const s=+r;if(s>=t){const i=e[r];delete e[r],(o>0||s>t)&&(e[s+o]=i)}}}function m0(e,t,o,a){return!o||e.type==="mouseout"?null:a?t:e}class Ht{static register(...t){Nt.add(...t),yc()}static unregister(...t){Nt.remove(...t),yc()}constructor(t,o){const a=this.config=new i0(o),r=gc(t),s=bc(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||Pg(r)),this.platform.updateConfig(a);const l=this.platform.acquireContext(r,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=fm(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Kg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Nm(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],pa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",pc),jt.listen(this,"progress",f0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:a,height:r,_aspectRatio:s}=this;return Ne(t)?o&&s?s:r?a/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Nt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fl(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(t,o){jt.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,t,o,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Cl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Ie(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Pe(o,(a,r)=>{a.id=r})}buildOrUpdateScales(){const t=this.options,o=t.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Qr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Pe(s,i=>{const l=i.options,c=l.id,d=Qr(c,l),u=Be(l.type,i.dtype);(l.position===void 0||hc(l.position,d)!==hc(i.dposition))&&(l.position=i.dposition),r[c]=!0;let f=null;if(c in a&&a[c].type===u)f=a[c];else{const h=Nt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,t)}),Pe(r,(i,l)=>{i||delete a[l]}),Pe(a,i=>{bt.configure(this,i,i.options),bt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,a=t.length;if(t.sort((r,s)=>r.index-s.index),a>o){for(let r=o;r<a;++r)this._destroyDatasetMeta(r);t.splice(o,a-o)}this._sortedMetasets=t.slice(0).sort(mc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((a,r)=>{o.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=o.length;a<r;a++){const s=o[a];let i=this.getDatasetMeta(a);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(a),i=this.getDatasetMeta(a)),i.type=l,i.indexAxis=s.indexAxis||Jr(l,this.options),i.order=s.order||0,i.index=a,i.label=""+s.label,i.visible=this.isDatasetVisible(a),i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{const c=Nt.getController(l),{datasetElementType:d,dataElementType:u}=Ue.datasets[l];Object.assign(c,{dataElementType:Nt.getElement(u),datasetElementType:d&&Nt.getElement(d)}),i.controller=new c(this,a),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Pe(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const a=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!r&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=a.layout.autoPadding?i:0,this._updateLayout(i),r||Pe(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Pe(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),a=new Set(t.events);(!Yi(o,a)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of o){const i=a==="_removeElements"?-s:s;h0(t,r,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,a=s=>new Set(t.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<o;s++)if(!Yi(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const o=this.chartArea,a=o.width<=0||o.height<=0;this._layers=[],Pe(this.boxes,r=>{a&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,a=this.data.datasets.length;o<a;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,a=this.data.datasets.length;o<a;++o)this._updateDataset(o,nn(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,o){const a=this.getDatasetMeta(t),r={meta:a,index:t,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(o),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(jt.has(this)?this.attached&&!jt.running(this)&&jt.start(this):(this.draw(),pc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:a,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(a,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const o=this._sortedMetasets,a=[];let r,s;for(r=0,s=o.length;r<s;++r){const i=o[r];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,a={meta:t,index:t.index,cancelable:!0},r=Pl(this,t);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Qo(o,r),t.controller.draw(),r&&Zo(o),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return go(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,a,r){const s=ug.modes[o];return typeof s=="function"?s(this,t,a,r):[]}getDatasetMeta(t){const o=this.data.datasets[t],a=this._metasets;let r=a.filter(s=>s&&s._dataset===o).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},a.push(r)),r}getContext(){return this.$context||(this.$context=wn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const a=this.getDatasetMeta(t);return typeof a.hidden=="boolean"?!a.hidden:!o.hidden}setDatasetVisibility(t,o){const a=this.getDatasetMeta(t);a.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,a){const r=a?"show":"hide",s=this.getDatasetMeta(t),i=s.controller._resolveAnimations(void 0,r);co(o)?(s.data[o].hidden=!a,this.update()):(this.setDatasetVisibility(t,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),jt.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),fl(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete pa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,o=this.platform,a=(s,i)=>{o.addEventListener(this,s,i),t[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Pe(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,a=(c,d)=>{o.addEventListener(this,c,d),t[c]=d},r=(c,d)=>{t[c]&&(o.removeEventListener(this,c,d),delete t[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{r("attach",l),this.attached=!0,this.resize(),a("resize",s),a("detach",i)};i=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),a("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Pe(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},Pe(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,a){const r=a?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){i=t[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const o=this._active||[],a=t.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!Xo(a,o)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,o))}notifyPlugins(t,o,a){return this._plugins.notify(this,t,o,a)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,a){const r=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,t),l=a?t:s(t,o);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,o){const a={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},r=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(t,o,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(t,o,a){const{_active:r=[],options:s}=this,i=o,l=this._getActiveElements(t,r,a,i),c=ym(t),d=m0(t,this._lastEvent,a,c);a&&(this._lastEvent=null,Ie(s.onHover,[t,l,this],this),c&&Ie(s.onClick,[t,l,this],this));const u=!Xo(l,r);return(u||o)&&(this._active=l,this._updateHoverStyles(l,r,o)),this._lastEvent=d,u}_getActiveElements(t,o,a,r){if(t.type==="mouseout")return[];if(!a)return o;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}me(Ht,"defaults",Ue),me(Ht,"instances",pa),me(Ht,"overrides",xn),me(Ht,"registry",Nt),me(Ht,"version",d0),me(Ht,"getChart",bc);function yc(){return Pe(Ht.instances,e=>e._plugins.invalidate())}function p0(e,t,o){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=t,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ft(a-o));if(e.beginPath(),e.arc(r,s,i-d/2,a+f/2,o-f/2),l>0){const h=Math.min(d/l,ft(a-o));e.arc(r,s,l+d/2,o-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*ft(a-o));if(u==="round")e.arc(r,s,h,o-ve/2,a+ve/2,!0);else if(u==="bevel"){const m=2*h*h,p=-m*Math.cos(o+ve/2)+r,b=-m*Math.sin(o+ve/2)+s,y=m*Math.cos(a+ve/2)+r,g=m*Math.sin(a+ve/2)+s;e.lineTo(p,b),e.lineTo(y,g)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function g0(e,t,o){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=t;let d=r/l;e.beginPath(),e.arc(s,i,l,a-d,o+d),c>r?(d=r/c,e.arc(s,i,c,o+d,a-d,!0)):e.arc(s,i,r,o+Ye,a-Ye),e.closePath(),e.clip()}function b0(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function y0(e,t,o,a){const r=b0(e.options.borderRadius),s=(o-t)/2,i=Math.min(s,a*t/2),l=c=>{const d=(o-Math.min(s,c))*a/2;return nt(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:nt(r.innerStart,0,i),innerEnd:nt(r.innerEnd,0,i)}}function $n(e,t,o,a){return{x:o+e*Math.cos(t),y:a+e*Math.sin(t)}}function ga(e,t,o,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=t,f=Math.max(t.outerRadius+a+o-d,0),h=u>0?u+a+o+d:0;let m=0;const p=r-c;if(a){const K=u>0?u-a:0,R=f>0?f-a:0,I=(K+R)/2,q=I!==0?p*I/(I+a):p;m=(p-q)/2}const b=Math.max(.001,p*f-o/ve)/f,y=(p-b)/2,g=c+y+m,B=r-y-m,{outerStart:w,outerEnd:C,innerStart:E,innerEnd:_}=y0(t,h,f,B-g),k=f-w,x=f-C,A=g+w/k,D=B-C/x,M=h+E,V=h+_,N=g+E/M,T=B-_/V;if(e.beginPath(),s){const K=(A+D)/2;if(e.arc(i,l,f,A,K),e.arc(i,l,f,K,D),C>0){const ne=$n(x,D,i,l);e.arc(ne.x,ne.y,C,D,B+Ye)}const R=$n(V,B,i,l);if(e.lineTo(R.x,R.y),_>0){const ne=$n(V,T,i,l);e.arc(ne.x,ne.y,_,B+Ye,T+Math.PI)}const I=(B-_/h+(g+E/h))/2;if(e.arc(i,l,h,B-_/h,I,!0),e.arc(i,l,h,I,g+E/h,!0),E>0){const ne=$n(M,N,i,l);e.arc(ne.x,ne.y,E,N+Math.PI,g-Ye)}const q=$n(k,g,i,l);if(e.lineTo(q.x,q.y),w>0){const ne=$n(k,A,i,l);e.arc(ne.x,ne.y,w,g-Ye,A)}}else{e.moveTo(i,l);const K=Math.cos(A)*f+i,R=Math.sin(A)*f+l;e.lineTo(K,R);const I=Math.cos(D)*f+i,q=Math.sin(D)*f+l;e.lineTo(I,q)}e.closePath()}function x0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l}=t;let c=t.endAngle;if(s){ga(e,t,o,a,c,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(c=i+(l%We||We))}return ga(e,t,o,a,c,r),e.fill(),c}function k0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;e.setLineDash(f||[]),e.lineDashOffset=h,p?(e.lineWidth=d*2,e.lineJoin=u||"round"):(e.lineWidth=d,e.lineJoin=u||"bevel");let b=t.endAngle;if(s){ga(e,t,o,a,b,r);for(let y=0;y<s;++y)e.stroke();isNaN(l)||(b=i+(l%We||We))}p&&g0(e,t,b),c.selfJoin&&b-i>=ve&&m===0&&u!=="miter"&&p0(e,t,b),s||(ga(e,t,o,a,b,r),e.stroke())}class Eo extends Ut{constructor(o){super();me(this,"circumference");me(this,"endAngle");me(this,"fullCircles");me(this,"innerRadius");me(this,"outerRadius");me(this,"pixelMargin");me(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=el(s,{x:o,y:a}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,p=Be(h,d-c),b=ho(i,c,d)&&c!==d,y=p>=We||b,g=Wt(l,u+m,f+m);return y&&g}getCenterPoint(o){const{x:a,y:r,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,h=(l+c+u+d)/2;return{x:a+Math.cos(f)*h,y:r+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:a,circumference:r}=this,s=(a.offset||0)/4,i=(a.spacing||0)/2,l=a.circular;if(this.pixelMargin=a.borderAlign==="inner"?.33:0,this.fullCircles=r>We?Math.floor(r/We):0,r===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(ve,r||0)),u=s*d;o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,x0(o,this,u,i,l),k0(o,this,u,i,l),o.restore()}}me(Eo,"id","arc"),me(Eo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),me(Eo,"defaultRoutes",{backgroundColor:"backgroundColor"}),me(Eo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function xc(e,t,o=t){e.lineCap=Be(o.borderCapStyle,t.borderCapStyle),e.setLineDash(Be(o.borderDash,t.borderDash)),e.lineDashOffset=Be(o.borderDashOffset,t.borderDashOffset),e.lineJoin=Be(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Be(o.borderWidth,t.borderWidth),e.strokeStyle=Be(o.borderColor,t.borderColor)}function w0(e,t,o){e.lineTo(o.x,o.y)}function C0(e){return e.stepped?Hm:e.tension||e.cubicInterpolationMode==="monotone"?qm:w0}function kc(e,t,o={}){const a=e.length,{start:r=0,end:s=a-1}=o,{start:i,end:l}=t,c=Math.max(r,i),d=Math.min(s,l),u=r<i&&s<i||r>l&&s>l;return{count:a,start:c,loop:t.loop,ilen:d<c&&!u?a+d-c:d-c}}function B0(e,t,o,a){const{points:r,options:s}=t,{count:i,start:l,loop:c,ilen:d}=kc(r,o,a),u=C0(s);let{move:f=!0,reverse:h}=a||{},m,p,b;for(m=0;m<=d;++m)p=r[(l+(h?d-m:m))%i],!p.skip&&(f?(e.moveTo(p.x,p.y),f=!1):u(e,b,p,h,s.stepped),b=p);return c&&(p=r[(l+(h?d:0))%i],u(e,b,p,h,s.stepped)),!!c}function _0(e,t,o,a){const r=t.points,{count:s,start:i,ilen:l}=kc(r,o,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,p,b,y,g;const B=C=>(i+(d?l-C:C))%s,w=()=>{b!==y&&(e.lineTo(u,y),e.lineTo(u,b),e.lineTo(u,g))};for(c&&(m=r[B(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[B(h)],m.skip)continue;const C=m.x,E=m.y,_=C|0;_===p?(E<b?b=E:E>y&&(y=E),u=(f*u+C)/++f):(w(),e.lineTo(C,E),p=_,f=0,b=y=E),g=E}w()}function Zr(e){const t=e.options,o=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?_0:B0}function E0(e){return e.stepped?_p:e.tension||e.cubicInterpolationMode==="monotone"?Ep:_n}function S0(e,t,o,a){let r=t._path;r||(r=t._path=new Path2D,t.path(r,o,a)&&r.closePath()),xc(e,t.options),e.stroke(r)}function A0(e,t,o,a){const{segments:r,options:s}=t,i=Zr(t);for(const l of r)xc(e,s,l.style),e.beginPath(),i(e,t,l,{start:o,end:o+a-1})&&e.closePath(),e.stroke()}const V0=typeof Path2D=="function";function D0(e,t,o,a){V0&&!t.options.segment?S0(e,t,o,a):A0(e,t,o,a)}class an extends Ut{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,o){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;gp(this._points,a,t,r,o),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Np(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,a=t.length;return a&&o[t[a-1].end]}interpolate(t,o){const a=this.options,r=t[o],s=this.points,i=Dl(this,{property:o,start:r,end:r});if(!i.length)return;const l=[],c=E0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],p=s[h];if(m===p){l.push(m);continue}const b=Math.abs((r-m[o])/(p[o]-m[o])),y=c(m,p,b,a.stepped);y[o]=t[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(t,o,a){return Zr(this)(t,this,o,a)}path(t,o,a){const r=this.segments,s=Zr(this);let i=this._loop;o=o||0,a=a||this.points.length-o;for(const l of r)i&=s(t,this,l,{start:o,end:o+a-1});return!!i}draw(t,o,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),D0(t,this,a,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(an,"id","line"),me(an,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(an,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(an,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function wc(e,t,o,a){const r=e.options,{[o]:s}=e.getProps([o],a);return Math.abs(t-s)<r.radius+r.hitRadius}class ba extends Ut{constructor(o){super();me(this,"parsed");me(this,"skip");me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(o-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,a){return wc(this,o,"x",a)}inYRange(o,a){return wc(this,o,"y",a)}getCenterPoint(o){const{x:a,y:r}=this.getProps(["x","y"],o);return{x:a,y:r}}size(o){o=o||this.options||{};let a=o.radius||0;a=Math.max(a,a&&o.hoverRadius||0);const r=a&&o.borderWidth||0;return(a+r)*2}draw(o,a){const r=this.options;this.skip||r.radius<.1||!go(this,a,this.size(r)/2)||(o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.fillStyle=r.backgroundColor,Or(o,r,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}me(ba,"id","point"),me(ba,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(ba,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Cc(e,t){const{x:o,y:a,base:r,width:s,height:i}=e.getProps(["x","y","base","width","height"],t);let l,c,d,u,f;return e.horizontal?(f=i/2,l=Math.min(o,r),c=Math.max(o,r),d=a-f,u=a+f):(f=s/2,l=o-f,c=o+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function rn(e,t,o,a){return e?0:nt(t,o,a)}function M0(e,t,o){const a=e.options.borderWidth,r=e.borderSkipped,s=ml(a);return{t:rn(r.top,s.top,0,o),r:rn(r.right,s.right,0,t),b:rn(r.bottom,s.bottom,0,o),l:rn(r.left,s.left,0,t)}}function N0(e,t,o){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=On(r),i=Math.min(t,o),l=e.borderSkipped,c=a||Se(r);return{topLeft:rn(!c||l.top||l.left,s.topLeft,0,i),topRight:rn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:rn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:rn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function P0(e){const t=Cc(e),o=t.right-t.left,a=t.bottom-t.top,r=M0(e,o/2,a/2),s=N0(e,o/2,a/2);return{outer:{x:t.left,y:t.top,w:o,h:a,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:o-r.l-r.r,h:a-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function es(e,t,o,a){const r=t===null,s=o===null,l=e&&!(r&&s)&&Cc(e,a);return l&&(r||Wt(t,l.left,l.right))&&(s||Wt(o,l.top,l.bottom))}function v0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function T0(e,t){e.rect(t.x,t.y,t.w,t.h)}function ts(e,t,o={}){const a=e.x!==o.x?-t:0,r=e.y!==o.y?-t:0,s=(e.x+e.w!==o.x+o.w?t:0)-a,i=(e.y+e.h!==o.y+o.h?t:0)-r;return{x:e.x+a,y:e.y+r,w:e.w+s,h:e.h+i,radius:e.radius}}class ya extends Ut{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:o,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=P0(this),l=v0(i.radius)?ea:T0;t.save(),(i.w!==s.w||i.h!==s.h)&&(t.beginPath(),l(t,ts(i,o,s)),t.clip(),l(t,ts(s,-o,i)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),l(t,ts(s,o)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,o,a){return es(this,t,o,a)}inXRange(t,o){return es(this,t,null,o)}inYRange(t,o){return es(this,null,t,o)}getCenterPoint(t){const{x:o,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(o+r)/2:o,y:s?a:(a+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}me(ya,"id","bar"),me(ya,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),me(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function O0(e,t,o){const a=e.segments,r=e.points,s=t.points,i=[];for(const l of a){let{start:c,end:d}=l;d=xa(c,d,r);const u=ns(o,r[c],r[d],l.loop);if(!t.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=Dl(t,u);for(const h of f){const m=ns(o,s[h.start],s[h.end],h.loop),p=Vl(l,r,m);for(const b of p)i.push({source:b,target:h,start:{[o]:Bc(u,m,"start",Math.max)},end:{[o]:Bc(u,m,"end",Math.min)}})}}return i}function ns(e,t,o,a){if(a)return;let r=t[e],s=o[e];return e==="angle"&&(r=ft(r),s=ft(s)),{property:e,start:r,end:s}}function z0(e,t){const{x:o=null,y:a=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:i,end:l})=>{l=xa(i,l,r);const c=r[i],d=r[l];a!==null?(s.push({x:c.x,y:a}),s.push({x:d.x,y:a})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function xa(e,t,o){for(;t>e;t--){const a=o[t];if(!isNaN(a.x)&&!isNaN(a.y))break}return t}function Bc(e,t,o,a){return e&&t?a(e[o],t[o]):e?e[o]:t?t[o]:0}function _c(e,t){let o=[],a=!1;return qe(e)?(a=!0,o=e):o=z0(e,t),o.length?new an({points:o,options:{tension:0},_loop:a,_fullLoop:a}):null}function Ec(e){return e&&e.fill!==!1}function F0(e,t,o){let r=e[t].fill;const s=[t];let i;if(!o)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!tt(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function R0(e,t,o){const a=W0(e);if(Se(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return tt(r)&&Math.floor(r)===r?I0(a[0],t,r,o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function I0(e,t,o,a){return(e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=a?!1:o}function L0(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:Se(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function $0(e,t,o){let a;return e==="start"?a=o:e==="end"?a=t.options.reverse?t.min:t.max:Se(e)?a=e.value:a=t.getBaseValue(),a}function W0(e){const t=e.options,o=t.fill;let a=Be(o&&o.target,o);return a===void 0&&(a=!!t.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function j0(e){const{scale:t,index:o,line:a}=e,r=[],s=a.segments,i=a.points,l=U0(t,o);l.push(_c({x:null,y:t.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)H0(r,i[u],l)}return new an({points:r,options:{}})}function U0(e,t){const o=[],a=e.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===t)break;s.hidden||o.unshift(s.dataset)}return o}function H0(e,t,o){const a=[];for(let r=0;r<o.length;r++){const s=o[r],{first:i,last:l,point:c}=q0(s,t,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(e.push(c),!l)break}}e.push(...a)}function q0(e,t,o){const a=e.interpolate(t,o);if(!a)return{};const r=a[o],s=e.segments,i=e.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],h=i[u.end][o];if(Wt(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Sc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,o,a){const{x:r,y:s,radius:i}=this;return o=o||{start:0,end:We},t.arc(r,s,i,o.end,o.start,!0),!a.bounds}interpolate(t){const{x:o,y:a,radius:r}=this,s=t.angle;return{x:o+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function G0(e){const{chart:t,fill:o,line:a}=e;if(tt(o))return X0(t,o);if(o==="stack")return j0(e);if(o==="shape")return!0;const r=Y0(e);return r instanceof Sc?r:_c(r,a)}function X0(e,t){const o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function Y0(e){return(e.scale||{}).getPointPositionForValue?J0(e):K0(e)}function K0(e){const{scale:t={},fill:o}=e,a=L0(o,t);if(tt(a)){const r=t.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function J0(e){const{scale:t,fill:o}=e,a=t.options,r=t.getLabels().length,s=a.reverse?t.max:t.min,i=$0(o,t,s),l=[];if(a.grid.circular){const c=t.getPointPositionForValue(0,s);return new Sc({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(t.getPointPositionForValue(c,i));return l}function os(e,t,o){const a=G0(t),{chart:r,index:s,line:i,scale:l,axis:c}=t,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},p=r.getDatasetMeta(s),b=Pl(r,p);a&&i.points.length&&(Qo(e,o),Q0(e,{line:i,target:a,above:h,below:m,area:o,scale:l,axis:c,clip:b}),Zo(e))}function Q0(e,t){const{line:o,target:a,above:r,below:s,area:i,scale:l,clip:c}=t,d=o._loop?"angle":t.axis;e.save();let u=s;s!==r&&(d==="x"?(Ac(e,a,i.top),as(e,{line:o,target:a,color:r,scale:l,property:d,clip:c}),e.restore(),e.save(),Ac(e,a,i.bottom)):d==="y"&&(Vc(e,a,i.left),as(e,{line:o,target:a,color:s,scale:l,property:d,clip:c}),e.restore(),e.save(),Vc(e,a,i.right),u=r)),as(e,{line:o,target:a,color:u,scale:l,property:d,clip:c}),e.restore()}function Ac(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,o),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(f.x,o)}e.lineTo(t.first().x,o),e.closePath(),e.clip()}function Vc(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(o,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(o,f.y)}e.lineTo(o,t.first().y),e.closePath(),e.clip()}function as(e,t){const{line:o,target:a,property:r,color:s,scale:i,clip:l}=t,c=O0(o,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,p=a!==!0;e.save(),e.fillStyle=m,Z0(e,i,l,p&&ns(r,f,h)),e.beginPath();const b=!!o.pathSegment(e,d);let y;if(p){b?e.closePath():Dc(e,a,h,r);const g=!!a.pathSegment(e,u,{move:b,reverse:!0});y=b&&g,y||Dc(e,a,f,r)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function Z0(e,t,o,a){const r=t.chart.chartArea,{property:s,start:i,end:l}=a||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=r.top,u=l,f=r.bottom):(c=r.left,d=i,u=r.right,f=l),e.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),e.rect(c,d,u-c,f-d),e.clip()}}function Dc(e,t,o,a){const r=t.interpolate(o,a);r&&e.lineTo(r.x,r.y)}var eb={id:"filler",afterDatasetsUpdate(e,t,o){const a=(e.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=e.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof an&&(c={visible:e.isDatasetVisible(i),index:i,fill:R0(l,i,a),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,r.push(c);for(i=0;i<a;++i)c=r[i],!(!c||c.fill===!1)&&(c.fill=F0(r,i,o.propagate))},beforeDraw(e,t,o){const a=o.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let i=r.length-1;i>=0;--i){const l=r[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),a&&l.fill&&os(e.ctx,l,s))}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const a=e.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Ec(s)&&os(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,o){const a=t.meta.$filler;!Ec(a)||o.drawTime!=="beforeDatasetDraw"||os(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mc=(e,t)=>{let{boxHeight:o=t,boxWidth:a=t}=e;return e.usePointStyle&&(o=Math.min(o,t),a=e.pointStyleWidth||Math.min(a,t)),{boxWidth:a,boxHeight:o,itemHeight:Math.max(t,o)}},tb=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Nc extends Ut{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,o,a){this.maxWidth=t,this.maxHeight=o,this._margins=a,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let o=Ie(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(a=>t.filter(a,this.chart.data))),t.sort&&(o=o.sort((a,r)=>t.sort(a,r,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const a=t.labels,r=at(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Mc(a,s);let d,u;o.font=r.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,r,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,o,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,b)=>{const y=a+o/2+s.measureText(p.text).width;(b===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(b>0?0:1)]=0,m+=u,h++),c[b]={left:0,top:m,row:h,width:y,height:r},d[d.length-1]+=y+l}),f}_fitCols(t,o,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-t;let f=l,h=0,m=0,p=0,b=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:B,itemHeight:w}=nb(a,o,s,y,r);g>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,b++,h=m=0),c[g]={left:p,top:m,col:b,width:B,height:w},h=Math.max(h,B),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:a,labels:{padding:r},rtl:s}}=this,i=Rn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=ot(a,this.left+r,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=ot(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=ot(a,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=ot(a,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+r,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qo(t,this),this._draw(),Zo(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:a,ctx:r}=this,{align:s,labels:i}=t,l=Ue.color,c=Rn(t.rtl,this.left,this.width),d=at(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:p,boxHeight:b,itemHeight:y}=Mc(i,f),g=function(_,k,x){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;r.save();const A=Be(x.lineWidth,1);if(r.fillStyle=Be(x.fillStyle,l),r.lineCap=Be(x.lineCap,"butt"),r.lineDashOffset=Be(x.lineDashOffset,0),r.lineJoin=Be(x.lineJoin,"miter"),r.lineWidth=A,r.strokeStyle=Be(x.strokeStyle,l),r.setLineDash(Be(x.lineDash,[])),i.usePointStyle){const D={radius:b*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:A},M=c.xPlus(_,p/2),V=k+h;hl(r,D,M,V,i.pointStyleWidth&&p)}else{const D=k+Math.max((f-b)/2,0),M=c.leftForLtr(_,p),V=On(x.borderRadius);r.beginPath(),Object.values(V).some(N=>N!==0)?ea(r,{x:M,y:D,w:p,h:b,radius:V}):r.rect(M,D,p,b),r.fill(),A!==0&&r.stroke()}r.restore()},B=function(_,k,x){bo(r,x.text,_,k+y/2,d,{strikethrough:x.hidden,textAlign:c.textAlign(x.textAlign)})},w=this.isHorizontal(),C=this._computeTitleHeight();w?m={x:ot(s,this.left+u,this.right-a[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:ot(s,this.top+C+u,this.bottom-o[0].height),line:0},_l(this.ctx,t.textDirection);const E=y+u;this.legendItems.forEach((_,k)=>{r.strokeStyle=_.fontColor,r.fillStyle=_.fontColor;const x=r.measureText(_.text).width,A=c.textAlign(_.textAlign||(_.textAlign=i.textAlign)),D=p+h+x;let M=m.x,V=m.y;c.setWidth(this.width),w?k>0&&M+D+u>this.right&&(V=m.y+=E,m.line++,M=m.x=ot(s,this.left+u,this.right-a[m.line])):k>0&&V+E>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,V=m.y=ot(s,this.top+C+u,this.bottom-o[m.line].height));const N=c.x(M);if(g(N,V,_),M=Pm(A,M+p+h,w?M+D:this.right,t.rtl),B(c.x(M),V,_),w)m.x+=D+u;else if(typeof _.text!="string"){const T=d.lineHeight;m.y+=Pc(_,T)+u}else m.y+=E}),El(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,a=at(o.font),r=gt(o.padding);if(!o.display)return;const s=Rn(t.rtl,this.left,this.width),i=this.ctx,l=o.position,c=a.size/2,d=r.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=ot(t.align,f,this.right-h);else{const p=this.columnSizes.reduce((b,y)=>Math.max(b,y.height),0);u=d+ot(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=ot(l,f,f+h);i.textAlign=s.textAlign(Dr(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=a.string,bo(i,o.text,m,u,a)}_computeTitleHeight(){const t=this.options.title,o=at(t.font),a=gt(t.padding);return t.display?o.lineHeight+a.height:0}_getLegendItemAt(t,o){let a,r,s;if(Wt(t,this.left,this.right)&&Wt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Wt(t,r.left,r.left+r.width)&&Wt(o,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(t){const o=this.options;if(!rb(t.type,o))return;const a=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=tb(r,a);r&&!s&&Ie(o.onLeave,[t,r,this],this),this._hoveredItem=a,a&&!s&&Ie(o.onHover,[t,a,this],this)}else a&&Ie(o.onClick,[t,a,this],this)}}function nb(e,t,o,a,r){const s=ob(a,e,t,o),i=ab(r,a,t.lineHeight);return{itemWidth:s,itemHeight:i}}function ob(e,t,o,a){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),t+o.size/2+a.measureText(r).width}function ab(e,t,o){let a=e;return typeof t.text!="string"&&(a=Pc(t,o)),a}function Pc(e,t){const o=e.text?e.text.length:0;return t*o}function rb(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var sb={id:"legend",_element:Nc,start(e,t,o){const a=e.legend=new Nc({ctx:e.ctx,options:o,chart:e});bt.configure(e,a,o),bt.addBox(e,a)},stop(e){bt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,o){const a=e.legend;bt.configure(e,a,o),a.options=o},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,o){const a=t.datasetIndex,r=o.chart;r.isDatasetVisible(a)?(r.hide(a),t.hidden=!0):(r.show(a),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=gt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:a||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class vc extends Ut{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,o){const a=this.options;if(this.left=0,this.top=0,!a.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const r=qe(a.text)?a.text.length:1;this._padding=gt(a.padding);const s=r*at(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=ot(l,a,s),f=o+t,d=s-a):(i.position==="left"?(u=a+t,f=ot(l,r,o),c=ve*-.5):(u=s-t,f=ot(l,o,r),c=ve*.5),d=r-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const a=at(o.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);bo(t,o.text,0,0,a,{color:o.color,maxWidth:c,rotation:d,textAlign:Dr(o.align),textBaseline:"middle",translation:[i,l]})}}function ib(e,t){const o=new vc({ctx:e.ctx,options:t,chart:e});bt.configure(e,o,t),bt.addBox(e,o),e.titleBlock=o}var lb={id:"title",_element:vc,start(e,t,o){ib(e,o)},stop(e){const t=e.titleBlock;bt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,o){const a=e.titleBlock;bt.configure(e,a,o),a.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const So={average(e){if(!e.length)return!1;let t,o,a=new Set,r=0,s=0;for(t=0,o=e.length;t<o;++t){const l=e[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();a.add(c.x),r+=c.y,++s}}return s===0||a.size===0?!1:{x:[...a].reduce((l,c)=>l+c)/a.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let o=t.x,a=t.y,r=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=e.length;s<i;++s){const c=e[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Ar(t,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}};function Pt(e,t){return t&&(qe(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function qt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
16
|
+
*/class Np{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,a,r){const s=o.listeners[r],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(a-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=sl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((a,r)=>{if(!a.running||!a.items.length)return;const s=a.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>a.duration&&(a.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,n,"progress")),s.length||(a.running=!1,this._notify(r,a,n,"complete"),a.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let a=o.get(n);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,a)),a}listen(n,o,a){this._getAnims(n).listeners[o].push(a)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const a=o.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var jt=new Np;const Ol="transparent",Pp={boolean(e,n,o){return o>.5?n:e},color(e,n,o){const a=dl(e||Ol),r=a.valid&&dl(n||Ol);return r&&r.valid?r.mix(a,o).hexString():n},number(e,n,o){return e+(n-e)*o}};class vp{constructor(n,o,a,r){const s=o[a];r=oa([n.to,r,s,n.from]);const i=oa([n.from,s,r]);this._active=!0,this._fn=n.fn||Pp[n.type||typeof i],this._easing=po[n.easing]||po.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(n,o,a){if(this._active){this._notify(!1);const r=this._target[this._prop],s=a-this._start,i=this._duration-s;this._start=a,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=oa([n.to,o,r,n.from]),this._from=oa([n.from,r,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,a=this._duration,r=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<a),!this._active){this._target[r]=l,this._notify(!0);return}if(o<0){this._target[r]=s;return}c=o/a%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,a)=>{n.push({res:o,rej:a})})}_notify(n){const o=n?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][o]()}}class zl{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Se(n))return;const o=Object.keys(Ue.animation),a=this._properties;Object.getOwnPropertyNames(n).forEach(r=>{const s=n[r];if(!Se(s))return;const i={};for(const l of o)i[l]=s[l];(Ge(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(n,o){const a=o.options,r=Op(n,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Tp(n.options.$animations,a).then(()=>{n.options=a},()=>{}),s}_createAnimations(n,o){const a=this._properties,r=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const h=a.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){n[d]=u;continue}s[d]=f=new vp(h,n,d,u),r.push(f)}return r}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const a=this._createAnimations(n,o);if(a.length)return jt.add(this._chart,a),!0}}function Tp(e,n){const o=[],a=Object.keys(n);for(let r=0;r<a.length;r++){const s=e[a[r]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Op(e,n){if(!n)return;let o=e.options;if(!o){e.options=n;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Fl(e,n){const o=e&&e.options||{},a=o.reverse,r=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:a?s:r,end:a?r:s}}function zp(e,n,o){if(o===!1)return!1;const a=Fl(e,o),r=Fl(n,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Fp(e){let n,o,a,r;return Se(e)?(n=e.top,o=e.right,a=e.bottom,r=e.left):n=o=a=r=e,{top:n,right:o,bottom:a,left:r,disabled:e===!1}}function Rl(e,n){const o=[],a=e._getSortedDatasetMetas(n);let r,s;for(r=0,s=a.length;r<s;++r)o.push(a[r].index);return o}function Il(e,n,o,a={}){const r=e.keys,s=a.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===o){if(u=!0,a.all)continue;break}d=e.values[c],tt(d)&&(s||n===0||Dt(n)===Dt(d))&&(n+=d)}return!u&&!a.all?0:n}function Rp(e,n){const{iScale:o,vScale:a}=n,r=o.axis==="x"?"x":"y",s=a.axis==="x"?"x":"y",i=Object.keys(e),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[r]:u,[s]:e[u]};return l}function Ur(e,n){const o=e&&e.options.stacked;return o||o===void 0&&n.stack!==void 0}function Ip(e,n,o){return`${e.id}.${n.id}.${o.stack||o.type}`}function Lp(e){const{min:n,max:o,minDefined:a,maxDefined:r}=e.getUserBounds();return{min:a?n:Number.NEGATIVE_INFINITY,max:r?o:Number.POSITIVE_INFINITY}}function $p(e,n,o){const a=e[n]||(e[n]={});return a[o]||(a[o]={})}function Ll(e,n,o,a){for(const r of n.getMatchingVisibleMetas(a).reverse()){const s=e[r.index];if(o&&s>0||!o&&s<0)return r.index}return null}function $l(e,n){const{chart:o,_cachedMeta:a}=e,r=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Ip(s,i,a),f=n.length;let h;for(let m=0;m<f;++m){const p=n[m],{[c]:x,[d]:y}=p,g=p._stacks||(p._stacks={});h=g[d]=$p(r,u,x),h[l]=y,h._top=Ll(h,i,!0,a.type),h._bottom=Ll(h,i,!1,a.type);const B=h._visualValues||(h._visualValues={});B[l]=y}}function Hr(e,n){const o=e.scales;return Object.keys(o).filter(a=>o[a].axis===n).shift()}function Wp(e,n){return Cn(e,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function jp(e,n,o){return Cn(e,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function xo(e,n){const o=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){n=n||e._parsed;for(const r of n){const s=r._stacks;if(!s||s[a]===void 0||s[a][o]===void 0)return;delete s[a][o],s[a]._visualValues!==void 0&&s[a]._visualValues[o]!==void 0&&delete s[a]._visualValues[o]}}}const qr=e=>e==="reset"||e==="none",Wl=(e,n)=>n?e:Object.assign({},e),Up=(e,n,o)=>e&&!n.hidden&&n._stacked&&{keys:Rl(o,!0),values:null};class Sn{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=Ur(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&xo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,a=this.getDataset(),r=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=o.xAxisID=Be(a.xAxisID,Hr(n,"x")),i=o.yAxisID=Be(a.yAxisID,Hr(n,"y")),l=o.rAxisID=Be(a.rAxisID,Hr(n,"r")),c=o.indexAxis,d=o.iAxisID=r(c,s,i,l),u=o.vAxisID=r(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&al(this._data,this),n._stacked&&xo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),a=this._data;if(Se(o)){const r=this._cachedMeta;this._data=Rp(o,r)}else if(a!==o){if(a){al(a,this);const r=this._cachedMeta;xo(r),r._parsed=[]}o&&Object.isExtensible(o)&&Sm(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=o._stacked;o._stacked=Ur(o.vScale,o),o.stack!==a.stack&&(r=!0,xo(o),o.stack=a.stack),this._resyncElements(n),(r||s!==o._stacked)&&($l(this,o._parsed),o._stacked=Ur(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),a=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=n===0&&o===r.length?!0:a._sorted,d=n>0&&a._parsed[n-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{Ge(r[n])?h=this.parseArrayData(a,r,n,o):Se(r[n])?h=this.parseObjectData(a,r,n,o):h=this.parsePrimitiveData(a,r,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)a._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&$l(this,h)}parsePrimitiveData(n,o,a,r){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+a,f[h]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};return f}parseArrayData(n,o,a,r){const{xScale:s,yScale:i}=n,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,a,r){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(r);let u,f,h,m;for(u=0,f=r;u<f;++u)h=u+a,m=o[h],d[u]={x:s.parse(bn(m,l),h),y:i.parse(bn(m,c),h)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,a){const r=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:Rl(r,!0),values:o._stacks[n.axis]._visualValues};return Il(l,i,s.index,{mode:a})}updateRangeFromParsed(n,o,a,r){const s=a[o.axis];let i=s===null?NaN:s;const l=r&&a._stacks[o.axis];r&&l&&(r.values=l,i=Il(r,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&n===a.iScale,i=r.length,l=this._getOtherScale(n),c=Up(o,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Lp(l);let h,m;function p(){m=r[h];const x=m[l.axis];return!tt(m[n.axis])||u>x||f<x}for(h=0;h<i&&!(!p()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=o.length;r<s;++r)i=o[r][n.axis],tt(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,a=o.iScale,r=o.vScale,s=this.getParsed(n);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Fp(Be(this.options.clip,zp(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,a=this._cachedMeta,r=a.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const a=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(n||0,a)}getContext(n,o,a){const r=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=jp(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=r.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Wp(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=a,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",a){const r=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&uo(a);if(l)return Wl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=r?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ue.elements[n]),p=()=>this.getContext(a,r,o),x=d.resolveNamedOptions(h,m,p,f);return x.$shared&&(x.$shared=c,s[i]=Object.freeze(Wl(x,c))),x}_resolveAnimations(n,o,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(r.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(n,a,o))}const d=new zl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||qr(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const a=this.resolveDataElementOptions(n,o),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(o,s)||s!==r;return this.updateSharedOptions(s,o,a),{sharedOptions:s,includeOptions:i}}updateElement(n,o,a,r){qr(r)?Object.assign(n,a):this._resolveAnimations(o,r).update(n,a)}updateSharedOptions(n,o,a){n&&!qr(o)&&this._resolveAnimations(void 0,o).update(n,a)}_setStyle(n,o,a,r){n.active=r;const s=this.getStyle(o,r);this._resolveAnimations(o,a,r).update(n,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,a){this._setStyle(n,a,"active",!1)}setHoverStyle(n,o,a){this._setStyle(n,a,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,a=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const r=a.length,s=o.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,n):s<r&&this._removeElements(s,r-s)}_insertElements(n,o,a=!0){const r=this._cachedMeta,s=r.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(n,o),a&&this.updateElements(s,n,o,"reset")}updateElements(n,o,a,r){}_removeElements(n,o){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(n,o);a._stacked&&xo(a,r)}a.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,a,r]=n;this[o](a,r)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const a=arguments.length-2;a&&this._sync(["_insertElements",n,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(Sn,"defaults",{}),me(Sn,"datasetElementType",null),me(Sn,"dataElementType",null);function Hp(e,n){if(!e._cache.$bar){const o=e.getMatchingVisibleMetas(n);let a=[];for(let r=0,s=o.length;r<s;r++)a=a.concat(o[r].controller.getAllParsedValues(e));e._cache.$bar=rl(a.sort((r,s)=>r-s))}return e._cache.$bar}function qp(e){const n=e.iScale,o=Hp(n,e.type);let a=n._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(uo(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=o.length;r<s;++r)i=n.getPixelForValue(o[r]),c();for(l=void 0,r=0,s=n.ticks.length;r<s;++r)i=n.getPixelForTick(r),c();return a}function Gp(e,n,o,a){const r=o.barThickness;let s,i;return Ne(r)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:n.pixels[e]-s/2}}function Xp(e,n,o,a){const r=n.pixels,s=r[e];let i=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/a,ratio:o.barPercentage,start:d}}function Yp(e,n,o,a){const r=o.parse(e[0],a),s=o.parse(e[1],a),i=Math.min(r,s),l=Math.max(r,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function jl(e,n,o,a){return Ge(e)?Yp(e,n,o,a):n[o.axis]=o.parse(e,a),n}function Ul(e,n,o,a){const r=e.iScale,s=e.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=o,u=o+a;d<u;++d)h=n[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push(jl(h,f,s,d));return c}function Gr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Kp(e,n,o){return e!==0?Dt(e):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function Jp(e){let n,o,a,r,s;return e.horizontal?(n=e.base>e.x,o="left",a="right"):(n=e.base<e.y,o="bottom",a="top"),n?(r="end",s="start"):(r="start",s="end"),{start:o,end:a,reverse:n,top:r,bottom:s}}function Qp(e,n,o,a){let r=n.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Jp(e);r==="middle"&&o&&(e.enableBorderRadius=!0,(o._top||0)===a?r=d:(o._bottom||0)===a?r=u:(s[Hl(u,i,l,c)]=!0,r=d)),s[Hl(r,i,l,c)]=!0,e.borderSkipped=s}function Hl(e,n,o,a){return a?(e=Zp(e,n,o),e=ql(e,o,n)):e=ql(e,n,o),e}function Zp(e,n,o){return e===n?o:e===o?n:e}function ql(e,n,o){return e==="start"?n:e==="end"?o:e}function eg(e,{inflateAmount:n},o){e.inflateAmount=n==="auto"?o===1?.33:0:n}class la extends Sn{parsePrimitiveData(n,o,a,r){return Ul(n,o,a,r)}parseArrayData(n,o,a,r){return Ul(n,o,a,r)}parseObjectData(n,o,a,r){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,p,x;for(h=a,m=a+r;h<m;++h)x=o[h],p={},p[s.axis]=s.parse(bn(x,d),h),f.push(jl(bn(x,u),p,i,h));return f}updateRangeFromParsed(n,o,a,r){super.updateRangeFromParsed(n,o,a,r);const s=a._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:a,vScale:r}=o,s=this.getParsed(n),i=s._custom,l=Gr(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+a.getLabelForValue(s[a.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,a,r){const s=r==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,r);for(let m=o;m<o+a;m++){const p=this.getParsed(m),x=s||Ne(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),g=(p._stacks||{})[l.axis],B={horizontal:d,base:x.base,enableBorderRadius:!g||Gr(p._custom)||i===g._top||i===g._bottom,x:d?x.head:y.center,y:d?y.center:x.head,height:d?y.size:Math.abs(x.size),width:d?Math.abs(x.size):y.size};h&&(B.options=f||this.resolveDataElementOptions(m,n[m].active?"active":r));const k=B.options||n[m].options;Qp(B,k,g,i),eg(B,k,u.ratio),this.updateElement(n[m],m,B,r)}}_getStacks(n,o){const{iScale:a}=this._cachedMeta,r=a.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=a.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(Ne(h)||isNaN(h))return!0};for(const u of r)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(a=>n[a].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)n[Be(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,a){const r=this._getStacks(n,a),s=o!==void 0?r.indexOf(o):-1;return s===-1?r.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,a=o.iScale,r=[];let s,i;for(s=0,i=o.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=n.barThickness;return{min:l||qp(o),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=Gr(d);let f=c[o.axis],h=0,m=a?this.applyStack(o,c,a):f,p,x;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Dt(f)!==Dt(d.barEnd)&&(h=0),h+=f);const y=!Ne(s)&&!u?s:h;let g=o.getPixelForValue(y);if(this.chart.getDataVisibility(n)?p=o.getPixelForValue(h+m):p=g,x=p-g,Math.abs(x)<i){x=Kp(x,o,l)*i,f===l&&(g-=x/2);const B=o.getPixelForDecimal(0),k=o.getPixelForDecimal(1),C=Math.min(B,k),E=Math.max(B,k);g=Math.max(Math.min(g,E),C),p=g+x,a&&!u&&(c._stacks[o.axis]._visualValues[r]=o.getValueForPixel(p)-o.getValueForPixel(g))}if(g===o.getPixelForValue(l)){const B=Dt(x)*o.getLineWidthForValue(l)/2;g+=B,x-=B}return{size:x,base:g,head:p,center:p+x/2}}_calculateBarIndexPixels(n,o){const a=o.scale,r=this.options,s=r.skipNull,i=Be(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=r.barThickness==="flex"?Xp(n,o,r,u*d):Gp(n,o,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Be(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(n)[a.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,a=n.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[o.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}me(la,"id","bar"),me(la,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),me(la,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function tg(e,n,o){let a=1,r=1,s=0,i=0;if(n<We){const l=e,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(k,C,E)=>mo(k,l,c,!0)?1:Math.max(C,C*o,E,E*o),p=(k,C,E)=>mo(k,l,c,!0)?-1:Math.min(C,C*o,E,E*o),x=m(0,d,f),y=m(Ke,u,h),g=p(ve,d,f),B=p(ve+Ke,u,h);a=(x-g)/2,r=(y-B)/2,s=-(x+g)/2,i=-(y+B)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class Ln extends Sn{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(Se(a[n])){const{key:c="value"}=this._parsing;s=d=>+bn(a[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let n=We,o=-We;for(let a=0;a<this.chart.data.datasets.length;++a)if(this.chart.isDatasetVisible(a)&&this.chart.getDatasetMeta(a).type===this._type){const r=this.chart.getDatasetMeta(a).controller,s=r._getRotation(),i=r._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:a}=o,r=this._cachedMeta,s=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(a.width,a.height)-i)/2,0),c=Math.min(cm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:x}=tg(f,u,c),y=(a.width-i)/h,g=(a.height-i)/m,B=Math.max(Math.min(y,g)/2,0),k=Xi(this.options.radius,B),C=Math.max(k*c,0),E=(k-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=x*k,r.total=this.calculateTotal(),this.outerRadius=k-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return o&&a.animation.animateRotate||!this.chart.getDataVisibility(n)||r._parsed[n]===null||r.data[n].hidden?0:this.calculateCircumference(r._parsed[n]*s/We)}updateElements(n,o,a,r){const s=r==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:x,includeOptions:y}=this._getSharedOptions(o,r);let g=this._getRotation(),B;for(B=0;B<o;++B)g+=this._circumference(B,s);for(B=o;B<o+a;++B){const k=this._circumference(B,s),C=n[B],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+k,circumference:k,outerRadius:p,innerRadius:m};y&&(E.options=x||this.resolveDataElementOptions(B,C.active?"active":r)),g+=k,this.updateElement(C,B,E,r)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let a=0,r;for(r=0;r<o.length;r++){const s=n._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!o[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?We*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=Tr(o._parsed[n],a.options.locale);return{label:r[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const a=this.chart;let r,s,i,l,c;if(!n){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),n=i.data,l=i.controller;break}}if(!n)return 0;for(r=0,s=n.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let a=0,r=n.length;a<r;++a){const s=this.resolveDataElementOptions(a);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let a=0;a<n;++a)this.chart.isDatasetVisible(a)&&(o+=this._getRingWeight(a));return o}_getRingWeight(n){return Math.max(Be(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}me(Ln,"id","doughnut"),me(Ln,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),me(Ln,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),me(Ln,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:r,pointStyle:a,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,a){a.chart.toggleDataVisibility(o.index),a.chart.update()}}}});class ca extends Sn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Dm(o,r,i);this._drawStart=l,this._drawCount=c,Mm(o)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},n),this.updateElements(r,l,c,n)}updateElements(n,o,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,r),h=i.axis,m=l.axis,{spanGaps:p,segment:x}=this.options,y=ho(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||s||r==="none",B=o+a,k=n.length;let C=o>0&&this.getParsed(o-1);for(let E=0;E<k;++E){const _=n[E],w=g?_:{};if(E<o||E>=B){w.skip=!0;continue}const b=this.getParsed(E),A=Ne(b[m]),D=w[h]=i.getPixelForValue(b[h],E),M=w[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],E);w.skip=isNaN(D)||isNaN(M)||A,w.stop=E>0&&Math.abs(b[h]-C[h])>y,x&&(w.parsed=b,w.raw=d.data[E]),f&&(w.options=u||this.resolveDataElementOptions(E,_.active?"active":r)),g||this.updateElement(_,E,w,r),C=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,a=o.options&&o.options.borderWidth||0,r=n.data||[];if(!r.length)return a;const s=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(a,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}me(ca,"id","line"),me(ca,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(ca,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Xr extends Ln{}me(Xr,"id","pie"),me(Xr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Yr{constructor(n){me(this,"options");this.options=n||{}}static override(n){Object.assign(Yr.prototype,n)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var ng={_date:Yr};function og(e,n,o,a){const{controller:r,data:s,_sorted:i}=e,l=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?_m:xn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const h=d(s,n,o-f),m=d(s,n,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=e,m=h.slice(0,u.lo+1).reverse().findIndex(x=>!Ne(x[f.axis]));u.lo-=Math.max(0,m);const p=h.slice(u.hi).findIndex(x=>!Ne(x[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function da(e,n,o,a,r){const s=e.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=og(s[l],n,i,r);for(let m=f;m<=h;++m){const p=u[m];p.skip||a(p,d,m)}}}function ag(e){const n=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(a,r){const s=n?Math.abs(a.x-r.x):0,i=o?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Kr(e,n,o,a,r){const s=[];return!r&&!e.isPointInArea(n)||da(e,o,n,function(l,c,d){!r&&!bo(l,e.chartArea,0)||l.inRange(n.x,n.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function rg(e,n,o,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=nl(i,{x:n.x,y:n.y});mo(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return da(e,o,n,s),r}function sg(e,n,o,a,r,s){let i=[];const l=ag(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,r);if(a&&!m)return;const p=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(p))&&!m)return;const y=l(n,p);y<c?(i=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:h})}return da(e,o,n,d),i}function Jr(e,n,o,a,r,s){return!s&&!e.isPointInArea(n)?[]:o==="r"&&!a?rg(e,n,o,r):sg(e,n,o,a,r,s)}function Gl(e,n,o,a,r){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return da(e,o,n,(c,d,u)=>{c[i]&&c[i](n[o],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,r))}),a&&!l?[]:s}var ig={modes:{index(e,n,o,a){const r=_n(n,e),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Kr(e,r,s,a,i):Jr(e,r,s,!1,a,i),c=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(e,n,o,a){const r=_n(n,e),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Kr(e,r,s,a,i):Jr(e,r,s,!1,a,i);if(l.length>0){const c=l[0].datasetIndex,d=e.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(e,n,o,a){const r=_n(n,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Kr(e,r,s,a,i)},nearest(e,n,o,a){const r=_n(n,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Jr(e,r,s,o.intersect,a,i)},x(e,n,o,a){const r=_n(n,e);return Gl(e,r,"x",o.intersect,a)},y(e,n,o,a){const r=_n(n,e);return Gl(e,r,"y",o.intersect,a)}}};const Xl=["left","top","right","bottom"];function ko(e,n){return e.filter(o=>o.pos===n)}function Yl(e,n){return e.filter(o=>Xl.indexOf(o.pos)===-1&&o.box.axis===n)}function wo(e,n){return e.sort((o,a)=>{const r=n?a:o,s=n?o:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function lg(e){const n=[];let o,a,r,s,i,l;for(o=0,a=(e||[]).length;o<a;++o)r=e[o],{position:s,options:{stack:i,stackWeight:l=1}}=r,n.push({index:o,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return n}function cg(e){const n={};for(const o of e){const{stack:a,pos:r,stackWeight:s}=o;if(!a||!Xl.includes(r))continue;const i=n[a]||(n[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function dg(e,n){const o=cg(e),{vBoxMaxWidth:a,hBoxMaxHeight:r}=n;let s,i,l;for(s=0,i=e.length;s<i;++s){l=e[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&n.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&n.availableHeight)}return o}function ug(e){const n=lg(e),o=wo(n.filter(d=>d.box.fullSize),!0),a=wo(ko(n,"left"),!0),r=wo(ko(n,"right")),s=wo(ko(n,"top"),!0),i=wo(ko(n,"bottom")),l=Yl(n,"x"),c=Yl(n,"y");return{fullSize:o,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:ko(n,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function Kl(e,n,o,a){return Math.max(e[o],n[o])+Math.max(e[a],n[a])}function Jl(e,n){e.top=Math.max(e.top,n.top),e.left=Math.max(e.left,n.left),e.bottom=Math.max(e.bottom,n.bottom),e.right=Math.max(e.right,n.right)}function fg(e,n,o,a){const{pos:r,box:s}=o,i=e.maxPadding;if(!Se(r)){o.size&&(e[r]-=o.size);const f=a[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,e[r]+=o.size}s.getPadding&&Jl(i,s.getPadding());const l=Math.max(0,n.outerWidth-Kl(i,e,"left","right")),c=Math.max(0,n.outerHeight-Kl(i,e,"top","bottom")),d=l!==e.w,u=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function hg(e){const n=e.maxPadding;function o(a){const r=Math.max(n[a]-e[a],0);return e[a]+=r,r}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function mg(e,n){const o=n.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return a(e?["left","right"]:["top","bottom"])}function Co(e,n,o,a){const r=[];let s,i,l,c,d,u;for(s=0,i=e.length,d=0;s<i;++s){l=e[s],c=l.box,c.update(l.width||n.w,l.height||n.h,mg(l.horizontal,n));const{same:f,other:h}=fg(n,o,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&Co(r,n,o,a)||u}function ua(e,n,o,a,r){e.top=o,e.left=n,e.right=n+a,e.bottom=o+r,e.width=a,e.height=r}function Ql(e,n,o,a){const r=o.padding;let{x:s,y:i}=n;for(const l of e){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,h=d.size||c.height;uo(d.start)&&(i=d.start),c.fullSize?ua(c,r.left,i,o.outerWidth-r.right-r.left,h):ua(c,n.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,h=d.size||c.width;uo(d.start)&&(s=d.start),c.fullSize?ua(c,s,r.top,h,o.outerHeight-r.bottom-r.top):ua(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var yt={addBox(e,n){e.boxes||(e.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},e.boxes.push(n)},removeBox(e,n){const o=e.boxes?e.boxes.indexOf(n):-1;o!==-1&&e.boxes.splice(o,1)},configure(e,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(e,n,o,a){if(!e)return;const r=bt(e.options.layout.padding),s=Math.max(n-r.width,0),i=Math.max(o-r.height,0),l=ug(e.boxes),c=l.vertical,d=l.horizontal;Pe(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=c.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);Jl(h,bt(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),p=dg(c.concat(d),f);Co(l.fullSize,m,f,p),Co(c,m,f,p),Co(d,m,f,p)&&Co(c,m,f,p),hg(m),Ql(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Ql(l.rightAndBottom,m,f,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Pe(l.chartArea,x=>{const y=x.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Zl{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,a){}removeEventListener(n,o,a){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,a,r){return o=Math.max(0,o||n.width),a=a||n.height,{width:o,height:Math.max(0,r?Math.floor(o/r):a)}}isAttached(n){return!0}updateConfig(n){}}class pg extends Zl{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const fa="$chartjs",gg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ec=e=>e===null||e==="";function bg(e,n){const o=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e[fa]={initial:{height:a,width:r,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",ec(r)){const s=El(e,"width");s!==void 0&&(e.width=s)}if(ec(a))if(e.style.height==="")e.height=e.width/(n||2);else{const s=El(e,"height");s!==void 0&&(e.height=s)}return e}const tc=xp?{passive:!0}:!1;function yg(e,n,o){e&&e.addEventListener(n,o,tc)}function xg(e,n,o){e&&e.canvas&&e.canvas.removeEventListener(n,o,tc)}function kg(e,n){const o=gg[e.type]||e.type,{x:a,y:r}=_n(e,n);return{type:o,chart:n,native:e,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ha(e,n){for(const o of e)if(o===n||o.contains(n))return!0}function wg(e,n,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ha(l.addedNodes,a),i=i&&!ha(l.removedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}function Cg(e,n,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ha(l.removedNodes,a),i=i&&!ha(l.addedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}const Bo=new Map;let nc=0;function oc(){const e=window.devicePixelRatio;e!==nc&&(nc=e,Bo.forEach((n,o)=>{o.currentDevicePixelRatio!==e&&n()}))}function Bg(e,n){Bo.size||window.addEventListener("resize",oc),Bo.set(e,n)}function _g(e){Bo.delete(e),Bo.size||window.removeEventListener("resize",oc)}function Eg(e,n,o){const a=e.canvas,r=a&&jr(a);if(!r)return;const s=il((l,c)=>{const d=r.clientWidth;o(l,c),d<r.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(r),Bg(e,s),i}function Qr(e,n,o){o&&o.disconnect(),n==="resize"&&_g(e)}function Sg(e,n,o){const a=e.canvas,r=il(s=>{e.ctx!==null&&o(kg(s,e))},e);return yg(a,n,r),r}class Ag extends Zl{acquireContext(n,o){const a=n&&n.getContext&&n.getContext("2d");return a&&a.canvas===n?(bg(n,o),a):null}releaseContext(n){const o=n.canvas;if(!o[fa])return!1;const a=o[fa].initial;["height","width"].forEach(s=>{const i=a[s];Ne(i)?o.removeAttribute(s):o.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{o.style[s]=r[s]}),o.width=o.width,delete o[fa],!0}addEventListener(n,o,a){this.removeEventListener(n,o);const r=n.$proxies||(n.$proxies={}),i={attach:wg,detach:Cg,resize:Eg}[o]||Sg;r[o]=i(n,o,a)}removeEventListener(n,o){const a=n.$proxies||(n.$proxies={}),r=a[o];if(!r)return;({attach:Qr,detach:Qr,resize:Qr}[o]||xg)(n,o,r),a[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,a,r){return yp(n,o,a,r)}isAttached(n){const o=n&&jr(n);return!!(o&&o.isConnected)}}function Vg(e){return!Wr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?pg:Ag}let Ut=(qa=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(n){const{x:o,y:a}=this.getProps(["x","y"],n);return{x:o,y:a}}hasValue(){return ho(this.x)&&ho(this.y)}getProps(n,o){const a=this.$animations;if(!o||!a)return this;const r={};return n.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},me(qa,"defaults",{}),me(qa,"defaultRoutes"),qa);function Dg(e,n){const o=e.options.ticks,a=Mg(e),r=Math.min(o.maxTicksLimit||a,a),s=o.major.enabled?Pg(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return vg(n,d,s,i/r),d;const u=Ng(s,n,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(ma(n,d,u,Ne(m)?0:l-m,l),f=0,h=i-1;f<h;f++)ma(n,d,u,s[f],s[f+1]);return ma(n,d,u,c,Ne(m)?n.length:c+m),d}return ma(n,d,u),d}function Mg(e){const n=e.options.offset,o=e._tickSize(),a=e._length/o+(n?0:1),r=e._maxLength/o;return Math.floor(Math.min(a,r))}function Ng(e,n,o){const a=Tg(e),r=n.length/o;if(!a)return Math.max(r,1);const s=bm(a);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>r)return c}return Math.max(r,1)}function Pg(e){const n=[];let o,a;for(o=0,a=e.length;o<a;o++)e[o].major&&n.push(o);return n}function vg(e,n,o,a){let r=0,s=o[0],i;for(a=Math.ceil(a),i=0;i<e.length;i++)i===s&&(n.push(e[i]),r++,s=o[r*a])}function ma(e,n,o,a,r){const s=Be(a,0),i=Math.min(Be(r,e.length),e.length);let l=0,c,d,u;for(o=Math.ceil(o),r&&(c=r-a,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(e[d]),l++,u=Math.round(s+l*o))}function Tg(e){const n=e.length;let o,a;if(n<2)return!1;for(a=e[0],o=1;o<n;++o)if(e[o]-e[o-1]!==a)return!1;return a}const Og=e=>e==="left"?"right":e==="right"?"left":e,ac=(e,n,o)=>n==="top"||n==="left"?e[n]+o:e[n]-o,rc=(e,n)=>Math.min(n||e,e);function sc(e,n){const o=[],a=e.length/n,r=e.length;let s=0;for(;s<r;s+=a)o.push(e[Math.floor(s)]);return o}function zg(e,n,o){const a=e.ticks.length,r=Math.min(n,a-1),s=e._startPixel,i=e._endPixel,l=1e-6;let c=e.getPixelForTick(r),d;if(!(o&&(a===1?d=Math.max(c-s,i-c):n===0?d=(e.getPixelForTick(1)-c)/2:d=(c-e.getPixelForTick(r-1))/2,c+=r<n?d:-d,c<s-l||c>i+l)))return c}function Fg(e,n){Pe(e,o=>{const a=o.gc,r=a.length/2;let s;if(r>n){for(s=0;s<r;++s)delete o.data[a[s]];a.splice(0,r)}})}function _o(e){return e.drawTicks?e.tickLength:0}function ic(e,n){if(!e.display)return 0;const o=at(e.font,n),a=bt(e.padding);return(Ge(e.text)?e.text.length:1)*o.lineHeight+a.height}function Rg(e,n){return Cn(e,{scale:n,type:"scale"})}function Ig(e,n,o){return Cn(e,{tick:o,index:n,type:"tick"})}function Lg(e,n,o){let a=Nr(e);return(o&&n!=="right"||!o&&n==="right")&&(a=Og(a)),a}function $g(e,n,o,a){const{top:r,left:s,bottom:i,right:l,chart:c}=e,{chartArea:d,scales:u}=c;let f=0,h,m,p;const x=i-r,y=l-s;if(e.isHorizontal()){if(m=ot(a,s,l),Se(o)){const g=Object.keys(o)[0],B=o[g];p=u[g].getPixelForValue(B)+x-n}else o==="center"?p=(d.bottom+d.top)/2+x-n:p=ac(e,o,n);h=l-s}else{if(Se(o)){const g=Object.keys(o)[0],B=o[g];m=u[g].getPixelForValue(B)-y+n}else o==="center"?m=(d.left+d.right)/2-y+n:m=ac(e,o,n);p=ot(a,i,r),f=o==="left"?-Ke:Ke}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class $n extends Ut{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:a,_suggestedMax:r}=this;return n=Vt(n,Number.POSITIVE_INFINITY),o=Vt(o,Number.NEGATIVE_INFINITY),a=Vt(a,Number.POSITIVE_INFINITY),r=Vt(r,Number.NEGATIVE_INFINITY),{min:Vt(n,a),max:Vt(o,r),minDefined:tt(n),maxDefined:tt(o)}}getMinMax(n){let{min:o,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:o,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),r||(o=Math.min(o,i.min)),s||(a=Math.max(a,i.max));return o=s&&o>a?a:o,a=r&&o>a?o:a,{min:Vt(o,Vt(a,o)),max:Vt(a,Vt(o,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ie(this.options.beforeUpdate,[this])}update(n,o,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=a=Object.assign({left:0,right:0,top:0,bottom:0},a),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+a.left+a.right:this.height+a.top+a.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Km(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?sc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=Dg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,a;this.isHorizontal()?(o=this.left,a=this.right):(o=this.top,a=this.bottom,n=!n),this._startPixel=o,this._endPixel=a,this._reversePixels=n,this._length=a-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ie(this.options.afterUpdate,[this])}beforeSetDimensions(){Ie(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ie(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),Ie(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ie(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let a,r,s;for(a=0,r=n.length;a<r;a++)s=n[a],s.label=Ie(o.callback,[s.value,a,n],this)}afterTickToLabelConversion(){Ie(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ie(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,a=rc(this.ticks.length,n.ticks.maxTicksLimit),r=o.minRotation||0,s=o.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!o.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=nt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(n.offset?.5:1)),c=this.maxHeight-_o(n.grid)-o.padding-ic(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=wm(Math.min(Math.asin(nt((u.highest.height+6)/l,-1,1)),Math.asin(nt(c/d,-1,1))-Math.asin(nt(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Ie(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ie(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=ic(r,o.options.font);if(l?(n.width=this.maxWidth,n.height=_o(s)+c):(n.height=this.maxHeight,n.width=_o(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,p=$t(this.labelRotation),x=Math.cos(p),y=Math.sin(p);if(l){const g=a.mirror?0:y*f.width+x*h.height;n.height=Math.min(this.maxHeight,n.height+g+m)}else{const g=a.mirror?0:x*f.width+y*h.height;n.width=Math.min(this.maxWidth,n.width+g+m)}this._calculatePadding(d,u,y,x)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,a,r){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=r*n.width,m=a*o.height):(h=a*n.height,m=r*o.width):s==="start"?m=o.width:s==="end"?h=n.width:s!=="inner"&&(h=n.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ie(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,a;for(o=0,a=n.length;o<a;o++)Ne(n[o].label)&&(n.splice(o,1),a--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let a=this.ticks;o<a.length&&(a=sc(a,o)),this._labelSizes=n=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/rc(o,a));let d=0,u=0,f,h,m,p,x,y,g,B,k,C,E;for(f=0;f<o;f+=c){if(p=n[f].label,x=this._resolveTickFontOptions(f),r.font=y=x.string,g=s[y]=s[y]||{data:{},gc:[]},B=x.lineHeight,k=C=0,!Ne(p)&&!Ge(p))k=hl(r,g.data,g.gc,k,p),C=B;else if(Ge(p))for(h=0,m=p.length;h<m;++h)E=p[h],!Ne(E)&&!Ge(E)&&(k=hl(r,g.data,g.gc,k,E),C+=B);i.push(k),l.push(C),d=Math.max(k,d),u=Math.max(C,u)}Fg(s,o);const _=i.indexOf(d),w=l.indexOf(u),b=A=>({width:i[A]||0,height:l[A]||0});return{first:b(0),last:b(o-1),widest:b(_),highest:b(w),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return Bm(this._alignToPixels?wn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const a=o[n];return a.$context||(a.$context=Ig(this.getContext(),n,a))}return this.$context||(this.$context=Rg(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=$t(this.labelRotation),a=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*a>l*r?l/a:c/r:c*r<l*a?c/a:l/r}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,a=this.chart,r=this.options,{grid:s,position:i,border:l}=r,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=_o(s),m=[],p=l.setContext(this.getContext()),x=p.display?p.width:0,y=x/2,g=function(R){return wn(a,R,x)};let B,k,C,E,_,w,b,A,D,M,V,N;if(i==="top")B=g(this.bottom),w=this.bottom-h,A=B-y,M=g(n.top)+y,N=n.bottom;else if(i==="bottom")B=g(this.top),M=n.top,N=g(n.bottom)-y,w=B+y,A=this.top+h;else if(i==="left")B=g(this.right),_=this.right-h,b=B-y,D=g(n.left)+y,V=n.right;else if(i==="right")B=g(this.left),D=n.left,V=g(n.right)-y,_=B+y,b=this.left+h;else if(o==="x"){if(i==="center")B=g((n.top+n.bottom)/2+.5);else if(Se(i)){const R=Object.keys(i)[0],I=i[R];B=g(this.chart.scales[R].getPixelForValue(I))}M=n.top,N=n.bottom,w=B+y,A=w+h}else if(o==="y"){if(i==="center")B=g((n.left+n.right)/2);else if(Se(i)){const R=Object.keys(i)[0],I=i[R];B=g(this.chart.scales[R].getPixelForValue(I))}_=B-y,b=_-h,D=n.left,V=n.right}const T=Be(r.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/T));for(k=0;k<f;k+=K){const R=this.getContext(k),I=s.setContext(R),q=l.setContext(R),ne=I.lineWidth,W=I.color,U=q.dash||[],ee=q.dashOffset,v=I.tickWidth,O=I.tickColor,$=I.tickBorderDash||[],X=I.tickBorderDashOffset;C=zg(this,k,c),C!==void 0&&(E=wn(a,C,ne),d?_=b=D=V=E:w=A=M=N=E,m.push({tx1:_,ty1:w,tx2:b,ty2:A,x1:D,y1:M,x2:V,y2:N,width:ne,color:W,borderDash:U,borderDashOffset:ee,tickWidth:v,tickColor:O,tickBorderDash:$,tickBorderDashOffset:X}))}return this._ticksLength=f,this._borderValue=B,m}_computeLabelItems(n){const o=this.axis,a=this.options,{position:r,ticks:s}=a,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=_o(a.grid),m=h+u,p=f?-u:m,x=-$t(this.labelRotation),y=[];let g,B,k,C,E,_,w,b,A,D,M,V,N="middle";if(r==="top")_=this.bottom-p,w=this._getXAxisLabelAlignment();else if(r==="bottom")_=this.top+p,w=this._getXAxisLabelAlignment();else if(r==="left"){const K=this._getYAxisLabelAlignment(h);w=K.textAlign,E=K.x}else if(r==="right"){const K=this._getYAxisLabelAlignment(h);w=K.textAlign,E=K.x}else if(o==="x"){if(r==="center")_=(n.top+n.bottom)/2+m;else if(Se(r)){const K=Object.keys(r)[0],R=r[K];_=this.chart.scales[K].getPixelForValue(R)+m}w=this._getXAxisLabelAlignment()}else if(o==="y"){if(r==="center")E=(n.left+n.right)/2-m;else if(Se(r)){const K=Object.keys(r)[0],R=r[K];E=this.chart.scales[K].getPixelForValue(R)}w=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?N="top":c==="end"&&(N="bottom"));const T=this._getLabelSizes();for(g=0,B=l.length;g<B;++g){k=l[g],C=k.label;const K=s.setContext(this.getContext(g));b=this.getPixelForTick(g)+s.labelOffset,A=this._resolveTickFontOptions(g),D=A.lineHeight,M=Ge(C)?C.length:1;const R=M/2,I=K.color,q=K.textStrokeColor,ne=K.textStrokeWidth;let W=w;i?(E=b,w==="inner"&&(g===B-1?W=this.options.reverse?"left":"right":g===0?W=this.options.reverse?"right":"left":W="center"),r==="top"?d==="near"||x!==0?V=-M*D+D/2:d==="center"?V=-T.highest.height/2-R*D+D:V=-T.highest.height+D/2:d==="near"||x!==0?V=D/2:d==="center"?V=T.highest.height/2-R*D:V=T.highest.height-M*D,f&&(V*=-1),x!==0&&!K.showLabelBackdrop&&(E+=D/2*Math.sin(x))):(_=b,V=(1-M)*D/2);let U;if(K.showLabelBackdrop){const ee=bt(K.backdropPadding),v=T.heights[g],O=T.widths[g];let $=V-ee.top,X=0-ee.left;switch(N){case"middle":$-=v/2;break;case"bottom":$-=v;break}switch(w){case"center":X-=O/2;break;case"right":X-=O;break;case"inner":g===B-1?X-=O:g>0&&(X-=O/2);break}U={left:X,top:$,width:O+ee.width,height:v+ee.height,color:K.backdropColor}}y.push({label:C,font:A,textOffset:V,options:{rotation:x,color:I,strokeColor:q,strokeWidth:ne,textAlign:W,textBaseline:N,translation:[E,_],backdrop:U}})}return y}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-$t(this.labelRotation))return n==="top"?"left":"right";let r="center";return o.align==="start"?r="left":o.align==="end"?r="right":o.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?r?(u=this.right+s,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?r?(u=this.left+s,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:a,top:r,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(a,r,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const r=this.ticks.findIndex(s=>s.value===n);return r>=0?o.setContext(this.getContext(r)).lineWidth:0}drawGrid(n){const o=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(a.save(),a.lineWidth=u.width,a.strokeStyle=u.color,a.setLineDash(u.borderDash||[]),a.lineDashOffset=u.borderDashOffset,a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(d.x,d.y),a.stroke(),a.restore())};if(o.display)for(s=0,i=r.length;s<i;++s){const c=r[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:a,grid:r}}=this,s=a.setContext(this.getContext()),i=a.display?s.width:0;if(!i)return;const l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=wn(n,this.left,i)-i/2,u=wn(n,this.right,l)+l/2,f=h=c):(f=wn(n,this.top,i)-i/2,h=wn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,h),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&ea(a,r);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;yo(a,d,0,u,c,l)}r&&ta(a)}drawTitle(){const{ctx:n,options:{position:o,title:a,reverse:r}}=this;if(!a.display)return;const s=at(a.font),i=bt(a.padding),l=a.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Se(o)?(c+=i.bottom,Ge(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=$g(this,c,o,l);yo(n,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:Lg(l,o,r),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,a=Be(n.grid&&n.grid.z,-1),r=Be(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==$n.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[a]===this.id&&(!n||l.type===n)&&r.push(l)}return r}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return at(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class pa{constructor(n,o,a){this.type=n,this.scope=o,this.override=a,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let a;Ug(o)&&(a=this.register(o));const r=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in r||(r[s]=n,Wg(n,i,a),this.override&&Ue.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,a=n.id,r=this.scope;a in o&&delete o[a],r&&a in Ue[r]&&(delete Ue[r][a],this.override&&delete kn[a])}}function Wg(e,n,o){const a=lo(Object.create(null),[o?Ue.get(o):{},Ue.get(n),e.defaults]);Ue.set(n,a),e.defaultRoutes&&jg(n,e.defaultRoutes),e.descriptors&&Ue.describe(n,e.descriptors)}function jg(e,n){Object.keys(n).forEach(o=>{const a=o.split("."),r=a.pop(),s=[e].concat(a).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");Ue.route(s,r,c,l)})}function Ug(e){return"id"in e&&"defaults"in e}class Hg{constructor(){this.controllers=new pa(Sn,"datasets",!0),this.elements=new pa(Ut,"elements"),this.plugins=new pa(Object,"plugins"),this.scales=new pa($n,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,a){[...o].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(n,s,r):Pe(r,i=>{const l=a||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,a){const r=Vr(n);Ie(a["before"+r],[],a),o[n](a),Ie(a["after"+r],[],a)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const a=this._typedRegistries[o];if(a.isForType(n))return a}return this.plugins}_get(n,o,a){const r=o.get(n);if(r===void 0)throw new Error('"'+n+'" is not a registered '+a+".");return r}}var Mt=new Hg;class qg{constructor(){this._init=void 0}notify(n,o,a,r){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=r?this._descriptors(n).filter(r):this._descriptors(n),i=this._notify(s,n,o,a);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,a,r){r=r||{};for(const s of n){const i=s.plugin,l=i[a],c=[o,r,s.options];if(Ie(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){Ne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const a=n&&n.config,r=Be(a.options&&a.options.plugins,{}),s=Gg(a);return r===!1&&!o?[]:Yg(n,s,r,o)}_notifyStateChanges(n){const o=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(o,a),n,"stop"),this._notify(r(a,o),n,"start")}}function Gg(e){const n={},o=[],a=Object.keys(Mt.plugins.items);for(let s=0;s<a.length;s++)o.push(Mt.getPlugin(a[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function Xg(e,n){return!n&&e===!1?null:e===!0?{}:e}function Yg(e,{plugins:n,localIds:o},a,r){const s=[],i=e.getContext();for(const l of n){const c=l.id,d=Xg(a[c],r);d!==null&&s.push({plugin:l,options:Kg(e.config,{plugin:l,local:o[c]},d,i)})}return s}function Kg(e,{plugin:n,local:o},a,r){const s=e.pluginScopeKeys(n),i=e.getOptionScopes(a,s);return o&&n.defaults&&i.push(n.defaults),e.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zr(e,n){const o=Ue.datasets[e]||{};return((n.datasets||{})[e]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function Jg(e,n){let o=e;return e==="_index_"?o=n:e==="_value_"&&(o=n==="x"?"y":"x"),o}function Qg(e,n){return e===n?"_index_":"_value_"}function lc(e){if(e==="x"||e==="y"||e==="r")return e}function Zg(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function es(e,...n){if(lc(e))return e;for(const o of n){const a=o.axis||Zg(o.position)||e.length>1&&lc(e[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function cc(e,n,o){if(o[n+"AxisID"]===e)return{axis:n}}function e0(e,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(a=>a.xAxisID===e||a.yAxisID===e);if(o.length)return cc(e,"x",o[0])||cc(e,"y",o[0])}return{}}function t0(e,n){const o=kn[e.type]||{scales:{}},a=n.scales||{},r=Zr(e.type,n),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!Se(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=es(i,l,e0(i,e),Ue.scales[l.type]),d=Qg(c,r),u=o.scales||{};s[i]=co(Object.create(null),[{axis:c},l,u[c],u[d]])}),e.data.datasets.forEach(i=>{const l=i.type||e.type,c=i.indexAxis||Zr(l,n),u=(kn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Jg(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),co(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];co(l,[Ue.scales[l.type],Ue.scale])}),s}function dc(e){const n=e.options||(e.options={});n.plugins=Be(n.plugins,{}),n.scales=t0(e,n)}function uc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function n0(e){return e=e||{},e.data=uc(e.data),dc(e),e}const fc=new Map,hc=new Set;function ga(e,n){let o=fc.get(e);return o||(o=n(),fc.set(e,o),hc.add(o)),o}const Eo=(e,n,o)=>{const a=bn(n,o);a!==void 0&&e.add(a)};class o0{constructor(n){this._config=n0(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=uc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),dc(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return ga(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return ga(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return ga(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,a=this.type;return ga(`${a}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const a=this._scopeCache;let r=a.get(n);return(!r||o)&&(r=new Map,a.set(n,r)),r}getOptionScopes(n,o,a){const{options:r,type:s}=this,i=this._cachedScopes(n,a),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Eo(c,n,f))),u.forEach(f=>Eo(c,r,f)),u.forEach(f=>Eo(c,kn[s]||{},f)),u.forEach(f=>Eo(c,Ue,f)),u.forEach(f=>Eo(c,Or,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),hc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,kn[o]||{},Ue.datasets[o]||{},{type:o},Ue,Or]}resolveNamedOptions(n,o,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=mc(this._resolverCache,n,r);let c=i;if(r0(i,o)){s.$shared=!1,a=on(a)?a():a;const d=this.createResolver(n,a,l);c=Fn(i,a,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,a=[""],r){const{resolver:s}=mc(this._resolverCache,n,a);return Se(o)?Fn(s,o,void 0,r):s}}function mc(e,n,o){let a=e.get(n);a||(a=new Map,e.set(n,a));const r=o.join();let s=a.get(r);return s||(s={resolver:Ir(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const a0=e=>Se(e)&&Object.getOwnPropertyNames(e).some(n=>on(e[n]));function r0(e,n){const{isScriptable:o,isIndexable:a}=bl(e);for(const r of n){const s=o(r),i=a(r),l=(i||s)&&e[r];if(s&&(on(l)||a0(l))||i&&Ge(l))return!0}return!1}var s0="4.5.1";const i0=["top","bottom","left","right","chartArea"];function pc(e,n){return e==="top"||e==="bottom"||i0.indexOf(e)===-1&&n==="x"}function gc(e,n){return function(o,a){return o[e]===a[e]?o[n]-a[n]:o[e]-a[e]}}function bc(e){const n=e.chart,o=n.options.animation;n.notifyPlugins("afterRender"),Ie(o&&o.onComplete,[e],n)}function l0(e){const n=e.chart,o=n.options.animation;Ie(o&&o.onProgress,[e],n)}function yc(e){return Wr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ba={},xc=e=>{const n=yc(e);return Object.values(ba).filter(o=>o.canvas===n).pop()};function c0(e,n,o){const a=Object.keys(e);for(const r of a){const s=+r;if(s>=n){const i=e[r];delete e[r],(o>0||s>n)&&(e[s+o]=i)}}}function d0(e,n,o,a){return!o||e.type==="mouseout"?null:a?n:e}class Ht{static register(...n){Mt.add(...n),kc()}static unregister(...n){Mt.remove(...n),kc()}constructor(n,o){const a=this.config=new o0(o),r=yc(n),s=xc(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||Vg(r)),this.platform.updateConfig(a);const l=this.platform.acquireContext(r,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=lm(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new qg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Am(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],ba[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",bc),jt.listen(this,"progress",l0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:a,height:r,_aspectRatio:s}=this;return Ne(n)?o&&s?s:r?a/r:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return Mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_l(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ml(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(n,o){jt.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,n,o,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,_l(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Ie(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Pe(o,(a,r)=>{a.id=r})}buildOrUpdateScales(){const n=this.options,o=n.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=es(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Pe(s,i=>{const l=i.options,c=l.id,d=es(c,l),u=Be(l.type,i.dtype);(l.position===void 0||pc(l.position,d)!==pc(i.dposition))&&(l.position=i.dposition),r[c]=!0;let f=null;if(c in a&&a[c].type===u)f=a[c];else{const h=Mt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,n)}),Pe(r,(i,l)=>{i||delete a[l]}),Pe(a,i=>{yt.configure(this,i,i.options),yt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,a=n.length;if(n.sort((r,s)=>r.index-s.index),a>o){for(let r=o;r<a;++r)this._destroyDatasetMeta(r);n.splice(o,a-o)}this._sortedMetasets=n.slice(0).sort(gc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((a,r)=>{o.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=o.length;a<r;a++){const s=o[a];let i=this.getDatasetMeta(a);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(a),i=this.getDatasetMeta(a)),i.type=l,i.indexAxis=s.indexAxis||Zr(l,this.options),i.order=s.order||0,i.index=a,i.label=""+s.label,i.visible=this.isDatasetVisible(a),i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{const c=Mt.getController(l),{datasetElementType:d,dataElementType:u}=Ue.datasets[l];Object.assign(c,{dataElementType:Mt.getElement(u),datasetElementType:d&&Mt.getElement(d)}),i.controller=new c(this,a),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Pe(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const a=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!r&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=a.layout.autoPadding?i:0,this._updateLayout(i),r||Pe(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(gc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Pe(this.scales,n=>{yt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),a=new Set(n.events);(!Ji(o,a)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of o){const i=a==="_removeElements"?-s:s;c0(n,r,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,a=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<o;s++)if(!Ji(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;yt.update(this,this.width,this.height,n);const o=this.chartArea,a=o.width<=0||o.height<=0;this._layers=[],Pe(this.boxes,r=>{a&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,a=this.data.datasets.length;o<a;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,a=this.data.datasets.length;o<a;++o)this._updateDataset(o,on(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const a=this.getDatasetMeta(n),r={meta:a,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(o),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(jt.has(this)?this.attached&&!jt.running(this)&&jt.start(this):(this.draw(),bc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:a,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(a,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,a=[];let r,s;for(r=0,s=o.length;r<s;++r){const i=o[r];(!n||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,a={meta:n,index:n.index,cancelable:!0},r=Tl(this,n);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&ea(o,r),n.controller.draw(),r&&ta(o),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(n){return bo(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,a,r){const s=ig.modes[o];return typeof s=="function"?s(this,n,a,r):[]}getDatasetMeta(n){const o=this.data.datasets[n],a=this._metasets;let r=a.filter(s=>s&&s._dataset===o).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},a.push(r)),r}getContext(){return this.$context||(this.$context=Cn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const a=this.getDatasetMeta(n);return typeof a.hidden=="boolean"?!a.hidden:!o.hidden}setDatasetVisibility(n,o){const a=this.getDatasetMeta(n);a.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,a){const r=a?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,r);uo(o)?(s.data[o].hidden=!a,this.update()):(this.setDatasetVisibility(n,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===n?r:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),jt.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),ml(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,a=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Pe(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,a=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},r=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{r("attach",l),this.attached=!0,this.resize(),a("resize",s),a("detach",i)};i=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),a("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Pe(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Pe(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,a){const r=a?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],a=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!Ko(a,o)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,o))}notifyPlugins(n,o,a){return this._plugins.notify(this,n,o,a)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,a){const r=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=a?n:s(n,o);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(n,o){const a={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},r=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(n,o,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(n,o,a){const{_active:r=[],options:s}=this,i=o,l=this._getActiveElements(n,r,a,i),c=mm(n),d=d0(n,this._lastEvent,a,c);a&&(this._lastEvent=null,Ie(s.onHover,[n,l,this],this),c&&Ie(s.onClick,[n,l,this],this));const u=!Ko(l,r);return(u||o)&&(this._active=l,this._updateHoverStyles(l,r,o)),this._lastEvent=d,u}_getActiveElements(n,o,a,r){if(n.type==="mouseout")return[];if(!a)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,r)}}me(Ht,"defaults",Ue),me(Ht,"instances",ba),me(Ht,"overrides",kn),me(Ht,"registry",Mt),me(Ht,"version",s0),me(Ht,"getChart",xc);function kc(){return Pe(Ht.instances,e=>e._plugins.invalidate())}function u0(e,n,o){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ft(a-o));if(e.beginPath(),e.arc(r,s,i-d/2,a+f/2,o-f/2),l>0){const h=Math.min(d/l,ft(a-o));e.arc(r,s,l+d/2,o-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*ft(a-o));if(u==="round")e.arc(r,s,h,o-ve/2,a+ve/2,!0);else if(u==="bevel"){const m=2*h*h,p=-m*Math.cos(o+ve/2)+r,x=-m*Math.sin(o+ve/2)+s,y=m*Math.cos(a+ve/2)+r,g=m*Math.sin(a+ve/2)+s;e.lineTo(p,x),e.lineTo(y,g)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function f0(e,n,o){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=r/l;e.beginPath(),e.arc(s,i,l,a-d,o+d),c>r?(d=r/c,e.arc(s,i,c,o+d,a-d,!0)):e.arc(s,i,r,o+Ke,a-Ke),e.closePath(),e.clip()}function h0(e){return Rr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function m0(e,n,o,a){const r=h0(e.options.borderRadius),s=(o-n)/2,i=Math.min(s,a*n/2),l=c=>{const d=(o-Math.min(s,c))*a/2;return nt(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:nt(r.innerStart,0,i),innerEnd:nt(r.innerEnd,0,i)}}function Wn(e,n,o,a){return{x:o+e*Math.cos(n),y:a+e*Math.sin(n)}}function ya(e,n,o,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+a+o-d,0),h=u>0?u+a+o+d:0;let m=0;const p=r-c;if(a){const K=u>0?u-a:0,R=f>0?f-a:0,I=(K+R)/2,q=I!==0?p*I/(I+a):p;m=(p-q)/2}const x=Math.max(.001,p*f-o/ve)/f,y=(p-x)/2,g=c+y+m,B=r-y-m,{outerStart:k,outerEnd:C,innerStart:E,innerEnd:_}=m0(n,h,f,B-g),w=f-k,b=f-C,A=g+k/w,D=B-C/b,M=h+E,V=h+_,N=g+E/M,T=B-_/V;if(e.beginPath(),s){const K=(A+D)/2;if(e.arc(i,l,f,A,K),e.arc(i,l,f,K,D),C>0){const ne=Wn(b,D,i,l);e.arc(ne.x,ne.y,C,D,B+Ke)}const R=Wn(V,B,i,l);if(e.lineTo(R.x,R.y),_>0){const ne=Wn(V,T,i,l);e.arc(ne.x,ne.y,_,B+Ke,T+Math.PI)}const I=(B-_/h+(g+E/h))/2;if(e.arc(i,l,h,B-_/h,I,!0),e.arc(i,l,h,I,g+E/h,!0),E>0){const ne=Wn(M,N,i,l);e.arc(ne.x,ne.y,E,N+Math.PI,g-Ke)}const q=Wn(w,g,i,l);if(e.lineTo(q.x,q.y),k>0){const ne=Wn(w,A,i,l);e.arc(ne.x,ne.y,k,g-Ke,A)}}else{e.moveTo(i,l);const K=Math.cos(A)*f+i,R=Math.sin(A)*f+l;e.lineTo(K,R);const I=Math.cos(D)*f+i,q=Math.sin(D)*f+l;e.lineTo(I,q)}e.closePath()}function p0(e,n,o,a,r){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){ya(e,n,o,a,c,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(c=i+(l%We||We))}return ya(e,n,o,a,c,r),e.fill(),c}function g0(e,n,o,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;e.setLineDash(f||[]),e.lineDashOffset=h,p?(e.lineWidth=d*2,e.lineJoin=u||"round"):(e.lineWidth=d,e.lineJoin=u||"bevel");let x=n.endAngle;if(s){ya(e,n,o,a,x,r);for(let y=0;y<s;++y)e.stroke();isNaN(l)||(x=i+(l%We||We))}p&&f0(e,n,x),c.selfJoin&&x-i>=ve&&m===0&&u!=="miter"&&u0(e,n,x),s||(ya(e,n,o,a,x,r),e.stroke())}class So extends Ut{constructor(o){super();me(this,"circumference");me(this,"endAngle");me(this,"fullCircles");me(this,"innerRadius");me(this,"outerRadius");me(this,"pixelMargin");me(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=nl(s,{x:o,y:a}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,p=Be(h,d-c),x=mo(i,c,d)&&c!==d,y=p>=We||x,g=Wt(l,u+m,f+m);return y&&g}getCenterPoint(o){const{x:a,y:r,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,h=(l+c+u+d)/2;return{x:a+Math.cos(f)*h,y:r+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:a,circumference:r}=this,s=(a.offset||0)/4,i=(a.spacing||0)/2,l=a.circular;if(this.pixelMargin=a.borderAlign==="inner"?.33:0,this.fullCircles=r>We?Math.floor(r/We):0,r===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(ve,r||0)),u=s*d;o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,p0(o,this,u,i,l),g0(o,this,u,i,l),o.restore()}}me(So,"id","arc"),me(So,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),me(So,"defaultRoutes",{backgroundColor:"backgroundColor"}),me(So,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function wc(e,n,o=n){e.lineCap=Be(o.borderCapStyle,n.borderCapStyle),e.setLineDash(Be(o.borderDash,n.borderDash)),e.lineDashOffset=Be(o.borderDashOffset,n.borderDashOffset),e.lineJoin=Be(o.borderJoinStyle,n.borderJoinStyle),e.lineWidth=Be(o.borderWidth,n.borderWidth),e.strokeStyle=Be(o.borderColor,n.borderColor)}function b0(e,n,o){e.lineTo(o.x,o.y)}function y0(e){return e.stepped?$m:e.tension||e.cubicInterpolationMode==="monotone"?Wm:b0}function Cc(e,n,o={}){const a=e.length,{start:r=0,end:s=a-1}=o,{start:i,end:l}=n,c=Math.max(r,i),d=Math.min(s,l),u=r<i&&s<i||r>l&&s>l;return{count:a,start:c,loop:n.loop,ilen:d<c&&!u?a+d-c:d-c}}function x0(e,n,o,a){const{points:r,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Cc(r,o,a),u=y0(s);let{move:f=!0,reverse:h}=a||{},m,p,x;for(m=0;m<=d;++m)p=r[(l+(h?d-m:m))%i],!p.skip&&(f?(e.moveTo(p.x,p.y),f=!1):u(e,x,p,h,s.stepped),x=p);return c&&(p=r[(l+(h?d:0))%i],u(e,x,p,h,s.stepped)),!!c}function k0(e,n,o,a){const r=n.points,{count:s,start:i,ilen:l}=Cc(r,o,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,p,x,y,g;const B=C=>(i+(d?l-C:C))%s,k=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,g))};for(c&&(m=r[B(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[B(h)],m.skip)continue;const C=m.x,E=m.y,_=C|0;_===p?(E<x?x=E:E>y&&(y=E),u=(f*u+C)/++f):(k(),e.lineTo(C,E),p=_,f=0,x=y=E),g=E}k()}function ts(e){const n=e.options,o=n.borderDash&&n.borderDash.length;return!e._decimated&&!e._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?k0:x0}function w0(e){return e.stepped?kp:e.tension||e.cubicInterpolationMode==="monotone"?wp:En}function C0(e,n,o,a){let r=n._path;r||(r=n._path=new Path2D,n.path(r,o,a)&&r.closePath()),wc(e,n.options),e.stroke(r)}function B0(e,n,o,a){const{segments:r,options:s}=n,i=ts(n);for(const l of r)wc(e,s,l.style),e.beginPath(),i(e,n,l,{start:o,end:o+a-1})&&e.closePath(),e.stroke()}const _0=typeof Path2D=="function";function E0(e,n,o,a){_0&&!n.options.segment?C0(e,n,o,a):B0(e,n,o,a)}class rn extends Ut{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;fp(this._points,a,n,r,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ap(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,a=n.length;return a&&o[n[a-1].end]}interpolate(n,o){const a=this.options,r=n[o],s=this.points,i=Nl(this,{property:o,start:r,end:r});if(!i.length)return;const l=[],c=w0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],p=s[h];if(m===p){l.push(m);continue}const x=Math.abs((r-m[o])/(p[o]-m[o])),y=c(m,p,x,a.stepped);y[o]=n[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(n,o,a){return ts(this)(n,this,o,a)}path(n,o,a){const r=this.segments,s=ts(this);let i=this._loop;o=o||0,a=a||this.points.length-o;for(const l of r)i&=s(n,this,l,{start:o,end:o+a-1});return!!i}draw(n,o,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),E0(n,this,a,r),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(rn,"id","line"),me(rn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(rn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Bc(e,n,o,a){const r=e.options,{[o]:s}=e.getProps([o],a);return Math.abs(n-s)<r.radius+r.hitRadius}class xa extends Ut{constructor(o){super();me(this,"parsed");me(this,"skip");me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(o-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,a){return Bc(this,o,"x",a)}inYRange(o,a){return Bc(this,o,"y",a)}getCenterPoint(o){const{x:a,y:r}=this.getProps(["x","y"],o);return{x:a,y:r}}size(o){o=o||this.options||{};let a=o.radius||0;a=Math.max(a,a&&o.hoverRadius||0);const r=a&&o.borderWidth||0;return(a+r)*2}draw(o,a){const r=this.options;this.skip||r.radius<.1||!bo(this,a,this.size(r)/2)||(o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.fillStyle=r.backgroundColor,Fr(o,r,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}me(xa,"id","point"),me(xa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(xa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function _c(e,n){const{x:o,y:a,base:r,width:s,height:i}=e.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return e.horizontal?(f=i/2,l=Math.min(o,r),c=Math.max(o,r),d=a-f,u=a+f):(f=s/2,l=o-f,c=o+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function sn(e,n,o,a){return e?0:nt(n,o,a)}function S0(e,n,o){const a=e.options.borderWidth,r=e.borderSkipped,s=gl(a);return{t:sn(r.top,s.top,0,o),r:sn(r.right,s.right,0,n),b:sn(r.bottom,s.bottom,0,o),l:sn(r.left,s.left,0,n)}}function A0(e,n,o){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=zn(r),i=Math.min(n,o),l=e.borderSkipped,c=a||Se(r);return{topLeft:sn(!c||l.top||l.left,s.topLeft,0,i),topRight:sn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:sn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:sn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function V0(e){const n=_c(e),o=n.right-n.left,a=n.bottom-n.top,r=S0(e,o/2,a/2),s=A0(e,o/2,a/2);return{outer:{x:n.left,y:n.top,w:o,h:a,radius:s},inner:{x:n.left+r.l,y:n.top+r.t,w:o-r.l-r.r,h:a-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ns(e,n,o,a){const r=n===null,s=o===null,l=e&&!(r&&s)&&_c(e,a);return l&&(r||Wt(n,l.left,l.right))&&(s||Wt(o,l.top,l.bottom))}function D0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function M0(e,n){e.rect(n.x,n.y,n.w,n.h)}function os(e,n,o={}){const a=e.x!==o.x?-n:0,r=e.y!==o.y?-n:0,s=(e.x+e.w!==o.x+o.w?n:0)-a,i=(e.y+e.h!==o.y+o.h?n:0)-r;return{x:e.x+a,y:e.y+r,w:e.w+s,h:e.h+i,radius:e.radius}}class ka extends Ut{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=V0(this),l=D0(i.radius)?na:M0;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,os(i,o,s)),n.clip(),l(n,os(s,-o,i)),n.fillStyle=a,n.fill("evenodd")),n.beginPath(),l(n,os(s,o)),n.fillStyle=r,n.fill(),n.restore()}inRange(n,o,a){return ns(this,n,o,a)}inXRange(n,o){return ns(this,n,null,o)}inYRange(n,o){return ns(this,null,n,o)}getCenterPoint(n){const{x:o,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+r)/2:o,y:s?a:(a+r)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}me(ka,"id","bar"),me(ka,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),me(ka,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function N0(e,n,o){const a=e.segments,r=e.points,s=n.points,i=[];for(const l of a){let{start:c,end:d}=l;d=wa(c,d,r);const u=as(o,r[c],r[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=Nl(n,u);for(const h of f){const m=as(o,s[h.start],s[h.end],h.loop),p=Ml(l,r,m);for(const x of p)i.push({source:x,target:h,start:{[o]:Ec(u,m,"start",Math.max)},end:{[o]:Ec(u,m,"end",Math.min)}})}}return i}function as(e,n,o,a){if(a)return;let r=n[e],s=o[e];return e==="angle"&&(r=ft(r),s=ft(s)),{property:e,start:r,end:s}}function P0(e,n){const{x:o=null,y:a=null}=e||{},r=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=wa(i,l,r);const c=r[i],d=r[l];a!==null?(s.push({x:c.x,y:a}),s.push({x:d.x,y:a})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function wa(e,n,o){for(;n>e;n--){const a=o[n];if(!isNaN(a.x)&&!isNaN(a.y))break}return n}function Ec(e,n,o,a){return e&&n?a(e[o],n[o]):e?e[o]:n?n[o]:0}function Sc(e,n){let o=[],a=!1;return Ge(e)?(a=!0,o=e):o=P0(e,n),o.length?new rn({points:o,options:{tension:0},_loop:a,_fullLoop:a}):null}function Ac(e){return e&&e.fill!==!1}function v0(e,n,o){let r=e[n].fill;const s=[n];let i;if(!o)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!tt(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function T0(e,n,o){const a=R0(e);if(Se(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return tt(r)&&Math.floor(r)===r?O0(a[0],n,r,o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function O0(e,n,o,a){return(e==="-"||e==="+")&&(o=n+o),o===n||o<0||o>=a?!1:o}function z0(e,n){let o=null;return e==="start"?o=n.bottom:e==="end"?o=n.top:Se(e)?o=n.getPixelForValue(e.value):n.getBasePixel&&(o=n.getBasePixel()),o}function F0(e,n,o){let a;return e==="start"?a=o:e==="end"?a=n.options.reverse?n.min:n.max:Se(e)?a=e.value:a=n.getBaseValue(),a}function R0(e){const n=e.options,o=n.fill;let a=Be(o&&o.target,o);return a===void 0&&(a=!!n.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function I0(e){const{scale:n,index:o,line:a}=e,r=[],s=a.segments,i=a.points,l=L0(n,o);l.push(Sc({x:null,y:n.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)$0(r,i[u],l)}return new rn({points:r,options:{}})}function L0(e,n){const o=[],a=e.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function $0(e,n,o){const a=[];for(let r=0;r<o.length;r++){const s=o[r],{first:i,last:l,point:c}=W0(s,n,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(e.push(c),!l)break}}e.push(...a)}function W0(e,n,o){const a=e.interpolate(n,o);if(!a)return{};const r=a[o],s=e.segments,i=e.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],h=i[u.end][o];if(Wt(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Vc{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,a){const{x:r,y:s,radius:i}=this;return o=o||{start:0,end:We},n.arc(r,s,i,o.end,o.start,!0),!a.bounds}interpolate(n){const{x:o,y:a,radius:r}=this,s=n.angle;return{x:o+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function j0(e){const{chart:n,fill:o,line:a}=e;if(tt(o))return U0(n,o);if(o==="stack")return I0(e);if(o==="shape")return!0;const r=H0(e);return r instanceof Vc?r:Sc(r,a)}function U0(e,n){const o=e.getDatasetMeta(n);return o&&e.isDatasetVisible(n)?o.dataset:null}function H0(e){return(e.scale||{}).getPointPositionForValue?G0(e):q0(e)}function q0(e){const{scale:n={},fill:o}=e,a=z0(o,n);if(tt(a)){const r=n.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function G0(e){const{scale:n,fill:o}=e,a=n.options,r=n.getLabels().length,s=a.reverse?n.max:n.min,i=F0(o,n,s),l=[];if(a.grid.circular){const c=n.getPointPositionForValue(0,s);return new Vc({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(n.getPointPositionForValue(c,i));return l}function rs(e,n,o){const a=j0(n),{chart:r,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},p=r.getDatasetMeta(s),x=Tl(r,p);a&&i.points.length&&(ea(e,o),X0(e,{line:i,target:a,above:h,below:m,area:o,scale:l,axis:c,clip:x}),ta(e))}function X0(e,n){const{line:o,target:a,above:r,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;e.save();let u=s;s!==r&&(d==="x"?(Dc(e,a,i.top),ss(e,{line:o,target:a,color:r,scale:l,property:d,clip:c}),e.restore(),e.save(),Dc(e,a,i.bottom)):d==="y"&&(Mc(e,a,i.left),ss(e,{line:o,target:a,color:s,scale:l,property:d,clip:c}),e.restore(),e.save(),Mc(e,a,i.right),u=r)),ss(e,{line:o,target:a,color:u,scale:l,property:d,clip:c}),e.restore()}function Dc(e,n,o){const{segments:a,points:r}=n;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[wa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,o),e.lineTo(u.x,u.y)),i=!!n.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(f.x,o)}e.lineTo(n.first().x,o),e.closePath(),e.clip()}function Mc(e,n,o){const{segments:a,points:r}=n;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[wa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(o,u.y),e.lineTo(u.x,u.y)),i=!!n.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(o,f.y)}e.lineTo(o,n.first().y),e.closePath(),e.clip()}function ss(e,n){const{line:o,target:a,property:r,color:s,scale:i,clip:l}=n,c=N0(o,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,p=a!==!0;e.save(),e.fillStyle=m,Y0(e,i,l,p&&as(r,f,h)),e.beginPath();const x=!!o.pathSegment(e,d);let y;if(p){x?e.closePath():Nc(e,a,h,r);const g=!!a.pathSegment(e,u,{move:x,reverse:!0});y=x&&g,y||Nc(e,a,f,r)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function Y0(e,n,o,a){const r=n.chart.chartArea,{property:s,start:i,end:l}=a||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=r.top,u=l,f=r.bottom):(c=r.left,d=i,u=r.right,f=l),e.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),e.rect(c,d,u-c,f-d),e.clip()}}function Nc(e,n,o,a){const r=n.interpolate(o,a);r&&e.lineTo(r.x,r.y)}var K0={id:"filler",afterDatasetsUpdate(e,n,o){const a=(e.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=e.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof rn&&(c={visible:e.isDatasetVisible(i),index:i,fill:T0(l,i,a),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,r.push(c);for(i=0;i<a;++i)c=r[i],!(!c||c.fill===!1)&&(c.fill=v0(r,i,o.propagate))},beforeDraw(e,n,o){const a=o.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let i=r.length-1;i>=0;--i){const l=r[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),a&&l.fill&&rs(e.ctx,l,s))}},beforeDatasetsDraw(e,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const a=e.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Ac(s)&&rs(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,n,o){const a=n.meta.$filler;!Ac(a)||o.drawTime!=="beforeDatasetDraw"||rs(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Pc=(e,n)=>{let{boxHeight:o=n,boxWidth:a=n}=e;return e.usePointStyle&&(o=Math.min(o,n),a=e.pointStyleWidth||Math.min(a,n)),{boxWidth:a,boxHeight:o,itemHeight:Math.max(n,o)}},J0=(e,n)=>e!==null&&n!==null&&e.datasetIndex===n.datasetIndex&&e.index===n.index;class vc extends Ut{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,a){this.maxWidth=n,this.maxHeight=o,this._margins=a,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=Ie(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(a=>n.filter(a,this.chart.data))),n.sort&&(o=o.sort((a,r)=>n.sort(a,r,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const a=n.labels,r=at(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Pc(a,s);let d,u;o.font=r.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,r,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=n;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,x)=>{const y=a+o/2+s.measureText(p.text).width;(x===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(x>0?0:1)]=0,m+=u,h++),c[x]={left:0,top:m,row:h,width:y,height:r},d[d.length-1]+=y+l}),f}_fitCols(n,o,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,h=0,m=0,p=0,x=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:B,itemHeight:k}=Q0(a,o,s,y,r);g>0&&m+k+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,x++,h=m=0),c[g]={left:p,top:m,col:x,width:B,height:k},h=Math.max(h,B),m+=k+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:a,labels:{padding:r},rtl:s}}=this,i=In(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=ot(a,this.left+r,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=ot(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+n+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=ot(a,this.top+n+r,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=ot(a,this.top+n+r,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+r,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;ea(n,this),this._draw(),ta(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:a,ctx:r}=this,{align:s,labels:i}=n,l=Ue.color,c=In(n.rtl,this.left,this.width),d=at(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:p,boxHeight:x,itemHeight:y}=Pc(i,f),g=function(_,w,b){if(isNaN(p)||p<=0||isNaN(x)||x<0)return;r.save();const A=Be(b.lineWidth,1);if(r.fillStyle=Be(b.fillStyle,l),r.lineCap=Be(b.lineCap,"butt"),r.lineDashOffset=Be(b.lineDashOffset,0),r.lineJoin=Be(b.lineJoin,"miter"),r.lineWidth=A,r.strokeStyle=Be(b.strokeStyle,l),r.setLineDash(Be(b.lineDash,[])),i.usePointStyle){const D={radius:x*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:A},M=c.xPlus(_,p/2),V=w+h;pl(r,D,M,V,i.pointStyleWidth&&p)}else{const D=w+Math.max((f-x)/2,0),M=c.leftForLtr(_,p),V=zn(b.borderRadius);r.beginPath(),Object.values(V).some(N=>N!==0)?na(r,{x:M,y:D,w:p,h:x,radius:V}):r.rect(M,D,p,x),r.fill(),A!==0&&r.stroke()}r.restore()},B=function(_,w,b){yo(r,b.text,_,w+y/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},k=this.isHorizontal(),C=this._computeTitleHeight();k?m={x:ot(s,this.left+u,this.right-a[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:ot(s,this.top+C+u,this.bottom-o[0].height),line:0},Sl(this.ctx,n.textDirection);const E=y+u;this.legendItems.forEach((_,w)=>{r.strokeStyle=_.fontColor,r.fillStyle=_.fontColor;const b=r.measureText(_.text).width,A=c.textAlign(_.textAlign||(_.textAlign=i.textAlign)),D=p+h+b;let M=m.x,V=m.y;c.setWidth(this.width),k?w>0&&M+D+u>this.right&&(V=m.y+=E,m.line++,M=m.x=ot(s,this.left+u,this.right-a[m.line])):w>0&&V+E>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,V=m.y=ot(s,this.top+C+u,this.bottom-o[m.line].height));const N=c.x(M);if(g(N,V,_),M=Vm(A,M+p+h,k?M+D:this.right,n.rtl),B(c.x(M),V,_),k)m.x+=D+u;else if(typeof _.text!="string"){const T=d.lineHeight;m.y+=Tc(_,T)+u}else m.y+=E}),Al(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,a=at(o.font),r=bt(o.padding);if(!o.display)return;const s=In(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=a.size/2,d=r.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=ot(n.align,f,this.right-h);else{const p=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=d+ot(n.align,this.top,this.bottom-p-n.labels.padding-this._computeTitleHeight())}const m=ot(l,f,f+h);i.textAlign=s.textAlign(Nr(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=a.string,yo(i,o.text,m,u,a)}_computeTitleHeight(){const n=this.options.title,o=at(n.font),a=bt(n.padding);return n.display?o.lineHeight+a.height:0}_getLegendItemAt(n,o){let a,r,s;if(Wt(n,this.left,this.right)&&Wt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Wt(n,r.left,r.left+r.width)&&Wt(o,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(n){const o=this.options;if(!tb(n.type,o))return;const a=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const r=this._hoveredItem,s=J0(r,a);r&&!s&&Ie(o.onLeave,[n,r,this],this),this._hoveredItem=a,a&&!s&&Ie(o.onHover,[n,a,this],this)}else a&&Ie(o.onClick,[n,a,this],this)}}function Q0(e,n,o,a,r){const s=Z0(a,e,n,o),i=eb(r,a,n.lineHeight);return{itemWidth:s,itemHeight:i}}function Z0(e,n,o,a){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+a.measureText(r).width}function eb(e,n,o){let a=e;return typeof n.text!="string"&&(a=Tc(n,o)),a}function Tc(e,n){const o=e.text?e.text.length:0;return n*o}function tb(e,n){return!!((e==="mousemove"||e==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(e==="click"||e==="mouseup"))}var nb={id:"legend",_element:vc,start(e,n,o){const a=e.legend=new vc({ctx:e.ctx,options:o,chart:e});yt.configure(e,a,o),yt.addBox(e,a)},stop(e){yt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,n,o){const a=e.legend;yt.configure(e,a,o),a.options=o},afterUpdate(e){const n=e.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(e,n){n.replay||e.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,n,o){const a=n.datasetIndex,r=o.chart;r.isDatasetVisible(a)?(r.hide(a),n.hidden=!0):(r.show(a),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const n=e.data.datasets,{labels:{usePointStyle:o,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=bt(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:a||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Oc extends Ut{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const a=this.options;if(this.left=0,this.top=0,!a.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const r=Ge(a.text)?a.text.length:1;this._padding=bt(a.padding);const s=r*at(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=ot(l,a,s),f=o+n,d=s-a):(i.position==="left"?(u=a+n,f=ot(l,r,o),c=ve*-.5):(u=s-n,f=ot(l,o,r),c=ve*.5),d=r-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const a=at(o.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);yo(n,o.text,0,0,a,{color:o.color,maxWidth:c,rotation:d,textAlign:Nr(o.align),textBaseline:"middle",translation:[i,l]})}}function ob(e,n){const o=new Oc({ctx:e.ctx,options:n,chart:e});yt.configure(e,o,n),yt.addBox(e,o),e.titleBlock=o}var ab={id:"title",_element:Oc,start(e,n,o){ob(e,o)},stop(e){const n=e.titleBlock;yt.removeBox(e,n),delete e.titleBlock},beforeUpdate(e,n,o){const a=e.titleBlock;yt.configure(e,a,o),a.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ao={average(e){if(!e.length)return!1;let n,o,a=new Set,r=0,s=0;for(n=0,o=e.length;n<o;++n){const l=e[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();a.add(c.x),r+=c.y,++s}}return s===0||a.size===0?!1:{x:[...a].reduce((l,c)=>l+c)/a.size,y:r/s}},nearest(e,n){if(!e.length)return!1;let o=n.x,a=n.y,r=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=e.length;s<i;++s){const c=e[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Dr(n,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}};function Nt(e,n){return n&&(Ge(n)?Array.prototype.push.apply(e,n):e.push(n)),e}function qt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
17
17
|
`)>-1?e.split(`
|
|
18
|
-
`):e}function cb(e,t){const{element:o,datasetIndex:a,index:r}=t,s=e.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:e,label:i,parsed:s.getParsed(r),raw:e.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:o}}function Tc(e,t){const o=e.chart.ctx,{body:a,footer:r,title:s}=e,{boxWidth:i,boxHeight:l}=t,c=at(t.bodyFont),d=at(t.titleFont),u=at(t.footerFont),f=s.length,h=r.length,m=a.length,p=gt(t.padding);let b=p.height,y=0,g=a.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),g){const C=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*C+(g-m)*c.lineHeight+(g-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let B=0;const w=function(C){y=Math.max(y,o.measureText(C).width+B)};return o.save(),o.font=d.string,Pe(e.title,w),o.font=c.string,Pe(e.beforeBody.concat(e.afterBody),w),B=t.displayColors?i+2+t.boxPadding:0,Pe(a,C=>{Pe(C.before,w),Pe(C.lines,w),Pe(C.after,w)}),B=0,o.font=u.string,Pe(e.footer,w),o.restore(),y+=p.width,{width:y,height:b}}function db(e,t){const{y:o,height:a}=t;return o<a/2?"top":o>e.height-a/2?"bottom":"center"}function ub(e,t,o,a){const{x:r,width:s}=a,i=o.caretSize+o.caretPadding;if(e==="left"&&r+s+i>t.width||e==="right"&&r-s-i<0)return!0}function fb(e,t,o,a){const{x:r,width:s}=o,{width:i,chartArea:{left:l,right:c}}=e;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),ub(d,e,t,o)&&(d="center"),d}function Oc(e,t,o){const a=o.yAlign||t.yAlign||db(e,o);return{xAlign:o.xAlign||t.xAlign||fb(e,t,o,a),yAlign:a}}function hb(e,t){let{x:o,width:a}=e;return t==="right"?o-=a:t==="center"&&(o-=a/2),o}function mb(e,t,o){let{y:a,height:r}=e;return t==="top"?a+=o:t==="bottom"?a-=r+o:a-=r/2,a}function zc(e,t,o,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=e,{xAlign:l,yAlign:c}=o,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=On(i);let p=hb(t,l);const b=mb(t,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+r:l==="right"&&(p+=Math.max(f,m)+r),{x:nt(p,0,a.width-t.width),y:nt(b,0,a.height-t.height)}}function ka(e,t,o){const a=gt(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-a.right:e.x+a.left}function Fc(e){return Pt([],qt(e))}function pb(e,t,o){return wn(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function Rc(e,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}const Ic={beforeTitle:Lt,title(e){if(e.length>0){const t=e[0],o=t.chart.data.labels,a=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(a>0&&t.dataIndex<a)return o[t.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const o=e.formattedValue;return Ne(o)||(t+=o),t},labelColor(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function lt(e,t,o,a){const r=e[t].call(o,a);return typeof r>"u"?Ic[t].call(o,a):r}class rs extends Ut{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&o.options.animation&&a.animations,s=new Tl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=pb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:a}=o,r=lt(a,"beforeTitle",this,t),s=lt(a,"title",this,t),i=lt(a,"afterTitle",this,t);let l=[];return l=Pt(l,qt(r)),l=Pt(l,qt(s)),l=Pt(l,qt(i)),l}getBeforeBody(t,o){return Fc(lt(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:a}=o,r=[];return Pe(t,s=>{const i={before:[],lines:[],after:[]},l=Rc(a,s);Pt(i.before,qt(lt(l,"beforeLabel",this,s))),Pt(i.lines,lt(l,"label",this,s)),Pt(i.after,qt(lt(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(t,o){return Fc(lt(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:a}=o,r=lt(a,"beforeFooter",this,t),s=lt(a,"footer",this,t),i=lt(a,"afterFooter",this,t);let l=[];return l=Pt(l,qt(r)),l=Pt(l,qt(s)),l=Pt(l,qt(i)),l}_createItems(t){const o=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(cb(this.chart,o[c]));return t.filter&&(l=l.filter((u,f,h)=>t.filter(u,f,h,a))),t.itemSort&&(l=l.sort((u,f)=>t.itemSort(u,f,a))),Pe(l,u=>{const f=Rc(t.callbacks,u);r.push(lt(f,"labelColor",this,u)),s.push(lt(f,"labelPointStyle",this,u)),i.push(lt(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(t,o){const a=this.options.setContext(this.getContext()),r=this._active;let s,i=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=So[a.position].call(this,r,this._eventPosition);i=this._createItems(a),this.title=this.getTitle(i,a),this.beforeBody=this.getBeforeBody(i,a),this.body=this.getBody(i,a),this.afterBody=this.getAfterBody(i,a),this.footer=this.getFooter(i,a);const c=this._size=Tc(this,a),d=Object.assign({},l,c),u=Oc(this.chart,a,d),f=zc(a,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,a,r){const s=this.getCaretPosition(t,a,r);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(t,o,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=On(l),{x:h,y:m}=t,{width:p,height:b}=o;let y,g,B,w,C,E;return s==="center"?(C=m+b/2,r==="left"?(y=h,g=y-i,w=C+i,E=C-i):(y=h+p,g=y+i,w=C-i,E=C+i),B=y):(r==="left"?g=h+Math.max(c,u)+i:r==="right"?g=h+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(w=m,C=w-i,y=g-i,B=g+i):(w=m+b,C=w+i,y=g+i,B=g-i),E=w),{x1:y,x2:g,x3:B,y1:w,y2:C,y3:E}}drawTitle(t,o,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=Rn(a.rtl,this.x,this.width);for(t.x=ka(this,a.titleAlign,a),o.textAlign=d.textAlign(a.titleAlign),o.textBaseline="middle",i=at(a.titleFont),l=a.titleSpacing,o.fillStyle=a.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(r[c],d.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+l,c+1===s&&(t.y+=a.titleMarginBottom-l)}}_drawColorBox(t,o,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=at(s.bodyFont),f=ka(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=r.leftForLtr(h,d)+d/2,g=p+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Or(t,b,y,g),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Or(t,b,y,g)}else{t.lineWidth=Se(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const b=r.leftForLtr(h,d),y=r.leftForLtr(r.xPlus(h,1),d-2),g=On(i.borderRadius);Object.values(g).some(B=>B!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,ea(t,{x:b,y:p,w:d,h:c,radius:g}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),ea(t,{x:y,y:p+1,w:d-2,h:c-2,radius:g}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(b,p,d,c),t.strokeRect(b,p,d,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,d-2,c-2))}t.fillStyle=this.labelTextColors[a]}drawBody(t,o,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=at(a.bodyFont);let h=f.lineHeight,m=0;const p=Rn(a.rtl,this.x,this.width),b=function(x){o.fillText(x,p.x(t.x+m),t.y+h/2),t.y+=h+s},y=p.textAlign(i);let g,B,w,C,E,_,k;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,t.x=ka(this,y,a),o.fillStyle=a.bodyColor,Pe(this.beforeBody,b),m=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,C=0,_=r.length;C<_;++C){for(g=r[C],B=this.labelTextColors[C],o.fillStyle=B,Pe(g.before,b),w=g.lines,l&&w.length&&(this._drawColorBox(o,t,C,p,a),h=Math.max(f.lineHeight,c)),E=0,k=w.length;E<k;++E)b(w[E]),h=f.lineHeight;Pe(g.after,b)}m=0,h=f.lineHeight,Pe(this.afterBody,b),t.y-=s}drawFooter(t,o,a){const r=this.footer,s=r.length;let i,l;if(s){const c=Rn(a.rtl,this.x,this.width);for(t.x=ka(this,a.footerAlign,a),t.y+=a.footerMarginTop,o.textAlign=c.textAlign(a.footerAlign),o.textBaseline="middle",i=at(a.footerFont),o.fillStyle=a.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(r[l],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a.footerSpacing}}drawBackground(t,o,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=t,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=On(r.cornerRadius);o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(t,o,a,r),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(t,o,a,r),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(t,o,a,r),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(t,o,a,r),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),r.borderWidth>0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=So[t.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=Tc(this,t),c=Object.assign({},i,this._size),d=Oc(o,t,c),u=zc(t,c,d,o);(r._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const o=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(o);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=gt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(t.save(),t.globalAlpha=a,this.drawBackground(s,t,r,o),_l(t,o.textDirection),s.y+=i.top,this.drawTitle(s,t,o),this.drawBody(s,t,o),this.drawFooter(s,t,o),El(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const a=this._active,r=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!Xo(a,r),i=this._positionChanged(r,o);(s||i)&&(this._active=r,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,a=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(t,s,o,a),l=this._positionChanged(i,t),c=o||!Xo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),c}_getActiveElements(t,o,a,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(t,o){const{caretX:a,caretY:r,options:s}=this,i=So[s.position].call(this,t,o);return i!==!1&&(a!==i.x||r!==i.y)}}me(rs,"positioners",So);var gb={id:"tooltip",_element:rs,positioners:So,afterInit(e,t,o){o&&(e.tooltip=new rs({chart:e,options:o}))},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,t){if(e.tooltip){const o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ic},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const bb=(e,t,o,a)=>(typeof t=="string"?(o=e.push(t)-1,a.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function yb(e,t,o,a){const r=e.indexOf(t);if(r===-1)return bb(e,t,o,a);const s=e.lastIndexOf(t);return r!==s?o:r}const xb=(e,t)=>e===null?null:nt(Math.round(e),0,t);function Lc(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ss extends Ln{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const o=this._addedLabels;if(o.length){const a=this.getLabels();for(const{index:r,label:s}of o)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,o){if(Ne(t))return null;const a=this.getLabels();return o=isFinite(o)&&a[o]===t?o:yb(a,t,Be(o,t),this._addedLabels),xb(o,a.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(a=0),o||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const t=this.min,o=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=t===0&&o===s.length-1?s:s.slice(t,o+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=t;i<=o;i++)r.push({value:i});return r}getLabelForValue(t){return Lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(ss,"id","category"),me(ss,"defaults",{ticks:{callback:Lc}});function kb(e,t){const o=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=e,m=s||1,p=u-1,{min:b,max:y}=t,g=!Ne(i),B=!Ne(l),w=!Ne(d),C=(y-b)/(f+1);let E=Qi((y-b)/p/m)*m,_,k,x,A;if(E<1e-14&&!g&&!B)return[{value:b},{value:y}];A=Math.ceil(y/E)-Math.floor(b/E),A>p&&(E=Qi(A*E/p/m)*m),Ne(c)||(_=Math.pow(10,c),E=Math.ceil(E*_)/_),r==="ticks"?(k=Math.floor(b/E)*E,x=Math.ceil(y/E)*E):(k=b,x=y),g&&B&&s&&Bm((l-i)/s,E/1e3)?(A=Math.round(Math.min((l-i)/E,u)),E=(l-i)/A,k=i,x=l):w?(k=g?i:k,x=B?l:x,A=d-1,E=(x-k)/A):(A=(x-k)/E,uo(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const D=Math.max(Zi(E),Zi(k));_=Math.pow(10,Ne(c)?D:c),k=Math.round(k*_)/_,x=Math.round(x*_)/_;let M=0;for(g&&(h&&k!==i?(o.push({value:i}),k<i&&M++,uo(Math.round((k+M*E)*_)/_,i,$c(i,C,e))&&M++):k<i&&M++);M<A;++M){const V=Math.round((k+M*E)*_)/_;if(B&&V>l)break;o.push({value:V})}return B&&h&&x!==l?o.length&&uo(o[o.length-1].value,l,$c(l,C,e))?o[o.length-1].value=l:o.push({value:l}):(!B||x===l)&&o.push({value:x}),o}function $c(e,t,{horizontal:o,minRotation:a}){const r=$t(a),s=(o?Math.sin(r):Math.cos(r))||.001,i=.75*t*(""+e).length;return Math.min(t/s,i)}class wb extends Ln{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,o){return Ne(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:o,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=o?r:c,l=c=>s=a?s:c;if(t){const c=Mt(r),d=Mt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);l(s+c),t||i(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:a}=t,r;return a?(r=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),o=o||11),o&&(r=Math.min(o,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=kb(r,s);return t.bounds==="ticks"&&_m(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let o=this.min,a=this.max;if(super.configure(),this.options.offset&&t.length){const r=(a-o)/Math.max(t.length-1,1)/2;o-=r,a+=r}this._startValue=o,this._endValue=a,this._valueRange=a-o}getLabelForValue(t){return Pr(t,this.chart.options.locale,this.options.ticks.format)}}class is extends wb{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=tt(t)?t:0,this.max=tt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,a=$t(this.options.ticks.minRotation),r=(t?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(is,"id","linear"),me(is,"defaults",{ticks:{callback:dl.formatters.numeric}});const wa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ct=Object.keys(wa);function Wc(e,t){return e-t}function jc(e,t){if(Ne(t))return null;const o=e._adapter,{parser:a,round:r,isoWeekday:s}=e._parseOpts;let i=t;return typeof a=="function"&&(i=a(i)),tt(i)||(i=typeof a=="string"?o.parse(i,a):o.parse(i)),i===null?null:(r&&(i=r==="week"&&(fo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,r)),+i)}function Uc(e,t,o,a){const r=ct.length;for(let s=ct.indexOf(e);s<r-1;++s){const i=wa[ct[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-t)/(l*i.size))<=a)return ct[s]}return ct[r-1]}function Cb(e,t,o,a,r){for(let s=ct.length-1;s>=ct.indexOf(o);s--){const i=ct[s];if(wa[i].common&&e._adapter.diff(r,a,i)>=t-1)return i}return ct[o?ct.indexOf(o):0]}function Bb(e){for(let t=ct.indexOf(e)+1,o=ct.length;t<o;++t)if(wa[ct[t]].common)return ct[t]}function Hc(e,t,o){if(!o)e[t]=!0;else if(o.length){const{lo:a,hi:r}=Vr(o,t),s=o[a]>=t?o[a]:o[r];e[s]=!0}}function _b(e,t,o,a){const r=e._adapter,s=+r.startOf(t[0].value,a),i=t[t.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=o[l],c>=0&&(t[c].major=!0);return t}function qc(e,t,o){const a=[],r={},s=t.length;let i,l;for(i=0;i<s;++i)l=t[i],r[l]=i,a.push({value:l,major:!1});return s===0||!o?a:_b(e,a,r,o)}class Ca extends Ln{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,o={}){const a=t.time||(t.time={}),r=this._adapter=new sg._date(t.adapters.date);r.init(o),lo(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(t),this._normalized=o.normalized}parse(t,o){return t===void 0?null:jc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,o=this._adapter,a=t.time.unit||"day";let{min:r,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=tt(r)&&!isNaN(r)?r:+o.startOf(Date.now(),a),s=tt(s)&&!isNaN(s)?s:+o.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],a=t[t.length-1]),{min:o,max:a}}buildTicks(){const t=this.options,o=t.time,a=t.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,i=this.max,l=Dm(r,s,i);return this._unit=o.unit||(a.autoSkip?Uc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):Cb(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:Bb(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),qc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let o=0,a=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?o=1-r:o=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?a=s:a=(s-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;o=nt(o,0,i),a=nt(a,0,i),this._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const t=this._adapter,o=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||Uc(s.minUnit,o,a,this._getLabelCapacity(o)),l=Be(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=fo(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":i),t.diff(a,o,i)>1e5*l)throw new Error(o+" and "+a+" are too far apart with stepSize of "+l+" "+i);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+t.add(h,l,i),m++)Hc(u,h,p);return(h===a||r.bounds==="ticks"||m===1)&&Hc(u,h,p),Object.keys(u).sort(Wc).map(b=>+b)}getLabelForValue(t){const o=this._adapter,a=this.options.time;return a.tooltipFormat?o.format(t,a.tooltipFormat):o.format(t,a.displayFormats.datetime)}format(t,o){const r=this.options.time.displayFormats,s=this._unit,i=o||r[s];return this._adapter.format(t,i)}_tickFormatFunction(t,o,a,r){const s=this.options,i=s.ticks.callback;if(i)return Ie(i,[t,o,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[o],m=d&&f&&h&&h.major;return this._adapter.format(t,r||(m?f:u))}generateTickLabels(t){let o,a,r;for(o=0,a=t.length;o<a;++o)r=t[o],r.label=this._tickFormatFunction(r.value,o,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const o=this._offsets,a=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+a)*o.factor)}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+a*(this.max-this.min)}_getLabelSize(t){const o=this.options.ticks,a=this.ctx.measureText(t).width,r=$t(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(r),i=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:a*s+l*i,h:a*i+l*s}}_getLabelCapacity(t){const o=this.options.time,a=o.displayFormats,r=a[o.unit]||a.millisecond,s=this._tickFormatFunction(t,0,qc(this,[t],this._majorUnit),r),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],o,a;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(o=0,a=r.length;o<a;++o)t=t.concat(r[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let o,a;if(t.length)return t;const r=this.getLabels();for(o=0,a=r.length;o<a;++o)t.push(jc(this,r[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ol(t.sort(Wc))}}me(Ca,"id","time"),me(Ca,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ba(e,t,o){let a=0,r=e.length-1,s,i,l,c;o?(t>=e[a].pos&&t<=e[r].pos&&({lo:a,hi:r}=yn(e,"pos",t)),{pos:s,time:l}=e[a],{pos:i,time:c}=e[r]):(t>=e[a].time&&t<=e[r].time&&({lo:a,hi:r}=yn(e,"time",t)),{time:s,pos:l}=e[a],{time:i,pos:c}=e[r]);const d=i-s;return d?l+(c-l)*(t-s)/d:l}class Gc extends Ca{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Ba(o,this.min),this._tableRange=Ba(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=t.length;i<l;++i)d=t[i],d>=o&&d<=a&&r.push(d);if(r.length<2)return[{time:o,pos:0},{time:a,pos:1}];for(i=0,l=r.length;i<l;++i)u=r[i+1],c=r[i-1],d=r[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const t=this.min,o=this.max;let a=super.getDataTimestamps();return(!a.includes(t)||!a.length)&&a.splice(0,0,t),(!a.includes(o)||a.length===1)&&a.push(o),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const o=this.getDataTimestamps(),a=this.getLabelTimestamps();return o.length&&a.length?t=this.normalize(o.concat(a)):t=o.length?o:a,t=this._cache.all=t,t}getDecimalForValue(t){return(Ba(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return Ba(this._table,a*this._tableRange+this._minPos,!0)}}me(Gc,"id","timeseries"),me(Gc,"defaults",Ca.defaults);const Eb={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Sb={key:0,class:"text-red-500 ml-1"},Ab={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Vb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Db={class:"text-red-600 text-sm"},Mb={key:1,class:"mt-2 text-xs text-gray-500"},Nb={key:0},Xc=Ct(n.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(e,{expose:t,emit:o}){Ht.register(ss,is,ba,an,ya,Eo,lb,gb,sb,eb,ia,sa,qr,In);const a=e,r=o,s=n.ref(null),i=n.shallowRef(null),l=n.ref(null),c=n.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),d=()=>{const h=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:a.type!=="pie"&&a.type!=="doughnut"&&a.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,p)=>{const b=p%a.colors.length,y=a.colors[b];let g=m.backgroundColor,B=m.borderColor;return["pie","doughnut","polarArea"].includes(a.type)&&(!g||g.length===0)?m.data&&(g=m.data.map((w,C)=>a.colors[C%a.colors.length]+"80"),B=m.data.map((w,C)=>a.colors[C%a.colors.length])):(g=g||y+"40",B=B||y),{...m,borderColor:B,backgroundColor:g,pointBackgroundColor:m.pointBackgroundColor||y,pointBorderColor:m.pointBorderColor||y,hoverBackgroundColor:m.hoverBackgroundColor||y+"60",hoverBorderColor:m.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await n.nextTick(),i.value&&i.value.destroy();const h=a.data||a.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const b=Object.keys(h[0]),y=b.find(B=>["label","name","x","category","title"].includes(B.toLowerCase()))||b[0],g=b.find(B=>B!==y&&["value","y","count","amount","total","data"].includes(B.toLowerCase()))||b.find(B=>B!==y&&typeof h[0][B]=="number")||(b.length>1?b.find(B=>B!==y):b[0]);m={labels:h.map(B=>B[y||""]),datasets:[{label:a.label||"Data",data:h.map(B=>B[g||""])}]}}else h.length>0?m={labels:h.map((b,y)=>`Data ${y+1}`),datasets:[{label:a.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...a.options,onClick:(b,y)=>{r("click",b,y),a.onClick&&a.onClick(b,y)},onHover:(b,y)=>{r("hover",b,y),a.onHover&&a.onHover(b,y)}};i.value=new Ht(s.value,{type:a.type,data:l.value,options:p}),r("ready",i.value)};return n.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{f()},{deep:!0}),n.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),n.onMounted(()=>{f()}),n.onUnmounted(()=>{i.value&&i.value.destroy()}),t({chart:i,updateChart:f}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["d-code-chart",c.value])},[e.label?(n.openBlock(),n.createElementBlock("div",Eb,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Sb,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"relative",style:n.normalizeStyle({height:e.height+"px"})},[n.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),e.loading?(n.openBlock(),n.createElementBlock("div",Ab,[...m[0]||(m[0]=[n.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):n.createCommentVNode("",!0),e.error?(n.openBlock(),n.createElementBlock("div",Vb,[n.createElementVNode("div",Db,n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0)],4),e.showInfo&&l.value?(n.openBlock(),n.createElementBlock("div",Mb,[l.value.datasets?(n.openBlock(),n.createElementBlock("div",Nb,n.toDisplayString(l.value.datasets.length)+" dataset(s) • "+n.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Pb=["aria-busy"],vb={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Tb={key:1,class:"flex items-center gap-2.5"},Ob=["id","checked","indeterminate","disabled","required"],zb=["for"],Fb={key:0,class:"ml-1 text-red-500 dark:text-red-400","aria-label":"required"},sn=Ct(n.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>o.placeholder),l=n.computed(()=>o.title),c=n.computed(()=>r.visible??!0),d=n.computed(()=>o.required===""||o.required===!0||o.required==="true"),u=Math.random().toString(36).slice(2,7),f=n.computed(()=>`dcode-checkbox-${o.id||s.value||"checkbox"}-${u}`),h=n.ref(!!r.modelValue);n.watch(()=>r.modelValue,b=>{h.value=!!b},{immediate:!0});const m=()=>{if(r.disabled)return;const b=!h.value;h.value=b,a("update:modelValue",b)},p=b=>{(b.key===" "||b.key==="Enter")&&(b.preventDefault(),m())};return(b,y)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["",[n.unref(o).class,{"opacity-60 cursor-not-allowed":e.disabled}]]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",vb)):n.createCommentVNode("",!0),y[0]||(y[0]=n.createElementVNode("div",{class:"flex items-center gap-2.5"},[n.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),n.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(n.openBlock(),n.createElementBlock("div",Tb,[n.createElementVNode("label",{class:n.normalizeClass(["flex items-start gap-2.5 group relative",{"cursor-pointer":!e.disabled,"opacity-50 cursor-not-allowed":e.disabled}])},[n.createElementVNode("input",{type:"checkbox",id:f.value,class:"sr-only peer",checked:h.value,indeterminate:e.indeterminate,disabled:e.disabled,required:d.value,onChange:m,onKeydown:p},null,40,Ob),n.createElementVNode("div",{class:n.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center mt-0.5",[h.value||e.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",e.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[h.value&&!e.indeterminate?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):e.indeterminate?(n.openBlock(),n.createBlock(n.unref(ae.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):n.createCommentVNode("",!0)],2),i.value||l.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[e.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},n.toDisplayString(i.value||l.value),3)):n.createCommentVNode("",!0)],2),s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:f.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300 select-none cursor-pointer"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",Fb," * ")):n.createCommentVNode("",!0)],8,zb)):n.createCommentVNode("",!0)]))],10,Pb)),[[n.vShow,c.value]])}}),[["__scopeId","data-v-fedb92bf"]]),Rb=["aria-busy"],Ib={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Lb={key:1,class:"flex justify-end"},$b=["for"],Wb={key:0,class:"ml-1 text-destructive"},jb={class:"relative w-full group"},Ub={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Hb={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},qb=["id","disabled","readonly","placeholder","maxlength"],Gb={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},Xb={key:1,class:"flex items-center gap-1 text-xs text-destructive"},ls=n.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`app-currency-field-${o.id||r.label||"currency-field"}-${s}`),l=n.computed(()=>{const M=o.required,V=o["aria-required"];return M===""||M===!0||M==="true"||(V==="true"||V===!0)}),c=n.computed(()=>{const M=o.maxlength??o.maxLength;let V=Number.NaN;return typeof M=="number"?V=M:typeof M=="string"&&(V=Number.parseInt(M,10)),Number.isFinite(V)&&V>0?V:void 0}),d=n.computed(()=>r.locale?r.locale:"en-US"),u=n.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=n.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=M=>{const V=M.replaceAll(/\D/g,"");return V?Number(V):null},m=M=>f.value.format(M),p=n.ref(""),b=n.ref(null);n.watch(()=>r.modelValue,M=>{M==null?p.value="":h(p.value)!==M&&(p.value=m(M))},{immediate:!0});const y=(M,V)=>{let N=0;for(let T=0;T<V;T++)/\d/.test(M[T])&&N++;return N},g=(M,V)=>{let N=0;for(let T=0;T<M.length;T++)if(/\d/.test(M[T])&&(N++,N===V))return T+1;return M.length},B=M=>{const V=M.target,N=V.value,T=V.selectionStart??N.length,K=h(N);if(K===null){p.value="",a("update:modelValue",null);return}const R=m(K);if(N!==R){const I=y(N,T);p.value=R,n.nextTick(()=>{if(b.value){const q=g(R,I);b.value.setSelectionRange(q,q)}})}a("update:modelValue",K)},w=()=>{p.value="",a("update:modelValue",null),a("clear")},C=n.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?p.value.length>0:!0),E=n.computed(()=>!!r.error),_=n.computed(()=>{const{class:M,maxlength:V,maxLength:N,...T}=o;return T}),k=n.computed(()=>p.value.length),x=n.computed(()=>r.showCharCount?(c.value??0)>0:!1),A=n.computed(()=>x.value&&k.value>0),D=n.computed(()=>`${k.value} / ${c.value}`);return(M,V)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1.5 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Ib)):n.createCommentVNode("",!0),V[2]||(V[2]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),x.value?(n.openBlock(),n.createElementBlock("div",Lb,[...V[1]||(V[1]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Wb,"*")):n.createCommentVNode("",!0)],8,$b)):n.createCommentVNode("",!0),n.createElementVNode("div",jb,[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",E.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",r.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[n.createElementVNode("div",Ub,[n.createElementVNode("span",Hb,n.toDisplayString(u.value),1)]),n.withDirectives(n.createElementVNode("input",n.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":V[0]||(V[0]=N=>p.value=N),onInput:B,type:"text",inputmode:"numeric"},_.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",C.value?"pr-8":""]}),null,16,qb),[[n.vModelText,p.value]]),C.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:w},[n.createVNode(n.unref(ae.X),{class:"w-3.5 h-3.5"})])):n.createCommentVNode("",!0)],2),A.value&&!E.value?(n.openBlock(),n.createElementBlock("p",Gb,n.toDisplayString(D.value),1)):n.createCommentVNode("",!0)]),E.value?(n.openBlock(),n.createElementBlock("p",Xb,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(r.error),1)])):n.createCommentVNode("",!0)],64))],10,Rb))}}),Yc=6048e5,Yb=864e5,Kc=Symbol.for("constructDateFrom");function ln(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kc in e?e[Kc](t):e instanceof Date?new e.constructor(t):new Date(t)}function Bt(e,t){return ln(t||e,e)}let Kb={};function _a(){return Kb}function Ao(e,t){var l,c,d,u;const o=_a(),a=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=Bt(e,t==null?void 0:t.in),s=r.getDay(),i=(s<a?7:0)+s-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Ea(e,t){return Ao(e,{...t,weekStartsOn:1})}function Jc(e,t){const o=Bt(e,t==null?void 0:t.in),a=o.getFullYear(),r=ln(o,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=Ea(r),i=ln(o,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=Ea(i);return o.getTime()>=s.getTime()?a+1:o.getTime()>=l.getTime()?a:a-1}function Qc(e){const t=Bt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function Jb(e,...t){const o=ln.bind(null,t.find(a=>typeof a=="object"));return t.map(o)}function Zc(e,t){const o=Bt(e,t==null?void 0:t.in);return o.setHours(0,0,0,0),o}function Qb(e,t,o){const[a,r]=Jb(o==null?void 0:o.in,e,t),s=Zc(a),i=Zc(r),l=+s-Qc(s),c=+i-Qc(i);return Math.round((l-c)/Yb)}function Zb(e,t){const o=Jc(e,t),a=ln(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Ea(a)}function ey(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ty(e){return!(!ey(e)&&typeof e!="number"||isNaN(+Bt(e)))}function ny(e,t){const o=Bt(e,t==null?void 0:t.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const oy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ay=(e,t,o)=>{let a;const r=oy[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function Wn(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const ry={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},iy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ly={date:Wn({formats:ry,defaultWidth:"full"}),time:Wn({formats:sy,defaultWidth:"full"}),dateTime:Wn({formats:iy,defaultWidth:"full"})},cy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dy=(e,t,o,a)=>cy[e];function vt(e){return(t,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;r=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;r=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const uy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},my={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},py={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},by={ordinalNumber:(e,t)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:vt({values:uy,defaultWidth:"wide"}),quarter:vt({values:fy,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vt({values:hy,defaultWidth:"wide"}),day:vt({values:my,defaultWidth:"wide"}),dayPeriod:vt({values:py,defaultWidth:"wide",formattingValues:gy,defaultFormattingWidth:"wide"})};function Tt(e){return(t,o={})=>{const a=o.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const i=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?xy(l,f=>f.test(i)):yy(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=t.slice(i.length);return{value:d,rest:u}}}function yy(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function xy(e,t){for(let o=0;o<e.length;o++)if(t(e[o]))return o}function ed(e){return(t,o={})=>{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=t.slice(r.length);return{value:i,rest:l}}}const ky=/^(\d+)(th|st|nd|rd)?/i,wy=/\d+/i,Cy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},By={any:[/^b/i,/^(a|c)/i]},_y={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ey={any:[/1/i,/2/i,/3/i,/4/i]},Sy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ay={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Vy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Dy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},My={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ny={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Py={ordinalNumber:ed({matchPattern:ky,parsePattern:wy,valueCallback:e=>parseInt(e,10)}),era:Tt({matchPatterns:Cy,defaultMatchWidth:"wide",parsePatterns:By,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:_y,defaultMatchWidth:"wide",parsePatterns:Ey,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tt({matchPatterns:Sy,defaultMatchWidth:"wide",parsePatterns:Ay,defaultParseWidth:"any"}),day:Tt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:Dy,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:My,defaultMatchWidth:"any",parsePatterns:Ny,defaultParseWidth:"any"})},td={code:"en-US",formatDistance:ay,formatLong:ly,formatRelative:dy,localize:by,match:Py,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vy(e,t){const o=Bt(e,t==null?void 0:t.in);return Qb(o,ny(o))+1}function Ty(e,t){const o=Bt(e,t==null?void 0:t.in),a=+Ea(o)-+Zb(o);return Math.round(a/Yc)+1}function nd(e,t){var u,f,h,m;const o=Bt(e,t==null?void 0:t.in),a=o.getFullYear(),r=_a(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=ln((t==null?void 0:t.in)||e,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=Ao(i,t),c=ln((t==null?void 0:t.in)||e,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=Ao(c,t);return+o>=+l?a+1:+o>=+d?a:a-1}function Oy(e,t){var l,c,d,u;const o=_a(),a=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=nd(e,t),s=ln((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),Ao(s,t)}function zy(e,t){const o=Bt(e,t==null?void 0:t.in),a=+Ao(o,t)-+Oy(o,t);return Math.round(a/Yc)+1}function Te(e,t){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return o+a}const cn={y(e,t){const o=e.getFullYear(),a=o>0?o:1-o;return Te(t==="yy"?a%100:a,t.length)},M(e,t){const o=e.getMonth();return t==="M"?String(o+1):Te(o+1,2)},d(e,t){return Te(e.getDate(),t.length)},a(e,t){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(e,t){return Te(e.getHours()%12||12,t.length)},H(e,t){return Te(e.getHours(),t.length)},m(e,t){return Te(e.getMinutes(),t.length)},s(e,t){return Te(e.getSeconds(),t.length)},S(e,t){const o=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,o-3));return Te(r,t.length)}},jn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},od={G:function(e,t,o){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return o.ordinalNumber(r,{unit:"year"})}return cn.y(e,t)},Y:function(e,t,o,a){const r=nd(e,a),s=r>0?r:1-r;if(t==="YY"){const i=s%100;return Te(i,2)}return t==="Yo"?o.ordinalNumber(s,{unit:"year"}):Te(s,t.length)},R:function(e,t){const o=Jc(e);return Te(o,t.length)},u:function(e,t){const o=e.getFullYear();return Te(o,t.length)},Q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Te(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Te(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,o){const a=e.getMonth();switch(t){case"M":case"MM":return cn.M(e,t);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,o){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Te(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,o,a){const r=zy(e,a);return t==="wo"?o.ordinalNumber(r,{unit:"week"}):Te(r,t.length)},I:function(e,t,o){const a=Ty(e);return t==="Io"?o.ordinalNumber(a,{unit:"week"}):Te(a,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):cn.d(e,t)},D:function(e,t,o){const a=vy(e);return t==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):Te(a,t.length)},E:function(e,t,o){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(a,{width:"short",context:"formatting"});case"EEEE":default:return o.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Te(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Te(s,t.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,o){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Te(r,t.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,o){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,o){const a=e.getHours();let r;switch(a===12?r=jn.noon:a===0?r=jn.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,o){const a=e.getHours();let r;switch(a>=17?r=jn.evening:a>=12?r=jn.afternoon:a>=4?r=jn.morning:r=jn.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return cn.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):cn.H(e,t)},K:function(e,t,o){const a=e.getHours()%12;return t==="Ko"?o.ordinalNumber(a,{unit:"hour"}):Te(a,t.length)},k:function(e,t,o){let a=e.getHours();return a===0&&(a=24),t==="ko"?o.ordinalNumber(a,{unit:"hour"}):Te(a,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):cn.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):cn.s(e,t)},S:function(e,t){return cn.S(e,t)},X:function(e,t,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return rd(a);case"XXXX":case"XX":return An(a);case"XXXXX":case"XXX":default:return An(a,":")}},x:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"x":return rd(a);case"xxxx":case"xx":return An(a);case"xxxxx":case"xxx":default:return An(a,":")}},O:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ad(a,":");case"OOOO":default:return"GMT"+An(a,":")}},z:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ad(a,":");case"zzzz":default:return"GMT"+An(a,":")}},t:function(e,t,o){const a=Math.trunc(+e/1e3);return Te(a,t.length)},T:function(e,t,o){return Te(+e,t.length)}};function ad(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),s=a%60;return s===0?o+String(r):o+String(r)+t+Te(s,2)}function rd(e,t){return e%60===0?(e>0?"-":"+")+Te(Math.abs(e)/60,2):An(e,t)}function An(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Te(Math.trunc(a/60),2),s=Te(a%60,2);return o+r+t+s}const sd=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},id=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Fy={p:id,P:(e,t)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],r=o[2];if(!r)return sd(e,t);let s;switch(a){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",sd(a,t)).replace("{{time}}",id(r,t))}},Ry=/^D+$/,Iy=/^Y+$/,Ly=["D","DD","YY","YYYY"];function $y(e){return Ry.test(e)}function Wy(e){return Iy.test(e)}function jy(e,t,o){const a=Uy(e,t,o);if(console.warn(a),Ly.includes(e))throw new RangeError(a)}function Uy(e,t,o){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Hy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gy=/^'([^]*?)'?$/,Xy=/''/g,Yy=/[a-zA-Z]/;function ld(e,t,o){var u,f,h,m;const a=_a(),r=a.locale??td,s=a.firstWeekContainsDate??((f=(u=a.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=a.weekStartsOn??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Bt(e,o==null?void 0:o.in);if(!ty(l))throw new RangeError("Invalid time value");let c=t.match(qy).map(p=>{const b=p[0];if(b==="p"||b==="P"){const y=Fy[b];return y(p,r.formatLong)}return p}).join("").match(Hy).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const b=p[0];if(b==="'")return{isToken:!1,value:Ky(p)};if(od[b])return{isToken:!0,value:p};if(b.match(Yy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const b=p.value;(Wy(b)||$y(b))&&jy(b,t,String(e));const y=od[b[0]];return y(l,b,r.localize,d)}).join("")}function Ky(e){const t=e.match(Gy);return t?t[1].replace(Xy,"'"):e}const Jy={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},Qy=(e,t,o)=>{let a;const r=Jy[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+a:a+" yang lalu":a},Zy={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},ex={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},tx={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nx={date:Wn({formats:Zy,defaultWidth:"full"}),time:Wn({formats:ex,defaultWidth:"full"}),dateTime:Wn({formats:tx,defaultWidth:"full"})},ox={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},ax=(e,t,o,a)=>ox[e],rx={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},sx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},ix={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},lx={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},cx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},dx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},ux={ordinalNumber:(e,t)=>"ke-"+Number(e),era:vt({values:rx,defaultWidth:"wide"}),quarter:vt({values:sx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vt({values:ix,defaultWidth:"wide"}),day:vt({values:lx,defaultWidth:"wide"}),dayPeriod:vt({values:cx,defaultWidth:"wide",formattingValues:dx,defaultFormattingWidth:"wide"})},fx=/^ke-(\d+)?/i,hx=/\d+/i,mx={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},px={any:[/^s/i,/^(m|e)/i]},gx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},bx={any:[/1/i,/2/i,/3/i,/4/i]},yx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},xx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},kx={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},wx={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},Cx={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Bx={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},_x={ordinalNumber:ed({matchPattern:fx,parsePattern:hx,valueCallback:e=>parseInt(e,10)}),era:Tt({matchPatterns:mx,defaultMatchWidth:"wide",parsePatterns:px,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:gx,defaultMatchWidth:"wide",parsePatterns:bx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tt({matchPatterns:yx,defaultMatchWidth:"wide",parsePatterns:xx,defaultParseWidth:"any"}),day:Tt({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:wx,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:Cx,defaultMatchWidth:"any",parsePatterns:Bx,defaultParseWidth:"any"})},Ex={code:"id",formatDistance:Qy,formatLong:nx,formatRelative:ax,localize:ux,match:_x,options:{weekStartsOn:1,firstWeekContainsDate:1}},cd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},dd="dcode-dp-theme-forced";function Sx(e,t=dd){const o=cd[e]??cd.primary,a=`
|
|
18
|
+
`):e}function rb(e,n){const{element:o,datasetIndex:a,index:r}=n,s=e.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:e,label:i,parsed:s.getParsed(r),raw:e.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:o}}function zc(e,n){const o=e.chart.ctx,{body:a,footer:r,title:s}=e,{boxWidth:i,boxHeight:l}=n,c=at(n.bodyFont),d=at(n.titleFont),u=at(n.footerFont),f=s.length,h=r.length,m=a.length,p=bt(n.padding);let x=p.height,y=0,g=a.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,f&&(x+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),g){const C=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;x+=m*C+(g-m)*c.lineHeight+(g-1)*n.bodySpacing}h&&(x+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let B=0;const k=function(C){y=Math.max(y,o.measureText(C).width+B)};return o.save(),o.font=d.string,Pe(e.title,k),o.font=c.string,Pe(e.beforeBody.concat(e.afterBody),k),B=n.displayColors?i+2+n.boxPadding:0,Pe(a,C=>{Pe(C.before,k),Pe(C.lines,k),Pe(C.after,k)}),B=0,o.font=u.string,Pe(e.footer,k),o.restore(),y+=p.width,{width:y,height:x}}function sb(e,n){const{y:o,height:a}=n;return o<a/2?"top":o>e.height-a/2?"bottom":"center"}function ib(e,n,o,a){const{x:r,width:s}=a,i=o.caretSize+o.caretPadding;if(e==="left"&&r+s+i>n.width||e==="right"&&r-s-i<0)return!0}function lb(e,n,o,a){const{x:r,width:s}=o,{width:i,chartArea:{left:l,right:c}}=e;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),ib(d,e,n,o)&&(d="center"),d}function Fc(e,n,o){const a=o.yAlign||n.yAlign||sb(e,o);return{xAlign:o.xAlign||n.xAlign||lb(e,n,o,a),yAlign:a}}function cb(e,n){let{x:o,width:a}=e;return n==="right"?o-=a:n==="center"&&(o-=a/2),o}function db(e,n,o){let{y:a,height:r}=e;return n==="top"?a+=o:n==="bottom"?a-=r+o:a-=r/2,a}function Rc(e,n,o,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=e,{xAlign:l,yAlign:c}=o,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=zn(i);let p=cb(n,l);const x=db(n,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+r:l==="right"&&(p+=Math.max(f,m)+r),{x:nt(p,0,a.width-n.width),y:nt(x,0,a.height-n.height)}}function Ca(e,n,o){const a=bt(o.padding);return n==="center"?e.x+e.width/2:n==="right"?e.x+e.width-a.right:e.x+a.left}function Ic(e){return Nt([],qt(e))}function ub(e,n,o){return Cn(e,{tooltip:n,tooltipItems:o,type:"tooltip"})}function Lc(e,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?e.override(o):e}const $c={beforeTitle:Lt,title(e){if(e.length>0){const n=e[0],o=n.chart.data.labels,a=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(a>0&&n.dataIndex<a)return o[n.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let n=e.dataset.label||"";n&&(n+=": ");const o=e.formattedValue;return Ne(o)||(n+=o),n},labelColor(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function lt(e,n,o,a){const r=e[n].call(o,a);return typeof r>"u"?$c[n].call(o,a):r}class is extends Ut{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&o.options.animation&&a.animations,s=new zl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ub(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:a}=o,r=lt(a,"beforeTitle",this,n),s=lt(a,"title",this,n),i=lt(a,"afterTitle",this,n);let l=[];return l=Nt(l,qt(r)),l=Nt(l,qt(s)),l=Nt(l,qt(i)),l}getBeforeBody(n,o){return Ic(lt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:a}=o,r=[];return Pe(n,s=>{const i={before:[],lines:[],after:[]},l=Lc(a,s);Nt(i.before,qt(lt(l,"beforeLabel",this,s))),Nt(i.lines,lt(l,"label",this,s)),Nt(i.after,qt(lt(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(n,o){return Ic(lt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:a}=o,r=lt(a,"beforeFooter",this,n),s=lt(a,"footer",this,n),i=lt(a,"afterFooter",this,n);let l=[];return l=Nt(l,qt(r)),l=Nt(l,qt(s)),l=Nt(l,qt(i)),l}_createItems(n){const o=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(rb(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,a))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,a))),Pe(l,u=>{const f=Lc(n.callbacks,u);r.push(lt(f,"labelColor",this,u)),s.push(lt(f,"labelPointStyle",this,u)),i.push(lt(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const a=this.options.setContext(this.getContext()),r=this._active;let s,i=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Ao[a.position].call(this,r,this._eventPosition);i=this._createItems(a),this.title=this.getTitle(i,a),this.beforeBody=this.getBeforeBody(i,a),this.body=this.getBody(i,a),this.afterBody=this.getAfterBody(i,a),this.footer=this.getFooter(i,a);const c=this._size=zc(this,a),d=Object.assign({},l,c),u=Fc(this.chart,a,d),f=Rc(a,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,a,r){const s=this.getCaretPosition(n,a,r);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=zn(l),{x:h,y:m}=n,{width:p,height:x}=o;let y,g,B,k,C,E;return s==="center"?(C=m+x/2,r==="left"?(y=h,g=y-i,k=C+i,E=C-i):(y=h+p,g=y+i,k=C-i,E=C+i),B=y):(r==="left"?g=h+Math.max(c,u)+i:r==="right"?g=h+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(k=m,C=k-i,y=g-i,B=g+i):(k=m+x,C=k+i,y=g+i,B=g-i),E=k),{x1:y,x2:g,x3:B,y1:k,y2:C,y3:E}}drawTitle(n,o,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=In(a.rtl,this.x,this.width);for(n.x=Ca(this,a.titleAlign,a),o.textAlign=d.textAlign(a.titleAlign),o.textBaseline="middle",i=at(a.titleFont),l=a.titleSpacing,o.fillStyle=a.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(r[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=a.titleMarginBottom-l)}}_drawColorBox(n,o,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=at(s.bodyFont),f=Ca(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+m;if(s.usePointStyle){const x={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=r.leftForLtr(h,d)+d/2,g=p+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Fr(n,x,y,g),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Fr(n,x,y,g)}else{n.lineWidth=Se(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const x=r.leftForLtr(h,d),y=r.leftForLtr(r.xPlus(h,1),d-2),g=zn(i.borderRadius);Object.values(g).some(B=>B!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,na(n,{x,y:p,w:d,h:c,radius:g}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),na(n,{x:y,y:p+1,w:d-2,h:c-2,radius:g}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(x,p,d,c),n.strokeRect(x,p,d,c),n.fillStyle=i.backgroundColor,n.fillRect(y,p+1,d-2,c-2))}n.fillStyle=this.labelTextColors[a]}drawBody(n,o,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=at(a.bodyFont);let h=f.lineHeight,m=0;const p=In(a.rtl,this.x,this.width),x=function(b){o.fillText(b,p.x(n.x+m),n.y+h/2),n.y+=h+s},y=p.textAlign(i);let g,B,k,C,E,_,w;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Ca(this,y,a),o.fillStyle=a.bodyColor,Pe(this.beforeBody,x),m=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,C=0,_=r.length;C<_;++C){for(g=r[C],B=this.labelTextColors[C],o.fillStyle=B,Pe(g.before,x),k=g.lines,l&&k.length&&(this._drawColorBox(o,n,C,p,a),h=Math.max(f.lineHeight,c)),E=0,w=k.length;E<w;++E)x(k[E]),h=f.lineHeight;Pe(g.after,x)}m=0,h=f.lineHeight,Pe(this.afterBody,x),n.y-=s}drawFooter(n,o,a){const r=this.footer,s=r.length;let i,l;if(s){const c=In(a.rtl,this.x,this.width);for(n.x=Ca(this,a.footerAlign,a),n.y+=a.footerMarginTop,o.textAlign=c.textAlign(a.footerAlign),o.textBaseline="middle",i=at(a.footerFont),o.fillStyle=a.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(r[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+a.footerSpacing}}drawBackground(n,o,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=zn(r.cornerRadius);o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,a,r),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,a,r),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(n,o,a,r),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,a,r),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),r.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=Ao[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=zc(this,n),c=Object.assign({},i,this._size),d=Fc(o,n,c),u=Rc(n,c,d,o);(r._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(o);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=bt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=a,this.drawBackground(s,n,r,o),Sl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),Al(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const a=this._active,r=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!Ko(a,r),i=this._positionChanged(r,o);(s||i)&&(this._active=r,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,a=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,a),l=this._positionChanged(i,n),c=o||!Ko(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,a,r){const s=this.options;if(n.type==="mouseout")return[];if(!r)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:a,caretY:r,options:s}=this,i=Ao[s.position].call(this,n,o);return i!==!1&&(a!==i.x||r!==i.y)}}me(is,"positioners",Ao);var fb={id:"tooltip",_element:is,positioners:Ao,afterInit(e,n,o){o&&(e.tooltip=new is({chart:e,options:o}))},beforeUpdate(e,n,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,n,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const n=e.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,n){if(e.tooltip){const o=n.replay;e.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,n)=>n.bodyFont.size,boxWidth:(e,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$c},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const hb=(e,n,o,a)=>(typeof n=="string"?(o=e.push(n)-1,a.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function mb(e,n,o,a){const r=e.indexOf(n);if(r===-1)return hb(e,n,o,a);const s=e.lastIndexOf(n);return r!==s?o:r}const pb=(e,n)=>e===null?null:nt(Math.round(e),0,n);function Wc(e){const n=this.getLabels();return e>=0&&e<n.length?n[e]:e}class ls extends $n{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const a=this.getLabels();for(const{index:r,label:s}of o)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(Ne(n))return null;const a=this.getLabels();return o=isFinite(o)&&a[o]===n?o:mb(a,n,Be(o,n),this._addedLabels),pb(o,a.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(a=0),o||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const n=this.min,o=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=n;i<=o;i++)r.push({value:i});return r}getLabelForValue(n){return Wc.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}me(ls,"id","category"),me(ls,"defaults",{ticks:{callback:Wc}});function gb(e,n){const o=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=e,m=s||1,p=u-1,{min:x,max:y}=n,g=!Ne(i),B=!Ne(l),k=!Ne(d),C=(y-x)/(f+1);let E=el((y-x)/p/m)*m,_,w,b,A;if(E<1e-14&&!g&&!B)return[{value:x},{value:y}];A=Math.ceil(y/E)-Math.floor(x/E),A>p&&(E=el(A*E/p/m)*m),Ne(c)||(_=Math.pow(10,c),E=Math.ceil(E*_)/_),r==="ticks"?(w=Math.floor(x/E)*E,b=Math.ceil(y/E)*E):(w=x,b=y),g&&B&&s&&xm((l-i)/s,E/1e3)?(A=Math.round(Math.min((l-i)/E,u)),E=(l-i)/A,w=i,b=l):k?(w=g?i:w,b=B?l:b,A=d-1,E=(b-w)/A):(A=(b-w)/E,fo(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const D=Math.max(tl(E),tl(w));_=Math.pow(10,Ne(c)?D:c),w=Math.round(w*_)/_,b=Math.round(b*_)/_;let M=0;for(g&&(h&&w!==i?(o.push({value:i}),w<i&&M++,fo(Math.round((w+M*E)*_)/_,i,jc(i,C,e))&&M++):w<i&&M++);M<A;++M){const V=Math.round((w+M*E)*_)/_;if(B&&V>l)break;o.push({value:V})}return B&&h&&b!==l?o.length&&fo(o[o.length-1].value,l,jc(l,C,e))?o[o.length-1].value=l:o.push({value:l}):(!B||b===l)&&o.push({value:b}),o}function jc(e,n,{horizontal:o,minRotation:a}){const r=$t(a),s=(o?Math.sin(r):Math.cos(r))||.001,i=.75*n*(""+e).length;return Math.min(n/s,i)}class bb extends $n{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return Ne(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=o?r:c,l=c=>s=a?s:c;if(n){const c=Dt(r),d=Dt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(r-c)}this.min=r,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:a}=n,r;return a?(r=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),o=o||11),o&&(r=Math.min(o,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=gb(r,s);return n.bounds==="ticks"&&km(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,a=this.max;if(super.configure(),this.options.offset&&n.length){const r=(a-o)/Math.max(n.length-1,1)/2;o-=r,a+=r}this._startValue=o,this._endValue=a,this._valueRange=a-o}getLabelForValue(n){return Tr(n,this.chart.options.locale,this.options.ticks.format)}}class cs extends bb{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=tt(n)?n:0,this.max=tt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,a=$t(this.options.ticks.minRotation),r=(n?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/r))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}me(cs,"id","linear"),me(cs,"defaults",{ticks:{callback:fl.formatters.numeric}});const Ba={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ct=Object.keys(Ba);function Uc(e,n){return e-n}function Hc(e,n){if(Ne(n))return null;const o=e._adapter,{parser:a,round:r,isoWeekday:s}=e._parseOpts;let i=n;return typeof a=="function"&&(i=a(i)),tt(i)||(i=typeof a=="string"?o.parse(i,a):o.parse(i)),i===null?null:(r&&(i=r==="week"&&(ho(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,r)),+i)}function qc(e,n,o,a){const r=ct.length;for(let s=ct.indexOf(e);s<r-1;++s){const i=Ba[ct[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=a)return ct[s]}return ct[r-1]}function yb(e,n,o,a,r){for(let s=ct.length-1;s>=ct.indexOf(o);s--){const i=ct[s];if(Ba[i].common&&e._adapter.diff(r,a,i)>=n-1)return i}return ct[o?ct.indexOf(o):0]}function xb(e){for(let n=ct.indexOf(e)+1,o=ct.length;n<o;++n)if(Ba[ct[n]].common)return ct[n]}function Gc(e,n,o){if(!o)e[n]=!0;else if(o.length){const{lo:a,hi:r}=Mr(o,n),s=o[a]>=n?o[a]:o[r];e[s]=!0}}function kb(e,n,o,a){const r=e._adapter,s=+r.startOf(n[0].value,a),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=o[l],c>=0&&(n[c].major=!0);return n}function Xc(e,n,o){const a=[],r={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],r[l]=i,a.push({value:l,major:!1});return s===0||!o?a:kb(e,a,r,o)}class _a extends $n{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const a=n.time||(n.time={}),r=this._adapter=new ng._date(n.adapters.date);r.init(o),co(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Hc(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,a=n.time.unit||"day";let{min:r,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=tt(r)&&!isNaN(r)?r:+o.startOf(Date.now(),a),s=tt(s)&&!isNaN(s)?s:+o.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],a=n[n.length-1]),{min:o,max:a}}buildTicks(){const n=this.options,o=n.time,a=n.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,i=this.max,l=Em(r,s,i);return this._unit=o.unit||(a.autoSkip?qc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):yb(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:xb(this._unit),this.initOffsets(r),n.reverse&&l.reverse(),Xc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,a=0,r,s;this.options.offset&&n.length&&(r=this.getDecimalForValue(n[0]),n.length===1?o=1-r:o=(this.getDecimalForValue(n[1])-r)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?a=s:a=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=nt(o,0,i),a=nt(a,0,i),this._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const n=this._adapter,o=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||qc(s.minUnit,o,a,this._getLabelCapacity(o)),l=Be(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=ho(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(a,o,i)>1e5*l)throw new Error(o+" and "+a+" are too far apart with stepSize of "+l+" "+i);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+n.add(h,l,i),m++)Gc(u,h,p);return(h===a||r.bounds==="ticks"||m===1)&&Gc(u,h,p),Object.keys(u).sort(Uc).map(x=>+x)}getLabelForValue(n){const o=this._adapter,a=this.options.time;return a.tooltipFormat?o.format(n,a.tooltipFormat):o.format(n,a.displayFormats.datetime)}format(n,o){const r=this.options.time.displayFormats,s=this._unit,i=o||r[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,a,r){const s=this.options,i=s.ticks.callback;if(i)return Ie(i,[n,o,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[o],m=d&&f&&h&&h.major;return this._adapter.format(n,r||(m?f:u))}generateTickLabels(n){let o,a,r;for(o=0,a=n.length;o<a;++o)r=n[o],r.label=this._tickFormatFunction(r.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,a=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+a)*o.factor)}getValueForPixel(n){const o=this._offsets,a=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+a*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,a=this.ctx.measureText(n).width,r=$t(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(r),i=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:a*s+l*i,h:a*i+l*s}}_getLabelCapacity(n){const o=this.options.time,a=o.displayFormats,r=a[o.unit]||a.millisecond,s=this._tickFormatFunction(n,0,Xc(this,[n],this._majorUnit),r),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,a;if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(o=0,a=r.length;o<a;++o)n=n.concat(r[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,a;if(n.length)return n;const r=this.getLabels();for(o=0,a=r.length;o<a;++o)n.push(Hc(this,r[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return rl(n.sort(Uc))}}me(_a,"id","time"),me(_a,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ea(e,n,o){let a=0,r=e.length-1,s,i,l,c;o?(n>=e[a].pos&&n<=e[r].pos&&({lo:a,hi:r}=xn(e,"pos",n)),{pos:s,time:l}=e[a],{pos:i,time:c}=e[r]):(n>=e[a].time&&n<=e[r].time&&({lo:a,hi:r}=xn(e,"time",n)),{time:s,pos:l}=e[a],{time:i,pos:c}=e[r]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class Yc extends _a{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=Ea(o,this.min),this._tableRange=Ea(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=a&&r.push(d);if(r.length<2)return[{time:o,pos:0},{time:a,pos:1}];for(i=0,l=r.length;i<l;++i)u=r[i+1],c=r[i-1],d=r[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let a=super.getDataTimestamps();return(!a.includes(n)||!a.length)&&a.splice(0,0,n),(!a.includes(o)||a.length===1)&&a.push(o),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),a=this.getLabelTimestamps();return o.length&&a.length?n=this.normalize(o.concat(a)):n=o.length?o:a,n=this._cache.all=n,n}getDecimalForValue(n){return(Ea(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,a=this.getDecimalForPixel(n)/o.factor-o.end;return Ea(this._table,a*this._tableRange+this._minPos,!0)}}me(Yc,"id","timeseries"),me(Yc,"defaults",_a.defaults);const wb={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Cb={key:0,class:"text-red-500 ml-1"},Bb={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},_b={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Eb={class:"text-red-600 text-sm"},Sb={key:1,class:"mt-2 text-xs text-gray-500"},Ab={key:0},Kc=pt(t.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(e,{expose:n,emit:o}){Ht.register(ls,cs,xa,rn,ka,So,ab,fb,nb,K0,ca,la,Xr,Ln);const a=e,r=o,s=t.ref(null),i=t.shallowRef(null),l=t.ref(null),c=t.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),d=()=>{const h=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:a.type!=="pie"&&a.type!=="doughnut"&&a.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,p)=>{const x=p%a.colors.length,y=a.colors[x];let g=m.backgroundColor,B=m.borderColor;return["pie","doughnut","polarArea"].includes(a.type)&&(!g||g.length===0)?m.data&&(g=m.data.map((k,C)=>a.colors[C%a.colors.length]+"80"),B=m.data.map((k,C)=>a.colors[C%a.colors.length])):(g=g||y+"40",B=B||y),{...m,borderColor:B,backgroundColor:g,pointBackgroundColor:m.pointBackgroundColor||y,pointBorderColor:m.pointBorderColor||y,hoverBackgroundColor:m.hoverBackgroundColor||y+"60",hoverBorderColor:m.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await t.nextTick(),i.value&&i.value.destroy();const h=a.data||a.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const x=Object.keys(h[0]),y=x.find(B=>["label","name","x","category","title"].includes(B.toLowerCase()))||x[0],g=x.find(B=>B!==y&&["value","y","count","amount","total","data"].includes(B.toLowerCase()))||x.find(B=>B!==y&&typeof h[0][B]=="number")||(x.length>1?x.find(B=>B!==y):x[0]);m={labels:h.map(B=>B[y||""]),datasets:[{label:a.label||"Data",data:h.map(B=>B[g||""])}]}}else h.length>0?m={labels:h.map((x,y)=>`Data ${y+1}`),datasets:[{label:a.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...a.options,onClick:(x,y)=>{r("click",x,y),a.onClick&&a.onClick(x,y)},onHover:(x,y)=>{r("hover",x,y),a.onHover&&a.onHover(x,y)}};i.value=new Ht(s.value,{type:a.type,data:l.value,options:p}),r("ready",i.value)};return t.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{f()},{deep:!0}),t.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),t.onMounted(()=>{f()}),t.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(h,m)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["d-code-chart",c.value])},[e.label?(t.openBlock(),t.createElementBlock("div",wb,[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",Cb,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"relative",style:t.normalizeStyle({height:e.height+"px"})},[t.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),e.loading?(t.openBlock(),t.createElementBlock("div",Bb,[...m[0]||(m[0]=[t.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):t.createCommentVNode("",!0),e.error?(t.openBlock(),t.createElementBlock("div",_b,[t.createElementVNode("div",Eb,t.toDisplayString(e.error),1)])):t.createCommentVNode("",!0)],4),e.showInfo&&l.value?(t.openBlock(),t.createElementBlock("div",Sb,[l.value.datasets?(t.openBlock(),t.createElementBlock("div",Ab,t.toDisplayString(l.value.datasets.length)+" dataset(s) • "+t.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Vo=t.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.Label),t.mergeProps(t.unref(o),{class:t.unref(Ee)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Vb={class:"grid gap-1.5"},Db={key:0,class:"ml-1 text-destructive"},Mb=["aria-busy"],Nb={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Pb={key:1,class:"flex items-center"},vb=["id","checked","indeterminate","disabled","required"],Gt=pt(t.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:n}){const o=t.useAttrs(),a=n,r=e,s=t.computed(()=>r.visible??!0),i=t.computed(()=>r.required),l=Math.random().toString(36).slice(2,7),c=t.computed(()=>`dcode-checkbox-${r.id||r.label||"checkbox"}-${l}`),d=t.ref(!!r.modelValue);t.watch(()=>r.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(r.disabled)return;const h=!d.value;d.value=h,a("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(t.openBlock(),t.createElementBlock("div",Vb,[e.label?(t.openBlock(),t.createBlock(Vo,{key:0,class:"text-sm font-medium mb-1"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",Db,"*")):t.createCommentVNode("",!0)]),_:1})):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([t.unref(o).class,{"opacity-60 cursor-not-allowed":e.disabled}]),"aria-busy":e.skeleton},[e.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.label?(t.openBlock(),t.createElementBlock("div",Nb)):t.createCommentVNode("",!0),m[0]||(m[0]=t.createElementVNode("div",{class:"flex items-center gap-2.5"},[t.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),t.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(t.openBlock(),t.createElementBlock("div",Pb,[t.createElementVNode("label",{class:t.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!e.disabled,"opacity-50 cursor-not-allowed":e.disabled}])},[t.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:e.indeterminate,disabled:e.disabled,required:i.value,onChange:u,onKeydown:f},null,40,vb),t.createElementVNode("div",{class:t.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||e.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",e.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!e.indeterminate?(t.openBlock(),t.createBlock(t.unref(oe.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):e.indeterminate?(t.openBlock(),t.createBlock(t.unref(oe.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):t.createCommentVNode("",!0)],2),e.title?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[e.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},t.toDisplayString(e.title),3)):t.createCommentVNode("",!0)],2)]))],10,Mb),[[t.vShow,s.value]])]))}}),[["__scopeId","data-v-bc861d9e"]]),Tb={class:"w-full"},Ob={key:0,class:"mb-4"},zb={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Fb={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Rb={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Ib={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Lb={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},Jc=pt(t.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{label:{default:""},items:{default:()=>[]},modelValue:{default:()=>[]},columns:{default:2},skeleton:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:n}){const o=n,a=e,{apiUrl:r}=qe(),s=t.ref(new Set);t.watch(()=>a.modelValue,k=>{if(!k){s.value=new Set;return}const C=k.map(E=>typeof E=="object"&&E!==null?E.id!==void 0?E.id:E.value:E);s.value=new Set(C)},{immediate:!0,deep:!0});const i=t.ref([]),l=t.ref(!1),c=t.ref(null),d=async()=>{var C,E;const k=((C=a.endpoint)==null?void 0:C.apiUrl)||a.apiUrl;if(!(!k&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let _;const w=((E=a.endpoint)==null?void 0:E.apiMethod)||a.apiMethod||"GET",b={page:1,perPage:100,...a.apiParams};if(k)_=await r(k,w,b);else if(a.apiModule&&a.apiAction){const{DCodeApi:D}=qe();_=await D(a.apiModule,a.apiAction,b)}let A=_;a.dataPath?A=a.dataPath.split(".").reduce((M,V)=>M&&M[V]!==void 0?M[V]:void 0,_):typeof _=="object"&&!Array.isArray(_)&&_.data&&(A=_.data),Array.isArray(A)?i.value=A:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(_){console.error("DCodeCardCheckboxList fetch error:",_),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}};t.onMounted(()=>{var k;((k=a.endpoint)!=null&&k.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d()}),t.watch(()=>{var k;return[a.apiUrl,a.apiModule,a.apiAction,(k=a.endpoint)==null?void 0:k.apiUrl]},()=>{d()},{deep:!0});const u=t.computed(()=>a.items&&a.items.length>0?a.items:i.value),f=k=>{if(typeof k!="object"||k===null)return k;const C=a.itemValue||"id";return k[C]},h=k=>{if(typeof k!="object"||k===null)return String(k);const C=a.itemTitle||"name";return k[C]},m=k=>s.value.has(k),p=(k,C)=>{if(a.disabled)return;const E=new Set(s.value);C?E.add(k):E.delete(k),s.value=E;const _=Array.from(s.value);if(a.returnArray)o("update:modelValue",_),o("change",_);else{const w=u.value.filter(b=>E.has(f(b))).map(b=>({id:f(b),title:h(b),value:!0}));o("update:modelValue",w),o("change",w)}},x=t.computed(()=>`grid gap-4 ${{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}[a.columns]}`),y=t.computed(()=>a.skeleton||l.value),g=t.computed(()=>!!c.value),B=t.computed(()=>c.value);return(k,C)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",Tb,[e.label||y.value?(t.openBlock(),t.createElementBlock("div",Ob,[y.value?(t.openBlock(),t.createElementBlock("div",zb)):(t.openBlock(),t.createElementBlock("h3",Fb,t.toDisplayString(e.label),1))])):t.createCommentVNode("",!0),t.createElementVNode("div",null,[l.value?(t.openBlock(),t.createElementBlock("div",Rb,[t.createVNode(t.unref(oe.Loader2),{class:"w-4 h-4 animate-spin"}),C[0]||(C[0]=t.createTextVNode(" Sedang memuat opsi... ",-1))])):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(x.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns*2,E=>(t.openBlock(),t.createElementBlock("div",{key:`skeleton-${E}`,class:"flex items-center gap-2.5"},[...C[1]||(C[1]=[t.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),t.createElementVNode("div",{class:"h-4 flex-1 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])]))),128))],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[u.value.length===0?(t.openBlock(),t.createElementBlock("div",Ib," Tidak ada data ")):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(x.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(E,_)=>(t.openBlock(),t.createElementBlock("div",{key:_,class:"flex items-start"},[t.createVNode(Gt,{"model-value":m(f(E)),title:h(E),disabled:e.disabled,"onUpdate:modelValue":w=>p(f(E),w)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))],2))],64)),g.value&&B.value?(t.openBlock(),t.createElementBlock("div",Lb,[t.createVNode(t.unref(oe.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),t.createTextVNode(" "+t.toDisplayString(B.value),1)])):t.createCommentVNode("",!0)])],512)),[[t.vShow,e.visible]])}}),[["__scopeId","data-v-c40508ed"]]),$b=["aria-busy"],Wb={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jb={key:1,class:"flex justify-end"},Ub=["for"],Hb={key:0,class:"ml-1 text-destructive"},qb={class:"relative w-full group"},Gb={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Xb={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Yb=["id","disabled","readonly","placeholder","maxlength"],Kb={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},Jb={key:1,class:"flex items-center gap-1 text-xs text-destructive"},ds=t.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(e,{emit:n}){const o=t.useAttrs(),a=n,r=e,s=Math.random().toString(36).slice(2,7),i=t.computed(()=>`app-currency-field-${o.id||r.label||"currency-field"}-${s}`),l=t.computed(()=>{const M=o.required,V=o["aria-required"];return M===""||M===!0||M==="true"||(V==="true"||V===!0)}),c=t.computed(()=>{const M=o.maxlength??o.maxLength;let V=Number.NaN;return typeof M=="number"?V=M:typeof M=="string"&&(V=Number.parseInt(M,10)),Number.isFinite(V)&&V>0?V:void 0}),d=t.computed(()=>r.locale?r.locale:"en-US"),u=t.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=t.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=M=>{const V=M.replaceAll(/\D/g,"");return V?Number(V):null},m=M=>f.value.format(M),p=t.ref(""),x=t.ref(null);t.watch(()=>r.modelValue,M=>{M==null?p.value="":h(p.value)!==M&&(p.value=m(M))},{immediate:!0});const y=(M,V)=>{let N=0;for(let T=0;T<V;T++)/\d/.test(M[T])&&N++;return N},g=(M,V)=>{let N=0;for(let T=0;T<M.length;T++)if(/\d/.test(M[T])&&(N++,N===V))return T+1;return M.length},B=M=>{const V=M.target,N=V.value,T=V.selectionStart??N.length,K=h(N);if(K===null){p.value="",a("update:modelValue",null);return}const R=m(K);if(N!==R){const I=y(N,T);p.value=R,t.nextTick(()=>{if(x.value){const q=g(R,I);x.value.setSelectionRange(q,q)}})}a("update:modelValue",K)},k=()=>{p.value="",a("update:modelValue",null),a("clear")},C=t.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?p.value.length>0:!0),E=t.computed(()=>!!r.error),_=t.computed(()=>{const{class:M,maxlength:V,maxLength:N,...T}=o;return T}),w=t.computed(()=>p.value.length),b=t.computed(()=>r.showCharCount?(c.value??0)>0:!1),A=t.computed(()=>b.value&&w.value>0),D=t.computed(()=>`${w.value} / ${c.value}`);return(M,V)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-1.5 w-full",t.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.label?(t.openBlock(),t.createElementBlock("div",Wb)):t.createCommentVNode("",!0),V[2]||(V[2]=t.createElementVNode("div",{class:"relative w-full"},[t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(t.openBlock(),t.createElementBlock("div",jb,[...V[1]||(V[1]=[t.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[t.createTextVNode(t.toDisplayString(e.label)+" ",1),l.value?(t.openBlock(),t.createElementBlock("span",Hb,"*")):t.createCommentVNode("",!0)],8,Ub)):t.createCommentVNode("",!0),t.createElementVNode("div",qb,[t.createElementVNode("div",{class:t.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",E.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",r.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[t.createElementVNode("div",Gb,[t.createElementVNode("span",Xb,t.toDisplayString(u.value),1)]),t.withDirectives(t.createElementVNode("input",t.mergeProps({id:i.value,ref_key:"inputRef",ref:x,"onUpdate:modelValue":V[0]||(V[0]=N=>p.value=N),onInput:B,type:"text",inputmode:"numeric"},_.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",C.value?"pr-8":""]}),null,16,Yb),[[t.vModelText,p.value]]),C.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:k},[t.createVNode(t.unref(oe.X),{class:"w-3.5 h-3.5"})])):t.createCommentVNode("",!0)],2),A.value&&!E.value?(t.openBlock(),t.createElementBlock("p",Kb,t.toDisplayString(D.value),1)):t.createCommentVNode("",!0)]),E.value?(t.openBlock(),t.createElementBlock("p",Jb,[t.createVNode(t.unref(oe.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),t.createTextVNode(" "+t.toDisplayString(r.error),1)])):t.createCommentVNode("",!0)],64))],10,$b))}}),Qc=6048e5,Qb=864e5,Zc=Symbol.for("constructDateFrom");function ln(e,n){return typeof e=="function"?e(n):e&&typeof e=="object"&&Zc in e?e[Zc](n):e instanceof Date?new e.constructor(n):new Date(n)}function Bt(e,n){return ln(n||e,e)}let Zb={};function Sa(){return Zb}function Do(e,n){var l,c,d,u;const o=Sa(),a=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=Bt(e,n==null?void 0:n.in),s=r.getDay(),i=(s<a?7:0)+s-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Aa(e,n){return Do(e,{...n,weekStartsOn:1})}function ed(e,n){const o=Bt(e,n==null?void 0:n.in),a=o.getFullYear(),r=ln(o,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=Aa(r),i=ln(o,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=Aa(i);return o.getTime()>=s.getTime()?a+1:o.getTime()>=l.getTime()?a:a-1}function td(e){const n=Bt(e),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+e-+o}function ey(e,...n){const o=ln.bind(null,n.find(a=>typeof a=="object"));return n.map(o)}function nd(e,n){const o=Bt(e,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function ty(e,n,o){const[a,r]=ey(o==null?void 0:o.in,e,n),s=nd(a),i=nd(r),l=+s-td(s),c=+i-td(i);return Math.round((l-c)/Qb)}function ny(e,n){const o=ed(e,n),a=ln(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Aa(a)}function oy(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ay(e){return!(!oy(e)&&typeof e!="number"||isNaN(+Bt(e)))}function ry(e,n){const o=Bt(e,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const sy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},iy=(e,n,o)=>{let a;const r=sy[e];return typeof r=="string"?a=r:n===1?a=r.one:a=r.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function jn(e){return(n={})=>{const o=n.width?String(n.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const ly={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uy={date:jn({formats:ly,defaultWidth:"full"}),time:jn({formats:cy,defaultWidth:"full"}),dateTime:jn({formats:dy,defaultWidth:"full"})},fy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hy=(e,n,o,a)=>fy[e];function Pt(e){return(n,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;r=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;r=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(n):n;return r[s]}}const my={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},py={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},by={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ky={ordinalNumber:(e,n)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Pt({values:my,defaultWidth:"wide"}),quarter:Pt({values:py,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Pt({values:gy,defaultWidth:"wide"}),day:Pt({values:by,defaultWidth:"wide"}),dayPeriod:Pt({values:yy,defaultWidth:"wide",formattingValues:xy,defaultFormattingWidth:"wide"})};function vt(e){return(n,o={})=>{const a=o.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=n.match(r);if(!s)return null;const i=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Cy(l,f=>f.test(i)):wy(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function wy(e,n){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n(e[o]))return o}function Cy(e,n){for(let o=0;o<e.length;o++)if(n(e[o]))return o}function od(e){return(n,o={})=>{const a=n.match(e.matchPattern);if(!a)return null;const r=a[0],s=n.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(r.length);return{value:i,rest:l}}}const By=/^(\d+)(th|st|nd|rd)?/i,_y=/\d+/i,Ey={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sy={any:[/^b/i,/^(a|c)/i]},Ay={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vy={any:[/1/i,/2/i,/3/i,/4/i]},Dy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},My={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ny={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Py={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ty={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Oy={ordinalNumber:od({matchPattern:By,parsePattern:_y,valueCallback:e=>parseInt(e,10)}),era:vt({matchPatterns:Ey,defaultMatchWidth:"wide",parsePatterns:Sy,defaultParseWidth:"any"}),quarter:vt({matchPatterns:Ay,defaultMatchWidth:"wide",parsePatterns:Vy,defaultParseWidth:"any",valueCallback:e=>e+1}),month:vt({matchPatterns:Dy,defaultMatchWidth:"wide",parsePatterns:My,defaultParseWidth:"any"}),day:vt({matchPatterns:Ny,defaultMatchWidth:"wide",parsePatterns:Py,defaultParseWidth:"any"}),dayPeriod:vt({matchPatterns:vy,defaultMatchWidth:"any",parsePatterns:Ty,defaultParseWidth:"any"})},ad={code:"en-US",formatDistance:iy,formatLong:uy,formatRelative:hy,localize:ky,match:Oy,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zy(e,n){const o=Bt(e,n==null?void 0:n.in);return ty(o,ry(o))+1}function Fy(e,n){const o=Bt(e,n==null?void 0:n.in),a=+Aa(o)-+ny(o);return Math.round(a/Qc)+1}function rd(e,n){var u,f,h,m;const o=Bt(e,n==null?void 0:n.in),a=o.getFullYear(),r=Sa(),s=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=ln((n==null?void 0:n.in)||e,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=Do(i,n),c=ln((n==null?void 0:n.in)||e,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=Do(c,n);return+o>=+l?a+1:+o>=+d?a:a-1}function Ry(e,n){var l,c,d,u;const o=Sa(),a=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=rd(e,n),s=ln((n==null?void 0:n.in)||e,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),Do(s,n)}function Iy(e,n){const o=Bt(e,n==null?void 0:n.in),a=+Do(o,n)-+Ry(o,n);return Math.round(a/Qc)+1}function Te(e,n){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(n,"0");return o+a}const cn={y(e,n){const o=e.getFullYear(),a=o>0?o:1-o;return Te(n==="yy"?a%100:a,n.length)},M(e,n){const o=e.getMonth();return n==="M"?String(o+1):Te(o+1,2)},d(e,n){return Te(e.getDate(),n.length)},a(e,n){const o=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(e,n){return Te(e.getHours()%12||12,n.length)},H(e,n){return Te(e.getHours(),n.length)},m(e,n){return Te(e.getMinutes(),n.length)},s(e,n){return Te(e.getSeconds(),n.length)},S(e,n){const o=n.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,o-3));return Te(r,n.length)}},Un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(e,n,o){const a=e.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,n,o){if(n==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return o.ordinalNumber(r,{unit:"year"})}return cn.y(e,n)},Y:function(e,n,o,a){const r=rd(e,a),s=r>0?r:1-r;if(n==="YY"){const i=s%100;return Te(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Te(s,n.length)},R:function(e,n){const o=ed(e);return Te(o,n.length)},u:function(e,n){const o=e.getFullYear();return Te(o,n.length)},Q:function(e,n,o){const a=Math.ceil((e.getMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return Te(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,n,o){const a=Math.ceil((e.getMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return Te(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,n,o){const a=e.getMonth();switch(n){case"M":case"MM":return cn.M(e,n);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,n,o){const a=e.getMonth();switch(n){case"L":return String(a+1);case"LL":return Te(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,n,o,a){const r=Iy(e,a);return n==="wo"?o.ordinalNumber(r,{unit:"week"}):Te(r,n.length)},I:function(e,n,o){const a=Fy(e);return n==="Io"?o.ordinalNumber(a,{unit:"week"}):Te(a,n.length)},d:function(e,n,o){return n==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):cn.d(e,n)},D:function(e,n,o){const a=zy(e);return n==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):Te(a,n.length)},E:function(e,n,o){const a=e.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(a,{width:"short",context:"formatting"});case"EEEE":default:return o.day(a,{width:"wide",context:"formatting"})}},e:function(e,n,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Te(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(e,n,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Te(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(e,n,o){const a=e.getDay(),r=a===0?7:a;switch(n){case"i":return String(r);case"ii":return Te(r,n.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,n,o){const r=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,n,o){const a=e.getHours();let r;switch(a===12?r=Un.noon:a===0?r=Un.midnight:r=a/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,n,o){const a=e.getHours();let r;switch(a>=17?r=Un.evening:a>=12?r=Un.afternoon:a>=4?r=Un.morning:r=Un.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,n,o){if(n==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return cn.h(e,n)},H:function(e,n,o){return n==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):cn.H(e,n)},K:function(e,n,o){const a=e.getHours()%12;return n==="Ko"?o.ordinalNumber(a,{unit:"hour"}):Te(a,n.length)},k:function(e,n,o){let a=e.getHours();return a===0&&(a=24),n==="ko"?o.ordinalNumber(a,{unit:"hour"}):Te(a,n.length)},m:function(e,n,o){return n==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):cn.m(e,n)},s:function(e,n,o){return n==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):cn.s(e,n)},S:function(e,n){return cn.S(e,n)},X:function(e,n,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return ld(a);case"XXXX":case"XX":return Vn(a);case"XXXXX":case"XXX":default:return Vn(a,":")}},x:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"x":return ld(a);case"xxxx":case"xx":return Vn(a);case"xxxxx":case"xxx":default:return Vn(a,":")}},O:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+id(a,":");case"OOOO":default:return"GMT"+Vn(a,":")}},z:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+id(a,":");case"zzzz":default:return"GMT"+Vn(a,":")}},t:function(e,n,o){const a=Math.trunc(+e/1e3);return Te(a,n.length)},T:function(e,n,o){return Te(+e,n.length)}};function id(e,n=""){const o=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),s=a%60;return s===0?o+String(r):o+String(r)+n+Te(s,2)}function ld(e,n){return e%60===0?(e>0?"-":"+")+Te(Math.abs(e)/60,2):Vn(e,n)}function Vn(e,n=""){const o=e>0?"-":"+",a=Math.abs(e),r=Te(Math.trunc(a/60),2),s=Te(a%60,2);return o+r+n+s}const cd=(e,n)=>{switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},dd=(e,n)=>{switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Ly={p:dd,P:(e,n)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],r=o[2];if(!r)return cd(e,n);let s;switch(a){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",cd(a,n)).replace("{{time}}",dd(r,n))}},$y=/^D+$/,Wy=/^Y+$/,jy=["D","DD","YY","YYYY"];function Uy(e){return $y.test(e)}function Hy(e){return Wy.test(e)}function qy(e,n,o){const a=Gy(e,n,o);if(console.warn(a),jy.includes(e))throw new RangeError(a)}function Gy(e,n,o){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${n}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Xy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ky=/^'([^]*?)'?$/,Jy=/''/g,Qy=/[a-zA-Z]/;function ud(e,n,o){var u,f,h,m;const a=Sa(),r=a.locale??ad,s=a.firstWeekContainsDate??((f=(u=a.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=a.weekStartsOn??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Bt(e,o==null?void 0:o.in);if(!ay(l))throw new RangeError("Invalid time value");let c=n.match(Yy).map(p=>{const x=p[0];if(x==="p"||x==="P"){const y=Ly[x];return y(p,r.formatLong)}return p}).join("").match(Xy).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const x=p[0];if(x==="'")return{isToken:!1,value:Zy(p)};if(sd[x])return{isToken:!0,value:p};if(x.match(Qy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const x=p.value;(Hy(x)||Uy(x))&&qy(x,n,String(e));const y=sd[x[0]];return y(l,x,r.localize,d)}).join("")}function Zy(e){const n=e.match(Ky);return n?n[1].replace(Jy,"'"):e}const ex={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},tx=(e,n,o)=>{let a;const r=ex[e];return typeof r=="string"?a=r:n===1?a=r.one:a=r.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+a:a+" yang lalu":a},nx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},ox={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},ax={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rx={date:jn({formats:nx,defaultWidth:"full"}),time:jn({formats:ox,defaultWidth:"full"}),dateTime:jn({formats:ax,defaultWidth:"full"})},sx={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},ix=(e,n,o,a)=>sx[e],lx={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},cx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},ux={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},fx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},hx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},mx={ordinalNumber:(e,n)=>"ke-"+Number(e),era:Pt({values:lx,defaultWidth:"wide"}),quarter:Pt({values:cx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Pt({values:dx,defaultWidth:"wide"}),day:Pt({values:ux,defaultWidth:"wide"}),dayPeriod:Pt({values:fx,defaultWidth:"wide",formattingValues:hx,defaultFormattingWidth:"wide"})},px=/^ke-(\d+)?/i,gx=/\d+/i,bx={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},yx={any:[/^s/i,/^(m|e)/i]},xx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},kx={any:[/1/i,/2/i,/3/i,/4/i]},wx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Cx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bx={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},_x={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},Ex={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Sx={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Ax={ordinalNumber:od({matchPattern:px,parsePattern:gx,valueCallback:e=>parseInt(e,10)}),era:vt({matchPatterns:bx,defaultMatchWidth:"wide",parsePatterns:yx,defaultParseWidth:"any"}),quarter:vt({matchPatterns:xx,defaultMatchWidth:"wide",parsePatterns:kx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:vt({matchPatterns:wx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),day:vt({matchPatterns:Bx,defaultMatchWidth:"wide",parsePatterns:_x,defaultParseWidth:"any"}),dayPeriod:vt({matchPatterns:Ex,defaultMatchWidth:"any",parsePatterns:Sx,defaultParseWidth:"any"})},Vx={code:"id",formatDistance:tx,formatLong:rx,formatRelative:ix,localize:mx,match:Ax,options:{weekStartsOn:1,firstWeekContainsDate:1}},fd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},hd="dcode-dp-theme-forced";function Dx(e,n=hd){const o=fd[e]??fd.primary,a=`
|
|
19
19
|
.dp__theme_light {
|
|
20
20
|
--dp-primary-color: ${o.light.primary} !important;
|
|
21
21
|
--dp-primary-text-color: ${o.light.text} !important;
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
.dcode-datepicker-menu .dp__menu_inner {
|
|
64
64
|
padding: 0 !important;
|
|
65
65
|
}
|
|
66
|
-
`.trim();let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=a}function Ax(e,t=dd){n.watch(e,o=>Sx(o,t),{immediate:!0})}const Vx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Dx=["for"],Mx={key:0,class:"ml-1 text-destructive"},Nx=["disabled","onClick"],Px={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},vx=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Tx={class:"h-full p-2 flex flex-col gap-3 w-32"},Ox=["onClick"],zx={class:"flex items-center justify-end gap-2 w-full p-2"},Fx=["disabled","onClick"],Rx={key:1,class:"text-xs text-destructive"},Sa=n.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`dcode-datepicker-${o.id||a.label||"date-picker"}-${s}`),l=n.computed(()=>{const N=o.required,T=o["aria-required"];return N===""||N===!0||N==="true"||T==="true"||T===!0}),c=n.computed(()=>!!a.error),d=n.computed({get:()=>a.modelValue,set:N=>{r("update:modelValue",N),r("change",N)}}),u=n.computed(()=>a.locale==="en"?td:Ex),f=n.computed(()=>a.range?2:!1),h=n.computed(()=>{if(!a.range)return!1;const N={partialRange:!1};return a.autoRangeDays&&a.autoRangeDays>0&&(N.maxRange=a.autoRangeDays,N.autoRange=a.autoRangeDays),N}),m=N=>{const T=new Date(N);return T.setHours(0,0,0,0),T},p=N=>{const T=new Date(N);return T.setHours(23,59,59,999),T},b=(N,T)=>{const K=new Date(N);return K.setDate(K.getDate()+T),K},y=n.computed(()=>{if(a.disablePast)return m(new Date)}),g=n.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return p(b(new Date,a.maxDaysAhead))}),B=n.ref(null),w=n.ref(null),C=N=>{w.value={month:N.month,year:N.year}},E=n.ref(!1);let _=null;n.onMounted(()=>{const N=document.documentElement,T=()=>E.value=N.classList.contains("dark");T(),_=new MutationObserver(T),_.observe(N,{attributes:!0,attributeFilter:["class"]})}),n.onBeforeUnmount(()=>{_==null||_.disconnect(),_=null}),Ax(n.toRef(a,"tone"));const k=N=>{const T=new Date(N),K=T.getDay(),R=T.getDate()-K+(K===0?-6:1);return T.setDate(R),m(T)},x=N=>{const T=k(N);return T.setDate(T.getDate()+6),p(T)},A=N=>{const T=new Date(N);return T.setDate(1),m(T)},D=N=>{const T=new Date(N);return T.setMonth(T.getMonth()+1),T.setDate(0),p(T)},M=n.computed(()=>{if(!a.range)return[];const N=new Date,T=m(N),K=k(N),R=x(N),I=A(N),q=D(N),ne=(W,U)=>{let ee=W;a.disablePast&&ee<T&&(ee=T);let v=U;if(a.autoRangeDays&&a.autoRangeDays>0){const O=p(b(ee,a.autoRangeDays-1));v>O&&(v=O)}return v<ee&&(v=p(new Date(ee))),[ee,v]};return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:ne(K,R)},{label:a.locale==="id"?"Bulan Ini":"This Month",range:ne(I,q)}]}),V=async N=>{var U,ee;const T=a.modelType||"yyyy-MM-dd";if(N.length===0){d.value=null;return}if(N.length<2)return;const K=ld(N[0],T),R=ld(N[1],T);d.value=[K,R],await n.nextTick();const I=N[0],q=I.getMonth(),ne=I.getFullYear();w.value&&w.value.month===q&&w.value.year===ne||(U=B.value)==null||U.setMonthYear({month:q,year:ne}),(ee=B.value)==null||ee.openMenu()};return(N,T)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class])},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Vx)):n.createCommentVNode("",!0),T[2]||(T[2]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Mx,"*")):n.createCommentVNode("",!0)],8,Dx)):n.createCommentVNode("",!0),n.createVNode(n.unref(Jd.VueDatePicker),{ref_key:"dpRef",ref:B,modelValue:d.value,"onUpdate:modelValue":T[1]||(T[1]=K=>d.value=K),dark:E.value,range:h.value,"multi-calendars":f.value,disabled:e.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":e.modelType,formats:{input:e.displayFormat},"min-date":y.value,"max-date":g.value,"preset-ranges":M.value,floating:{placement:e.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:C},n.createSlots({"dp-input":n.withCtx(({value:K,onInput:R,onEnter:I,onTab:q,onBlur:ne,onFocus:W,onKeypress:U,onPaste:ee,toggleMenu:v})=>[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":""]])},[n.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:O=>v()},[n.createVNode(n.unref(ae.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Nx),T[4]||(T[4]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",Px,n.toDisplayString(e.prependInner),1),T[3]||(T[3]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:i.value,value:K,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:n.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",e.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:O=>v(),onFocus:O=>W(),onBlur:O=>ne(),onInput:O=>R(O),onKeydown:[n.withKeys(O=>I(O),["enter"]),n.withKeys(O=>q(O),["tab"])],onKeypress:O=>U(O),onPaste:O=>ee()},null,42,vx)],2)]),"action-buttons":n.withCtx(({selectDate:K,selectionDisabled:R})=>[n.createElementVNode("div",zx,[n.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:T[0]||(T[0]=I=>{var q;return(q=B.value)==null?void 0:q.closeMenu()})},n.toDisplayString(e.cancelLabel),1),n.createElementVNode("button",{type:"button",disabled:R,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:I=>K()},n.toDisplayString(e.selectLabel),9,Fx)])]),_:2},[e.range?{name:"left-sidebar",fn:n.withCtx(()=>[n.createElementVNode("div",Tx,[M.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(M.value,K=>(n.openBlock(),n.createElementBlock("button",{key:K.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:R=>V(K.range)},n.toDisplayString(K.label),9,Ox))),128)):n.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(n.openBlock(),n.createElementBlock("p",Rx,n.toDisplayString(a.error),1)):n.createCommentVNode("",!0)],64))],2))}}),Ix=n.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Lx=n.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const o=e,a=t,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ue.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.createVNode(n.unref(ue.DialogContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Ee)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ue.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.X),{class:"w-4 h-4"}),l[0]||(l[0]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),$x=n.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogDescription),n.mergeProps(n.unref(a),{class:n.unref(Ee)("text-sm text-muted-foreground",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Wx=n.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogTitle),n.mergeProps(n.unref(a),{class:n.unref(Ee)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),jx={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md sticky top-0 z-20"},Ux={class:"flex items-center gap-3"},Hx={class:"flex flex-col"},qx={key:0,class:"flex items-center gap-2"},Gx={key:1,class:"px-6 py-4 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/50 sticky bottom-0 z-20"},Xx={class:"flex justify-end gap-3 flex-wrap"},Vo=Ct(n.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>{const{style:d,...u}=r;return u}),i=n.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=n.computed(()=>o.icon?Et[o.icon]??null:null),c=d=>{a("update:modelValue",d)};return(d,u)=>(n.openBlock(),n.createBlock(n.unref(Ix),{open:e.modelValue,"onUpdate:open":c},{default:n.withCtx(()=>[n.createVNode(n.unref(Lx),n.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-950 border-0",onInteractOutside:u[0]||(u[0]=f=>e.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>e.persistent?f.preventDefault():null)}),{default:n.withCtx(()=>[e.title||d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",jx,[n.createElementVNode("div",Ux,[l.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):n.createCommentVNode("",!0),n.createElementVNode("div",Hx,[n.createVNode(n.unref(Wx),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref($x),{class:"hidden"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",qx,[n.renderSlot(d.$slots,"header-append",{},void 0,!0)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:n.normalizeStyle(e.contentStyle)},[n.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(n.openBlock(),n.createElementBlock("div",Gx,[n.createElementVNode("div",Xx,[n.renderSlot(d.$slots,"actions",{},void 0,!0)])])):n.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),ud=n.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,o=n.computed(()=>Et[t.icon]??Et.X);return(a,r)=>(n.openBlock(),n.createBlock(n.unref(mt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Yx=n.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)(n.unref(Jx)({variant:e.variant}),t.class)),role:"alert"},[n.renderSlot(o.$slots,"default")],2))}}),Kx=n.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("text-sm [&_p]:leading-relaxed",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),Jx=oo("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Un=n.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)(n.unref(Qx)({variant:e.variant}),t.class))},[n.renderSlot(o.$slots,"default")],2))}}),Qx=oo("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),cs=n.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ds=n.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("p-6 pt-0",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),us=n.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("flex flex-col gap-y-1.5 p-6",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),fs=n.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("h3",{class:n.normalizeClass(n.unref(Ee)("font-medium leading-none tracking-tight",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),Zx={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},ek={class:"flex flex-wrap items-center justify-center gap-2"},tk=["accept","multiple"],Aa=Ct(n.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);n.computed(()=>o.accept||"file/*");const d=n.computed(()=>o.error??i.value);function u(){var k;o.disabled||(k=r.value)==null||k.click()}function f(k){const x=k/1024,A=x/1024;return A>=1?`${A.toFixed(2)} MB`:x>=1?`${x.toFixed(1)} KB`:`${k} B`}function h(k){var A;if(!k)return"File tidak valid";if((A=o.accept)!=null&&A.includes("image/")&&!k.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const x=(o.maxSizeMb??2)*1024*1024;return k.size>x?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(k){l.value=k.name,c.value=k.size}function p(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const A=k[0],D=h(A);if(D){i.value=D,a("error",D);return}o.showSelected&&m(A),a("picked",A);return}const x=[];for(const A of k){const D=h(A);if(D){i.value=D,a("error",D);return}x.push(A)}x.length&&(o.showSelected&&m(x[0]),a("picked:multiple",x))}function b(k){const x=k.target,A=Array.from(x.files??[]);p(A),x.value=""}function y(){o.disabled||(s.value=!0)}function g(){o.disabled||(s.value=!0)}function B(){s.value=!1}function w(k){var D,M;if(o.disabled)return;s.value=!1;const x=Array.from(((D=k.dataTransfer)==null?void 0:D.files)??[]),A=(M=o.accept)!=null&&M.includes("image/")?x.filter(V=>V.type.startsWith("image/")):x;p(A)}const C=n.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));n.computed(()=>`${o.maxSizeMb??0}MB`);const E=n.ref(!1),_=n.computed(()=>{if(o.disabled||!E.value)return{};const k=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:k?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:k?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(k,x)=>(n.openBlock(),n.createBlock(n.unref(cs),{class:n.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(n.unref(us),{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(fs),{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})]),_:1}),n.createVNode(n.unref(ds),{class:"pt-2"},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",e.disabled?"is-disabled":""]]),style:n.normalizeStyle([{minHeight:"190px"},_.value]),onClick:u,onDragenter:n.withModifiers(y,["prevent"]),onDragover:n.withModifiers(g,["prevent"]),onDragleave:n.withModifiers(B,["prevent"]),onDrop:n.withModifiers(w,["prevent"]),onMouseenter:x[0]||(x[0]=A=>E.value=!0),onMouseleave:x[1]||(x[1]=A=>E.value=!1)},[n.createElementVNode("div",Zx,[x[2]||(x[2]=n.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),x[3]||(x[3]=n.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),n.createElementVNode("div",ek,[n.createVNode(n.unref(Un),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Allowed: "+n.toDisplayString(C.value),1)]),_:1}),n.createVNode(n.unref(Un),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Max: "+n.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(n.openBlock(),n.createBlock(n.unref(Un),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value)+" • "+n.toDisplayString(c.value?f(c.value):""),1)]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:b},null,40,tk)],38),d.value?(n.openBlock(),n.createBlock(n.unref(Yx),{key:0,variant:"destructive",class:"mt-3"},{default:n.withCtx(()=>[n.createVNode(n.unref(Kx),{class:"text-sm"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value),1)]),_:1})]),_:1})):n.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-02ca61c0"]]),nk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},ok=["src"],ak={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},rk={class:"space-y-0.5"},sk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},ik={class:"text-xs opacity-70"},lk=["disabled"],ck={key:1},dk=["disabled"],uk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},fk={class:"flex gap-2"},hk={class:"font-medium truncate"},mk={class:"flex gap-2"},pk={class:"font-medium"},gk={class:"flex gap-2"},bk={class:"font-medium truncate"},hs=Ct(n.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));n.watch(()=>o.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),u&&u.disconnect()});function i(m){const p=m/1024,b=p/1024;return b>=1?`${b.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${m} B`}const l=n.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=n.ref(!1),d=n.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=n.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,p)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",nk,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var b,y,g,B,w;return[n.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:p[2]||(p[2]=C=>c.value=!0),onMouseleave:p[3]||(p[3]=C=>c.value=!1)},[s.value&&r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,ok)):(n.openBlock(),n.createElementBlock("div",ak,[n.createVNode(n.unref(ae.FileText),{class:"w-10 h-10"}),n.createElementVNode("div",rk,[n.createElementVNode("p",sk,n.toDisplayString((b=l.value)==null?void 0:b.name),1),n.createElementVNode("p",ik,n.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),n.createElementVNode("div",{class:"d-action-buttons",style:n.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[e.showEdit&&s.value?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[0]||(p[0]=C=>a("edit"))},[n.createVNode(n.unref(ae.Pencil),{style:{width:"16px",height:"16px"}})],12,lk)):(n.openBlock(),n.createElementBlock("div",ck)),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:2,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[1]||(p[1]=C=>a("remove"))},[n.createVNode(n.unref(ae.Trash2),{style:{width:"16px",height:"16px"}})],12,dk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[n.createElementVNode("div",uk,[n.createElementVNode("div",fk,[p[4]||(p[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",hk,n.toDisplayString((g=l.value)==null?void 0:g.name),1)]),n.createElementVNode("div",mk,[p[5]||(p[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",pk,n.toDisplayString((B=l.value)==null?void 0:B.size),1)]),n.createElementVNode("div",gk,[p[6]||(p[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",bk,n.toDisplayString((w=l.value)==null?void 0:w.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function ms(){const e=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:e,success:(s,i)=>e({type:"success",message:s,title:i}),error:(s,i)=>e({type:"error",message:s,title:i}),warning:(s,i)=>e({type:"warning",message:s,title:i}),info:(s,i)=>e({type:"info",message:s,title:i})}}const yk={class:"space-y-3"},xk={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},fd=n.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:_=>a("update:modelValue",_)}),s=n.ref(null),i=n.ref(null);function l(_){i.value=_,a("error",_)}function c(){i.value=null}const d=n.computed(()=>{const _=(o.allowedTypes??"").trim();return _?_.split(/[,\s;]+/g).map(x=>x.trim().toLowerCase()).filter(Boolean).map(x=>x.includes("/")||x.startsWith(".")?x:`.${x}`):[]});function u(_){const k=_.lastIndexOf(".");return k>=0?_.slice(k).toLowerCase():""}const f=n.computed(()=>{if(d.value.length){const _=d.value.filter(x=>x.startsWith("."));return[...d.value.filter(x=>x.includes("/")),..._].join(",")}return o.accept}),h=n.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(_){if(d.value.length){const k=(_.type||"").toLowerCase(),x=u(_.name);return d.value.some(A=>A.includes("/")?k===A:A.startsWith(".")?x===A:x===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(D=>D.trim().toLowerCase()),x=(_.type||"").toLowerCase(),A=u(_.name);return k.some(D=>{if(D.endsWith("/*")){const M=D.slice(0,-2);return x.startsWith(M)}return D.startsWith(".")?A===D:x===D})}return!0}function p(_){return _*1024*1024}async function b(_){return _?m(_)?o.minSizeMb!=null&&_.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&_.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:y}=Je(),g=ms(),B=n.ref(!1);async function w(_){var k;if(o.uploadFn){try{B.value=!0;const x=await o.uploadFn(_);r.value=_,a("uploaded",x)}catch(x){console.error("Upload Error",x),g.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){r.value=_;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{B.value=!0;const x=new FormData;x.append("doc",_);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,M=await y("","",x,{_url:D,_method:A,withCredentials:!0,transformRequest:[(N,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),N)]}),V=(M==null?void 0:M.data)??M;r.value=_,a("uploaded",V)}catch(x){console.error("Upload Error",x),g.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}}async function C(_){var x;if(o.disabled)return;c();const k=await b(_);if(k){l(k);return}s.value=_,o.uploadFn||(x=o.endpoint)!=null&&x.apiUrl?await w(_):r.value=_}function E(){c(),r.value=null,s.value=null}return n.watch(()=>o.modelValue,_=>{_&&!s.value&&(s.value=_),_||(s.value=null)},{immediate:!0}),(_,k)=>(n.openBlock(),n.createElementBlock("div",yk,[r.value?B.value?(n.openBlock(),n.createElementBlock("div",xk,[...k[1]||(k[1]=[n.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(n.openBlock(),n.createBlock(hs,{key:2,file:r.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:E},null,8,["file","title","description","disabled","preview-height","preview-width"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:f.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||B.value,onPicked:C,error:i.value,onError:k[0]||(k[0]=x=>l(x))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),kk=["for"],wk={key:0,class:"!ml-1 !text-destructive"},Ck={class:"relative w-full block box-border"},Bk={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},_k=["id","readonly","disabled","placeholder"],Ek={class:"absolute inset-y-0 right-4 flex items-center z-10"},Sk={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},Ak={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Vk={key:1,class:"text-sm text-muted-foreground text-center"},Dk=["onClick","title"],Mk={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},Nk={class:"flex items-center justify-center flex-1"},Pk={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},vk={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},hd=n.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=e,a=t,r=Et,s=n.ref(null),i=n.ref(null),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=n.ref(!1),u=n.computed(()=>(o.modelValue??"").trim()||""),f=n.ref(""),h=n.ref(!1),m=n.ref(!1),p=n.ref(!1),b=n.shallowRef([]),y=n.ref(o.pageSize),g=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(m.value||p.value)return;p.value=!0,await new Promise(U=>setTimeout(U,0));const W=Object.keys(r).filter(U=>!g.has(U)).filter(U=>/^[A-Z]/.test(U)).filter(U=>typeof r[U]=="function"||typeof r[U]=="object"&&r[U]).sort((U,ee)=>U.localeCompare(ee));b.value=W,m.value=!0,p.value=!1},w=n.computed(()=>!m.value||!u.value||!b.value.includes(u.value)?null:r[u.value]),C=n.ref(u.value),E=n.computed(()=>!!u.value&&!d.value),_=n.computed(()=>{if(!m.value)return[];const W=(f.value??"").trim().toLowerCase();return W?b.value.filter(U=>U.toLowerCase().includes(W)):b.value}),k=n.computed(()=>_.value.slice(0,y.value)),x=n.computed(()=>{const W=o.columns;return W<=2?"grid-cols-2":W===3?"grid-cols-3":W===4?"grid-cols-4":W===5?"grid-cols-5":W>=8?"grid-cols-8":"grid-cols-6"});n.computed(()=>o.clearable?"!pr-10":"!pr-3"),n.computed(()=>w.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var W;await n.nextTick(),(W=i.value)==null||W.focus()},D=async W=>{if(o.disabled)return;const U=W!==!1;if(h.value){h.value=!1;return}d.value=!0,await B(),U&&(f.value="",C.value=""),y.value=o.pageSize,await A()},M=()=>{d.value=!1,f.value="",C.value=u.value,y.value=o.pageSize},V=async()=>{o.disabled||(d.value?M():await D())};let N=null;const T=async W=>{if(o.disabled)return;a("update:modelValue",null),d.value||await D(!1),N&&clearTimeout(N);const U=C.value;N=setTimeout(()=>{f.value=U},300)},K=W=>{o.disabled||(a("update:modelValue",W),M(),queueMicrotask(()=>{var U;return(U=i.value)==null?void 0:U.blur()}))},R=()=>{o.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,M(),queueMicrotask(()=>{var W;return(W=i.value)==null?void 0:W.focus()}))},I=W=>{if(W.key==="Escape"){W.preventDefault(),M();return}if(W.key==="Enter"&&d.value){const U=_.value[0];U&&(W.preventDefault(),K(U))}},q=W=>{if(!d.value)return;const U=W.target;s.value&&!s.value.contains(U)&&M()},ne=W=>{const U=W.target;U.scrollTop+U.clientHeight>=U.scrollHeight-24&&y.value<_.value.length&&(y.value=Math.min(y.value+o.pageSize,_.value.length))};return n.onMounted(()=>{document.addEventListener("mousedown",q),queueMicrotask(()=>{var W;i.value=((W=s.value)==null?void 0:W.querySelector("input"))??null}),u.value&&B()}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",q),N&&clearTimeout(N)}),n.watch(u,W=>{d.value||(C.value=W)}),n.watch(()=>f.value,()=>{y.value=o.pageSize}),(W,U)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[n.createTextVNode(n.toDisplayString(o.label)+" ",1),o.required?(n.openBlock(),n.createElementBlock("span",wk,"*")):n.createCommentVNode("",!0)],8,kk)):n.createCommentVNode("",!0),n.createElementVNode("div",Ck,[w.value&&!d.value?(n.openBlock(),n.createElementBlock("div",Bk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(w.value),{size:18}))])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("input",{id:c.value,"onUpdate:modelValue":U[0]||(U[0]=ee=>C.value=ee),readonly:E.value,disabled:o.disabled,placeholder:o.placeholder,class:n.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 pr-10 outline-none box-border truncate",[w.value&&!d.value?"pl-10":"pl-4",E.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:T,onKeydown:I},null,42,_k),[[n.vModelText,C.value]]),n.createElementVNode("div",Ek,[o.clearable&&u.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:U[1]||(U[1]=n.withModifiers(()=>{},["prevent"])),onClick:R,title:"Clear"},[n.createVNode(n.unref(ae.X),{class:"h-4 w-4"})],32)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:U[2]||(U[2]=n.withModifiers(()=>{},["prevent"])),onClick:V,title:"Open"},[n.createVNode(n.unref(ae.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(n.openBlock(),n.createElementBlock("div",Sk,[n.createElementVNode("div",{class:"p-2 overflow-auto",style:n.normalizeStyle({maxHeight:o.maxHeight}),onScroll:ne},[p.value?(n.openBlock(),n.createElementBlock("div",Ak,[n.createVNode(n.unref(ae.Loader2),{class:"h-4 w-4 animate-spin"}),U[3]||(U[3]=n.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&_.value.length===0?(n.openBlock(),n.createElementBlock("div",Vk," Icon tidak ditemukan ")):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["grid gap-2",x.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,ee=>(n.openBlock(),n.createElementBlock("button",{key:ee,type:"button",class:n.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ee?"ring-1 ring-primary":""]),onClick:v=>K(ee),title:ee},[n.createElementVNode("div",Mk,[n.createElementVNode("div",Nk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r)[ee]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),n.createElementVNode("span",Pk,n.toDisplayString(ee),1)])],10,Dk))),128))],2)),m.value&&_.value.length>0?(n.openBlock(),n.createElementBlock("div",vk," Showing "+n.toDisplayString(k.value.length)+" / "+n.toDisplayString(_.value.length),1)):n.createCommentVNode("",!0)],36)])):n.createCommentVNode("",!0)])],512))}}),Tk={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Ok={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},zk={class:"relative overflow-auto p-0"},ps=n.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:w=>a("update:modelValue",w)}),s=n.ref(null),i=n.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function h(w,C,E,_,k){const x=await new Promise((M,V)=>{const N=URL.createObjectURL(w),T=new Image;T.onload=()=>{URL.revokeObjectURL(N),M(T)},T.onerror=K=>{URL.revokeObjectURL(N),V(K)},T.src=N}),A=document.createElement("canvas");A.width=C,A.height=E;const D=A.getContext("2d");return D?(D.drawImage(x,0,0,C,E),await new Promise(M=>{A.toBlob(V=>M(V||w),_,k)})):w}function m(){if(!l||!i.value)return;const w=l.getPlugin("Dashboard"),C=l.getFile(i.value);!w||!C||requestAnimationFrame(()=>{try{w.openFileEditor(C)}catch{try{w.openFileEditor(i.value)}catch{}}})}async function p(w){if(l){l.cancelAll(),i.value=null;try{const C=l.addFile({name:w.name,type:w.type,data:w,source:"Local",isRemote:!1});i.value=String(C)}catch{}}}function b(){if(!s.value)return;l&&f(),l=new Qd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const w=document.documentElement.classList.contains("dark");l.use(Os,{target:s.value,inline:!0,height:480,theme:w?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const C=document.documentElement.classList.contains("dark"),E=l.getPlugin("Dashboard");E&&E.setOptions({theme:C?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(Zd,{target:Os,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",C=>{i.value=(C==null?void 0:C.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async C=>{const E=++d;try{const _=C.data,k=_.type||C.type||"image/jpeg";let x=_;if(o.outputWidth&&o.outputHeight&&(x=await h(_,o.outputWidth,o.outputHeight,k,o.quality)),c||E!==d)return;const A=C.name||"edited-image.jpg",D=new File([x],A,{type:k});await y(D,"UPPY_EDITOR_COMPLETE"),a("done",D),r.value=!1}catch{}})}async function y(w,C="CROP_RESULT"){const E=URL.createObjectURL(w);try{const _=await new Promise((k,x)=>{const A=new Image;A.onload=()=>k(A),A.onerror=x,A.src=E});console.group(C),console.log("file:",w),console.table({name:w.name,type:w.type,sizeBytes:w.size,sizeMB:+(w.size/1024/1024).toFixed(3),width:_.naturalWidth,height:_.naturalHeight,ratio:+(_.naturalWidth/_.naturalHeight).toFixed(4)}),console.log("previewUrl:",E),console.groupEnd()}finally{URL.revokeObjectURL(E)}}n.watch(r,async w=>{c=!w,d++,w?(await n.nextTick(),b(),o.file&&await p(o.file)):f()},{flush:"post"}),n.watch(()=>o.file,async w=>{r.value&&w&&(await n.nextTick(),await p(w))}),n.onBeforeUnmount(()=>{c=!0,d++,f()});const g=w=>{w.key==="Escape"&&r.value&&(r.value=!1)};n.watch(r,w=>{w?globalThis.addEventListener("keydown",g):globalThis.removeEventListener("keydown",g)},{immediate:!0});const B=n.ref(!1);return(w,C)=>r.value?(n.openBlock(),n.createElementBlock("div",Tk,[n.createVNode(n.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:C[0]||(C[0]=E=>r.value=!1)})):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-800 bg-background dark:bg-neutral-900 shadow-2xl transition-all",onClick:C[4]||(C[4]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",Ok,[C[6]||(C[6]=n.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),n.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:n.normalizeStyle({opacity:B.value?1:.7}),onClick:C[1]||(C[1]=E=>r.value=!1),onMouseenter:C[2]||(C[2]=E=>B.value=!0),onMouseleave:C[3]||(C[3]=E=>B.value=!1)},[n.createVNode(n.unref(ae.X),{class:"h-4 w-4"}),C[5]||(C[5]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),n.createElementVNode("div",zk,[n.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)}}),Fk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Rk=["src"],Ik=["disabled"],Lk=["disabled"],$k={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Wk={class:"flex gap-2"},jk={class:"font-medium truncate"},Uk={class:"flex gap-2"},Hk={class:"font-medium"},qk={class:"flex gap-2"},Gk={class:"font-medium truncate"},gs=Ct(n.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(e,{emit:t}){const o=e,a=t,r=n.ref(null);n.watch(()=>o.file,h=>{r.value&&URL.revokeObjectURL(r.value),r.value=h?URL.createObjectURL(h):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(h){const m=h/1024,p=m/1024;return p>=1?`${p.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=n.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=n.ref(!1),c=n.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=n.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(h,m)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",Fk,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var p,b,y;return[n.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=g=>l.value=!0),onMouseleave:m[3]||(m[3]=g=>l.value=!1)},[r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Rk)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"d-action-buttons",style:n.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[e.showEdit?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=g=>a("edit"))},[n.createVNode(n.unref(ae.Pencil),{style:{width:"16px",height:"16px"}})],12,Ik)):n.createCommentVNode("",!0),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=g=>a("remove"))},[n.createVNode(n.unref(ae.Trash2),{style:{width:"16px",height:"16px"}})],12,Lk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[n.createElementVNode("div",$k,[n.createElementVNode("div",Wk,[m[4]||(m[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",jk,n.toDisplayString((p=i.value)==null?void 0:p.name),1)]),n.createElementVNode("div",Uk,[m[5]||(m[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",Hk,n.toDisplayString((b=i.value)==null?void 0:b.size),1)]),n.createElementVNode("div",qk,[m[6]||(m[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",Gk,n.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Xk={class:"space-y-3"},Va=n.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:R=>a("update:modelValue",R)}),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);function d(R){c.value=R,a("error",R)}function u(){c.value=null}const f=n.computed(()=>{const R=(o.allowedTypes??"").trim();return R?R.split(/[,\s;]+/g).map(q=>q.trim().toLowerCase()).filter(Boolean).map(q=>q.includes("/")||q.startsWith(".")?q:`.${q}`):[]});function h(R){const I=R.lastIndexOf(".");return I>=0?R.slice(I).toLowerCase():""}const m=n.computed(()=>{if(f.value.length){const R=f.value.filter(q=>q.startsWith("."));return[...f.value.filter(q=>q.includes("/")),...R].join(",")}return o.accept||"image/*"}),p=n.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function b(R){if(f.value.length){const q=(R.type||"").toLowerCase(),ne=h(R.name);return f.value.some(W=>W.includes("/")?q===W:W.startsWith(".")?ne===W:ne===`.${W}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(R.type||"").toLowerCase().startsWith("image/"):!0}function y(R){return R*1024*1024}async function g(R){var I;return(I=R.type)!=null&&I.startsWith("image/")?await new Promise(q=>{const ne=URL.createObjectURL(R),W=new Image;W.onload=()=>{URL.revokeObjectURL(ne),q({w:W.naturalWidth,h:W.naturalHeight})},W.onerror=()=>{URL.revokeObjectURL(ne),q(null)},W.src=ne}):null}async function B(R){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const q=await g(R);return q?o.minWidth!=null&&q.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&q.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&q.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&q.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function w(R){return R?b(R)?o.minSizeMb!=null&&R.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&R.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await B(R):`only Allowed: ${p.value}`:"File tidak valid"}function C(R){o.disabled||(i.value=R,s.value=!0)}async function E(R){if(o.disabled)return;u();const I=await w(R);if(I){d(I);return}l.value=R,C(R)}const{DCodeApi:_}=Je(),k=ms(),x=n.ref(!1);n.ref(null);function A(R,I){return!R||!I?null:R.replace(/\/+$/,"")+"/"+I.replace(/^\/+/,"")}function D(R){var W;const I=(R==null?void 0:R.data)??R,q=(W=I==null?void 0:I.data)==null?void 0:W[0];if(!q)return null;const ne=A(q.server,q.url);return{...q,fullUrl:ne?encodeURI(ne):null}}async function M(R){var I;if(o.uploadFn){try{x.value=!0;const q=await o.uploadFn(R);r.value=R,a("uploaded",q)}catch(q){console.error("Upload Error",q),k.error("Upload Failed",(q==null?void 0:q.message)||"Unknown error"),d((q==null?void 0:q.message)||"Upload Failed")}finally{x.value=!1}return}if(!((I=o.endpoint)!=null&&I.apiUrl)){r.value=R;return}if(typeof _!="function"){d("useApi() must expose DCodeApi()");return}try{x.value=!0;const q=new FormData;q.append("doc",R);const ne=(o.endpoint.apiMethod||"POST").toUpperCase(),W=o.endpoint.apiUrl,U=await _("","",q,{_url:W,_method:ne,withCredentials:!0,transformRequest:[(v,O)=>(O&&(delete O["Content-Type"],delete O["content-type"]),v)]}),ee=(U==null?void 0:U.data)??U;D(ee),r.value=R,a("uploaded",ee)}catch(q){console.error("Upload Error",q),k.error("Upload Failed",(q==null?void 0:q.message)||"Unknown error"),d((q==null?void 0:q.message)||"Upload Failed")}finally{x.value=!1}}async function V(R){var I;u(),o.uploadFn||(I=o.endpoint)!=null&&I.apiUrl?await M(R):r.value=R,s.value=!1,i.value=null}function N(){s.value=!1,i.value=null}async function T(){if(!r.value)return;u();const R=o.editUseOriginal?l.value??r.value:r.value,I=await w(R);if(I){d(I);return}C(R)}function K(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return n.watch(()=>o.modelValue,R=>{R&&!l.value&&(l.value=R),R||(l.value=null)},{immediate:!0}),(R,I)=>(n.openBlock(),n.createElementBlock("div",Xk,[r.value?(n.openBlock(),n.createBlock(gs,{key:1,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:T,onRemove:K,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled,onPicked:E,error:c.value,onError:I[0]||(I[0]=q=>d(q))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),n.createVNode(ps,{modelValue:s.value,"onUpdate:modelValue":I[1]||(I[1]=q=>s.value=q),file:i.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:V,onCancel:N},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),Hn=n.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Et[o.icon]||null),r=n.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=n.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=n.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=n.computed(()=>{const u=`${r.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=t.class??"";return[u,f].filter(Boolean).join(" ")}),d=n.computed(()=>{const{class:u,...f}=t;return f});return(u,f)=>(n.openBlock(),n.createElementBlock("span",n.mergeProps({class:c.value},d.value),[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:n.normalizeClass(["shrink-0",i.value,e.iconClass])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.label||e.text),1)],16))}}),Yk=["aria-busy"],Kk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Jk=["for"],Qk={key:0,class:"ml-1 text-destructive"},Zk=["id","disabled"],ew={class:"min-w-0 flex-1 text-left"},tw={key:0,class:"flex flex-wrap gap-1.5"},nw={class:"max-w-[220px] truncate"},ow=["onClick"],aw={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},rw={key:1,class:"text-muted-foreground truncate"},sw={class:"flex items-center gap-2 shrink-0"},iw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},lw=["placeholder","onKeydown"],cw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},dw=["disabled","onClick"],uw={class:"truncate"},fw={key:0,class:"text-primary-600 dark:text-primary-400"},hw={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},mw={key:0},pw={key:1},gw={key:1,class:"text-xs text-destructive"},bs=n.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>(r.label||o.label)??void 0),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{if(r.required)return!0;const Z=o.required,se=o["aria-required"];return Z===""||Z===!0||Z==="true"||(se==="true"||se===!0)}),u=n.computed(()=>!!r.error);function f(Z){return Z?typeof r.itemTitle=="function"?r.itemTitle(Z)??"":String((Z==null?void 0:Z[r.itemTitle])??""):""}function h(Z){return Z?typeof r.itemValue=="function"?r.itemValue(Z):Z==null?void 0:Z[r.itemValue]:null}function m(Z,se){return h(Z)??se}const p=n.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),b=n.computed(()=>{var Z;return!!((Z=r.endpoint)!=null&&Z.apiUrl)||!!r.fetchItems}),y=n.ref([]),g=n.ref(!1),B=n.ref(!1),w=n.computed(()=>{var se;const Z=(se=r.endpoint)==null?void 0:se.apiOptions;if(Z)return typeof Z=="function"?Z():Z}),C=n.computed(()=>{var we,je;const Z=((we=r.endpoint)==null?void 0:we.apiUrl)??"",se=(((je=r.endpoint)==null?void 0:je.apiMethod)??"GET").toUpperCase(),ce=JSON.stringify(w.value??null);return`${se} ${Z} :: ${ce}`}),E=n.computed(()=>b.value?y.value:r.items||[]);async function _(){var Z;if(b.value&&!(!((Z=r.endpoint)!=null&&Z.apiUrl)&&!r.fetchItems)&&!g.value){g.value=!0;try{let se;if(r.fetchItems){const ce=await r.fetchItems(),we=(ce==null?void 0:ce.data)??ce;se=(we==null?void 0:we.data)??we}else{const{DCodeApi:ce}=Je();if(typeof ce!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const we={page:1,perPage:100,...w.value||{}},je=await ce("","",we,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Ot=(je==null?void 0:je.data)??je;se=(Ot==null?void 0:Ot.data)??Ot}y.value=Array.isArray(se)?se:[],B.value=!0}catch(se){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",se),y.value=[]}finally{g.value=!1}}}n.watch(()=>C.value,()=>{y.value=[],B.value=!1}),n.onMounted(()=>{r.autoFetchOnMount&&b.value&&_()});const k=n.computed(()=>{const Z=p.value;if(r.returnObject)return Z;const se=new Map;for(const ce of E.value)se.set(h(ce),ce);return Z.map(ce=>se.get(ce)??{[r.itemValue]:ce,[r.itemTitle]:String(ce)})}),x=n.computed(()=>r.maxChips===null?k.value:k.value.slice(0,r.maxChips));function A(Z){const se=p.value;if(r.returnObject){const ce=h(Z);return se.some(we=>h(we)===ce)}return se.includes(h(Z))}const D=n.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const Z=Number(r.maxSelected);return Number.isFinite(Z)&&Z>0?Z:null}),M=n.computed(()=>{const Z=D.value;return Z===null?!1:p.value.length>=Z});function V(Z){return!A(Z)&&M.value}const N=n.computed(()=>{const Z=p.value,se=new Set;if(r.returnObject)for(const ce of Z)se.add(h(ce));else for(const ce of Z)se.add(ce);return se}),T=n.computed(()=>{const Z=N.value;return(E.value||[]).filter(se=>!Z.has(h(se)))}),K=n.computed(()=>E.value.length===0?!1:T.value.length===0),R=n.ref(null),I=n.ref(null),q=n.ref(null),ne=n.ref(!1),W=n.ref(""),U=n.ref(0),ee=n.ref(0),{floatingStyles:v}=hr(R,I,{whileElementsMounted:lr,placement:"bottom-start",middleware:[cr(8),ur(),dr({padding:8}),fr({apply({rects:Z,elements:se}){Object.assign(se.floating.style,{width:`${Z.reference.width}px`,"--floating-width":`${Z.reference.width}px`})}})]}),O=n.computed(()=>v.value),$=n.computed(()=>{const Z=Number(r.maxRows);return Number.isFinite(Z)&&Z>0?Z:5});async function X(){r.disabled||(ne.value=!0,ee.value=0,requestAnimationFrame(()=>{q.value&&(q.value.scrollTop=0),U.value=0}),b.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!g.value&&await _())}function te(){ne.value=!1}function ie(){ne.value?te():X()}function re(Z){var ce,we;if(!ne.value)return;const se=Z.target;(ce=R.value)!=null&&ce.contains(se)||(we=I.value)!=null&&we.contains(se)||te()}n.onMounted(()=>document.addEventListener("mousedown",re)),n.onBeforeUnmount(()=>document.removeEventListener("mousedown",re));function z(Z){if(r.disabled)return;if(V(Z)){a("max");return}const se=[...p.value];if(r.returnObject){const ce=h(Z);if(se.some(je=>h(je)===ce))return;a("update:modelValue",[...se,Z])}else{const ce=h(Z);if(se.includes(ce))return;a("update:modelValue",[...se,ce])}W.value="",ee.value=0,requestAnimationFrame(()=>{q.value&&(q.value.scrollTop=0),U.value=0})}function P(Z){if(r.disabled)return;const se=[...p.value];if(r.returnObject){const ce=h(Z);a("update:modelValue",se.filter(we=>h(we)!==ce))}else{const ce=h(Z);a("update:modelValue",se.filter(we=>we!==ce))}}function H(){r.disabled||(a("update:modelValue",[]),a("clear"),te())}const Y=n.computed(()=>{const Z=W.value.trim().toLowerCase(),se=T.value;return Z?se.filter(ce=>f(ce).toLowerCase().includes(Z)):se}),oe=n.computed(()=>Y.value.length);n.watch(ne,Z=>{Z||(W.value="")});const ye=n.computed(()=>{if(K.value)return r.itemHeight;const Z=oe.value;return(Z<=0?1:Math.min(Z,$.value))*r.itemHeight}),xe=n.computed(()=>r.virtual?oe.value*r.itemHeight:0),pe=n.computed(()=>r.virtual?Math.ceil(ye.value/r.itemHeight)+r.overscan:oe.value),ke=n.computed(()=>{if(!r.virtual)return 0;const Z=Math.floor(U.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,Z)}),Fe=n.computed(()=>r.virtual?Math.min(oe.value,ke.value+pe.value):oe.value),Ze=n.computed(()=>r.virtual?ke.value*r.itemHeight:0),it=n.computed(()=>{const Z=Y.value;return r.virtual?Z.slice(ke.value,Fe.value):Z});function _t(Z){const se=Z.target;U.value=se.scrollTop}function et(Z){return Z===ee.value}function G(Z){const se=q.value;if(!se||!r.virtual)return;const ce=Z*r.itemHeight,we=ce+r.itemHeight,je=se.scrollTop,Ot=se.scrollTop+se.clientHeight;ce<je?se.scrollTop=ce:we>Ot&&(se.scrollTop=we-se.clientHeight)}function le(Z){const se=Math.max(0,oe.value-1);ee.value=Math.min(se,Math.max(0,ee.value+Z)),G(ee.value)}function be(){const Z=Y.value[ee.value];Z&&z(Z)}const Oe=n.computed(()=>r.clearable&&!r.disabled&&k.value.length>0),De=n.computed(()=>u.value?"border-destructive ring-1 ring-destructive":ne.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Z,se)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Kk)):n.createCommentVNode("",!0),se[3]||(se[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",Qk,"*")):n.createCommentVNode("",!0)],8,Jk)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"referenceEl",ref:R,class:"relative"},[n.createElementVNode("button",{id:c.value,type:"button",class:n.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",De.value]]),disabled:r.disabled,onClick:ie},[n.createElementVNode("div",ew,[k.value.length?(n.openBlock(),n.createElementBlock("div",tw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(x.value,(ce,we)=>(n.openBlock(),n.createElementBlock("div",{key:`chip-${m(ce,we)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[n.createElementVNode("span",nw,n.toDisplayString(f(ce)),1),r.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:n.withModifiers(je=>P(ce),["stop"]),"aria-label":"Remove"}," ✕ ",8,ow))]))),128)),r.maxChips!==null&&k.value.length>r.maxChips?(n.openBlock(),n.createElementBlock("div",aw," +"+n.toDisplayString(k.value.length-(r.maxChips??0)),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",rw,n.toDisplayString(r.placeholder),1))]),n.createElementVNode("div",sw,[Oe.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:n.withModifiers(H,["stop"]),"aria-label":"Clear"}," ✕ ")):n.createCommentVNode("",!0),n.createVNode(n.unref(ae.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,Zk),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[ne.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:I,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-900 border-gray-200 dark:border-gray-800",style:n.normalizeStyle(O.value)},[r.searchable&&!K.value?(n.openBlock(),n.createElementBlock("div",iw,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":se[0]||(se[0]=ce=>W.value=ce),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-900 border border-gray-200 dark:border-gray-800 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[se[1]||(se[1]=n.withKeys(n.withModifiers(ce=>le(1),["prevent"]),["down"])),se[2]||(se[2]=n.withKeys(n.withModifiers(ce=>le(-1),["prevent"]),["up"])),n.withKeys(n.withModifiers(be,["prevent"]),["enter"]),n.withKeys(n.withModifiers(te,["prevent"]),["esc"])]},null,40,lw),[[n.vModelText,W.value]])])):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"listEl",ref:q,class:"relative overflow-auto",style:n.normalizeStyle({height:ye.value+"px"}),onScroll:_t},[K.value?(n.openBlock(),n.createElementBlock("div",cw," All items have been selected ")):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r.virtual?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({height:xe.value+"px"})},null,4)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:n.normalizeStyle(r.virtual?{transform:`translateY(${Ze.value}px)`}:void 0)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(it.value,(ce,we)=>(n.openBlock(),n.createElementBlock("button",{key:String(m(ce,ke.value+we)),type:"button",class:n.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[V(ce)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",et(ke.value+we)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(ce)?"font-semibold":"font-normal"]]),style:n.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||V(ce),onClick:je=>z(ce)},[n.createElementVNode("span",uw,n.toDisplayString(f(ce)),1),A(ce)?(n.openBlock(),n.createElementBlock("span",fw,"✓")):n.createCommentVNode("",!0)],14,dw))),128))],6),oe.value===0?(n.openBlock(),n.createElementBlock("div",hw,[g.value?(n.openBlock(),n.createElementBlock("span",mw,"Loading data…")):(n.openBlock(),n.createElementBlock("span",pw,"Tidak ada data"))])):n.createCommentVNode("",!0)],64))],36)],4)):n.createCommentVNode("",!0)]))],512),u.value?(n.openBlock(),n.createElementBlock("p",gw,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,Yk)),[[n.vShow,i.value]])}}),bw={class:"space-y-4"},yw={key:0,class:"flex flex-col gap-0.5"},xw=["for"],kw=["for"],ww={class:"text-[11px] text-gray-500 dark:text-gray-400"},Cw={class:"flex items-center gap-2 flex-nowrap"},Bw=["id","value","disabled","onKeydown","onInput","onPaste"],Da=n.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(e,{emit:t}){const o=n.useAttrs(),a=Math.random().toString(36).slice(2,7),r=n.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${a}`),s=e,i=t,l=n.ref([]),c=n.ref([]),d=n.ref(!1),{DCodeApi:u}=Je(),f=ms(),h=n.computed(()=>{const _=Number(s.totalInput);return _&&_>0?_:6}),m=()=>{c.value=Array.from({length:h.value},(_,k)=>{var x;return((x=s.default)==null?void 0:x[k])??""}),i("updateOtp",c.value.join(""))};m(),n.watch(()=>[s.totalInput,s.default],()=>m());const p=_=>{_<0||_>=h.value||n.nextTick(()=>{var k;return(k=l.value[_])==null?void 0:k.focus()})},b=_=>_.match(/[a-zA-Z0-9]/)?_.match(/[a-zA-Z0-9]/)[0]:"";async function y(_){var k;if(i("complete",_),s.submitFn){try{d.value=!0,i("loading",!0);const x=await s.submitFn(_);i("success",x)}catch(x){console.error("OTP Submit Error",x),f.error("Submit Failed",(x==null?void 0:x.message)||"Unknown error"),i("error",(x==null?void 0:x.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((k=s.endpoint)!=null&&k.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const x=(s.endpoint.apiMethod||"POST").toUpperCase(),A=s.endpoint.apiUrl,D=await u("","",{otp:_},{_url:A,_method:x,withCredentials:!0}),M=(D==null?void 0:D.data)??D;i("success",M)}catch(x){console.error("OTP Submit Error",x),f.error("Submit Failed",(x==null?void 0:x.message)||"Unknown error"),i("error",(x==null?void 0:x.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const g=(_,k)=>{c.value[_]=b(k);const x=c.value.join("");i("updateOtp",x),i("update:modelValue",x),x.length===h.value&&y(x)},B=(_,k)=>{const x=_.key,A=/^\d$/.test(x),D=/^[a-zA-Z]$/.test(x);if(x==="Backspace"){if(_.preventDefault(),c.value[k]){g(k,"");return}k>0&&(g(k-1,""),p(k-1));return}if(x==="ArrowLeft"){_.preventDefault(),p(k-1);return}if(x==="ArrowRight"){_.preventDefault(),p(k+1);return}if(A||D){_.preventDefault(),g(k,x),k<h.value-1&&p(k+1);return}x.length===1&&_.preventDefault()},w=(_,k)=>{const x=_.target,A=x.value??"",D=b(A);x.value=D,g(k,D),D&&k<h.value-1&&p(k+1)},C=(_,k)=>{var V;_.preventDefault();const A=(((V=_.clipboardData)==null?void 0:V.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let D=k;for(const N of A){if(D>=h.value)break;c.value[D]=N,D++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&y(M),p(Math.min(D,h.value-1))},E=_=>k=>{l.value[_]=(k==null?void 0:k.$el)??k};return(_,k)=>(n.openBlock(),n.createElementBlock("div",bw,[s.label||h.value?(n.openBlock(),n.createElementBlock("div",yw,[s.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},n.toDisplayString(s.label),9,xw)):(n.openBlock(),n.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,kw)),n.createElementVNode("p",ww," Ketik "+n.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Cw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,x=>(n.openBlock(),n.createElementBlock("input",{key:x,id:x===1?r.value:void 0,ref_for:!0,ref:E(x-1),value:c.value[x-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:n.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[x-1]?"border-blue-500 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300":"border-gray-300 dark:border-gray-700 bg-white dark:bg-neutral-900 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>B(A,x-1),onInput:A=>w(A,x-1),onPaste:A=>C(A,x-1)},null,42,Bw))),128))])]))}}),_w={class:"w-full"},Ew={key:0,class:"flex items-center justify-between mb-2"},Sw={key:0,class:"text-sm font-medium text-gray-700"},Aw={key:1,class:"text-sm text-gray-600"},Vw={name:"DCodeProgress"},md=n.defineComponent({...Vw,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=n.computed(()=>Math.min(o.modelValue/o.max*100,100)),r=n.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=n.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=n.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(n.openBlock(),n.createElementBlock("div",_w,[e.label||e.showValue?(n.openBlock(),n.createElementBlock("div",Ew,[e.label?(n.openBlock(),n.createElementBlock("span",Sw,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.showValue?(n.openBlock(),n.createElementBlock("span",Aw,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.value)},[n.createElementVNode("div",{class:n.normalizeClass(s.value),style:n.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),Dw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},pd=Ct(n.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.Transition,{name:"fade"},{default:n.withCtx(()=>[e.isApiLoading?(n.openBlock(),n.createElementBlock("div",Dw,[n.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:n.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):n.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),Ma=n.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.Label),n.mergeProps(n.unref(o),{class:n.unref(Ee)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Mw={class:"grid gap-3"},Nw={key:0,class:"ml-1 text-destructive"},Pw={class:"flex flex-col"},vw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},Tw={class:"relative flex-shrink-0 mt-0.5"},Ow=["id","name","value","checked","disabled","required","onChange"],zw=["onClick"],Fw=["for"],Rw={key:0,class:"ml-1 text-red-500"},Iw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},ys=n.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref([]),i=n.ref(!1),l=n.ref(null),c=async()=>{var C,E;const w=((C=r.endpoint)==null?void 0:C.apiUrl)||r.apiUrl;if(w){i.value=!0,l.value=null;try{const _={page:1,perPage:100},k=((E=r.endpoint)==null?void 0:E.apiMethod)||r.apiMethod,x=await o(w,k,_);let A=x;r.dataPath?A=r.dataPath.split(".").reduce((M,V)=>M&&M[V]!=="undefined"?M[V]:void 0,x):typeof x=="object"&&!Array.isArray(x)&&x.data&&(A=x.data),Array.isArray(A)?s.value=A:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(_){console.error("DCodeRadio fetch error:",_),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};n.onMounted(()=>{var w;((w=r.endpoint)!=null&&w.apiUrl||r.apiUrl)&&c()});const d=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const w=r.itemValue||r.model||"id",C=r.itemTitle||(r.label===""?"name":r.label);return C&&r.label!==""?[{[w]:w,[C]:C}]:[]}),u=w=>{if(typeof w!="object")return w;const C=r.itemValue||r.model||"id";return w[C]},f=w=>{if(typeof w!="object")return String(w);const C=r.itemTitle||"name";return w[C]},h=n.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=n.computed(()=>!!r.error||!!l.value),p=n.computed(()=>r.error||l.value),b=w=>w==null?r.modelValue===w:String(r.modelValue)===String(w),y=n.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),g=(w,C)=>{C.target.checked&&(a("update:modelValue",w),a("change",w))},B=w=>{!r.disabled&&!b(w)&&(a("update:modelValue",w),a("change",w))};return(w,C)=>(n.openBlock(),n.createElementBlock("div",Mw,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Nw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Pw,[i.value?(n.openBlock(),n.createElementBlock("div",vw,[n.createVNode(n.unref(ae.Loader2),{class:"w-4 h-4 animate-spin"}),C[0]||(C[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(E,_)=>(n.openBlock(),n.createElementBlock("div",{key:_,class:n.normalizeClass(["flex items-start",y.value.container,e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[n.createElementVNode("div",Tw,[n.createElementVNode("input",{id:e.id?`${e.id}-${_}`:`${h.value}-${_}`,name:h.value,type:"radio",value:u(E),checked:b(u(E)),disabled:e.disabled,required:e.required&&_===0,onChange:k=>g(u(E),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Ow)]),n.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>B(u(E))},[n.createElementVNode("label",{for:e.id?`${e.id}-${_}`:`${h.value}-${_}`,class:n.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled?"cursor-not-allowed opacity-50":""])},[n.createTextVNode(n.toDisplayString(f(E))+" ",1),e.required&&d.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Rw,"*")):n.createCommentVNode("",!0)],10,Fw)],8,zw)],2))),128))],2),m.value&&p.value?(n.openBlock(),n.createElementBlock("div",Iw,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(p.value),1)])):n.createCommentVNode("",!0)])]))}}),Lw={class:"grid gap-3"},$w={key:0,class:"ml-1 text-destructive"},Ww={class:"flex flex-col"},jw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},Uw=["onClick"],Hw=["id","name","value","checked","disabled","required","onChange"],qw={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},Gw=["for"],Xw={key:0,class:"ml-1 text-red-500"},Yw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},xs=n.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref(r.modelValue??void 0);n.watch(()=>r.modelValue,A=>{s.value=A},{immediate:!0});const i=n.ref([]),l=n.ref(!1),c=n.ref(null),d=async()=>{var D,M;const A=((D=r.endpoint)==null?void 0:D.apiUrl)||r.apiUrl;if(A){l.value=!0,c.value=null;try{const V={page:1,perPage:100},N=((M=r.endpoint)==null?void 0:M.apiMethod)||r.apiMethod,T=await o(A,N,V);let K=T;r.dataPath?K=r.dataPath.split(".").reduce((I,q)=>I&&I[q]!=="undefined"?I[q]:void 0,T):typeof T=="object"&&!Array.isArray(T)&&T.data&&(K=T.data),Array.isArray(K)?i.value=K:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(V){console.error("DCodeRadioCustom fetch error:",V),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=n.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{var A;((A=r.endpoint)!=null&&A.apiUrl||r.apiUrl)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),n.onBeforeUnmount(()=>{f&&f.disconnect()});const m=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(i.value.length>0)return i.value;const A=r.itemValue||r.model||"id",D=r.itemTitle||(r.label===""?"name":r.label);return D&&r.label!==""?[{[A]:A,[D]:D}]:[]}),p=A=>{if(typeof A!="object")return A;const D=r.itemValue||r.model||"id";return A[D]},b=A=>{if(typeof A!="object")return String(A);const D=r.itemTitle||"name";return A[D]},y=Math.random().toString(36).slice(2,7),g=n.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${y}`),B=n.computed(()=>!!r.error||!!c.value),w=n.computed(()=>r.error||c.value),C=A=>{const D=s.value;return A==null?D===A:String(D)===String(A)},E=n.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),_=n.computed(()=>r.icon&&Et[r.icon]||null),k=(A,D)=>{D.target.checked&&(s.value=A,a("update:modelValue",A),a("change",A))},x=A=>{r.disabled||C(A)||(s.value=A,a("update:modelValue",A),a("change",A))};return(A,D)=>(n.openBlock(),n.createElementBlock("div",Lw,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",$w,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Ww,[l.value?(n.openBlock(),n.createElementBlock("div",jw,[n.createVNode(n.unref(ae.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(M,V)=>(n.openBlock(),n.createElementBlock("div",{key:V,class:n.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",C(p(M))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>!e.disabled&&x(p(M))},[n.createElementVNode("input",{id:e.id?`${e.id}-${V}`:`${g.value}-${V}`,name:g.value,type:"radio",value:p(M),checked:C(p(M)),disabled:e.disabled,required:e.required&&V===0,onChange:N=>k(p(M),N),class:"sr-only",tabindex:"-1"},null,40,Hw),n.createElementVNode("div",{class:n.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",C(p(M))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[_.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(_.value),{key:0,class:"w-6 h-6"})):(n.openBlock(),n.createElementBlock("svg",qw,[...D[1]||(D[1]=[n.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),n.createElementVNode("label",{for:e.id?`${e.id}-${V}`:`${g.value}-${V}`,class:n.normalizeClass([E.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",C(p(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",e.disabled?"cursor-not-allowed":"cursor-pointer"])},[n.createTextVNode(n.toDisplayString(b(M))+" ",1),e.required&&m.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Xw,"*")):n.createCommentVNode("",!0)],10,Gw)],10,Uw))),128))],2),B.value&&w.value?(n.openBlock(),n.createElementBlock("div",Yw,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(w.value),1)])):n.createCommentVNode("",!0)])]))}}),Kw={key:0,class:"ml-1 text-destructive"},Jw={class:"relative w-full"},Qw={key:0,class:"mb-2 flex items-center justify-between"},Zw={class:"text-sm text-muted-foreground"},e1={class:"text-sm font-medium text-foreground"},t1={class:"text-sm text-muted-foreground"},n1={class:"relative"},o1=["id","value","min","max","step","disabled","placeholder"],a1={key:1,class:"relative mt-2"},r1={class:"text-xs text-muted-foreground mt-1"},s1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},i1={name:"DCodeSlider"},Na=n.defineComponent({...i1,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.ref(),i=n.ref(!1),l=n.computed(()=>!!r.error),c=n.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=n.computed(()=>(r.label||o.label)??void 0),u=n.computed(()=>!0),f=n.computed(()=>{const E={sm:"h-2",md:"h-2.5",lg:"h-3"},_={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",E[r.size],_[r.color]||_.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=n.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r.size],r.color==="blue"?"focus:ring-blue-500":r.color==="green"?"focus:ring-green-500":r.color==="red"?"focus:ring-red-500":r.color==="yellow"?"focus:ring-yellow-500":r.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=n.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),p=n.computed(()=>{const E=r.max-r.min;return(r.modelValue-r.min)/E*100}),b=E=>{const _=E.target,k=parseFloat(_.value);a("update:modelValue",k),a("input",k)},y=E=>{const _=E.target,k=parseFloat(_.value);a("change",k)},g=()=>{i.value=!0},B=()=>{i.value=!1},w=E=>{const _=r.max-r.min;return(E-r.min)/_*100},C=n.computed(()=>{const E={sm:16,md:20,lg:24};return`
|
|
66
|
+
`.trim();let r=document.getElementById(n);r||(r=document.createElement("style"),r.id=n,document.head.appendChild(r)),r.textContent=a}function Mx(e,n=hd){t.watch(e,o=>Dx(o,n),{immediate:!0})}const Nx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Px=["for"],vx={key:0,class:"ml-1 text-destructive"},Tx=["disabled","onClick"],Ox={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},zx=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Fx={class:"h-full p-2 flex flex-col gap-3 w-32"},Rx=["onClick"],Ix={class:"flex items-center justify-end gap-2 w-full p-2"},Lx=["disabled","onClick"],$x={key:1,class:"text-xs text-destructive"},Va=t.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(e,{emit:n}){const o=t.useAttrs(),a=e,r=n,s=Math.random().toString(36).slice(2,7),i=t.computed(()=>`dcode-datepicker-${o.id||a.label||"date-picker"}-${s}`),l=t.computed(()=>{const N=o.required,T=o["aria-required"];return N===""||N===!0||N==="true"||T==="true"||T===!0}),c=t.computed(()=>!!a.error),d=t.computed({get:()=>a.modelValue,set:N=>{r("update:modelValue",N),r("change",N)}}),u=t.computed(()=>a.locale==="en"?ad:Vx),f=t.computed(()=>a.range?2:!1),h=t.computed(()=>{if(!a.range)return!1;const N={partialRange:!1};return a.autoRangeDays&&a.autoRangeDays>0&&(N.maxRange=a.autoRangeDays,N.autoRange=a.autoRangeDays),N}),m=N=>{const T=new Date(N);return T.setHours(0,0,0,0),T},p=N=>{const T=new Date(N);return T.setHours(23,59,59,999),T},x=(N,T)=>{const K=new Date(N);return K.setDate(K.getDate()+T),K},y=t.computed(()=>{if(a.disablePast)return m(new Date)}),g=t.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return p(x(new Date,a.maxDaysAhead))}),B=t.ref(null),k=t.ref(null),C=N=>{k.value={month:N.month,year:N.year}},E=t.ref(!1);let _=null;t.onMounted(()=>{const N=document.documentElement,T=()=>E.value=N.classList.contains("dark");T(),_=new MutationObserver(T),_.observe(N,{attributes:!0,attributeFilter:["class"]})}),t.onBeforeUnmount(()=>{_==null||_.disconnect(),_=null}),Mx(t.toRef(a,"tone"));const w=N=>{const T=new Date(N),K=T.getDay(),R=T.getDate()-K+(K===0?-6:1);return T.setDate(R),m(T)},b=N=>{const T=w(N);return T.setDate(T.getDate()+6),p(T)},A=N=>{const T=new Date(N);return T.setDate(1),m(T)},D=N=>{const T=new Date(N);return T.setMonth(T.getMonth()+1),T.setDate(0),p(T)},M=t.computed(()=>{if(!a.range)return[];const N=new Date,T=m(N),K=w(N),R=b(N),I=A(N),q=D(N),ne=(W,U)=>{let ee=W;a.disablePast&&ee<T&&(ee=T);let v=U;if(a.autoRangeDays&&a.autoRangeDays>0){const O=p(x(ee,a.autoRangeDays-1));v>O&&(v=O)}return v<ee&&(v=p(new Date(ee))),[ee,v]};return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:ne(K,R)},{label:a.locale==="id"?"Bulan Ini":"This Month",range:ne(I,q)}]}),V=async N=>{var U,ee;const T=a.modelType||"yyyy-MM-dd";if(N.length===0){d.value=null;return}if(N.length<2)return;const K=ud(N[0],T),R=ud(N[1],T);d.value=[K,R],await t.nextTick();const I=N[0],q=I.getMonth(),ne=I.getFullYear();k.value&&k.value.month===q&&k.value.year===ne||(U=B.value)==null||U.setMonthYear({month:q,year:ne}),(ee=B.value)==null||ee.openMenu()};return(N,T)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-1 w-full",t.unref(o).class])},[e.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.label?(t.openBlock(),t.createElementBlock("div",Nx)):t.createCommentVNode("",!0),T[2]||(T[2]=t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[t.createTextVNode(t.toDisplayString(e.label)+" ",1),l.value?(t.openBlock(),t.createElementBlock("span",vx,"*")):t.createCommentVNode("",!0)],8,Px)):t.createCommentVNode("",!0),t.createVNode(t.unref(eu.VueDatePicker),{ref_key:"dpRef",ref:B,modelValue:d.value,"onUpdate:modelValue":T[1]||(T[1]=K=>d.value=K),dark:E.value,range:h.value,"multi-calendars":f.value,disabled:e.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":e.modelType,formats:{input:e.displayFormat},"min-date":y.value,"max-date":g.value,"preset-ranges":M.value,floating:{placement:e.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:C},t.createSlots({"dp-input":t.withCtx(({value:K,onInput:R,onEnter:I,onTab:q,onBlur:ne,onFocus:W,onKeypress:U,onPaste:ee,toggleMenu:v})=>[t.createElementVNode("div",{class:t.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":""]])},[t.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:O=>v()},[t.createVNode(t.unref(oe.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Tx),T[4]||(T[4]=t.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",Ox,t.toDisplayString(e.prependInner),1),T[3]||(T[3]=t.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):t.createCommentVNode("",!0),t.createElementVNode("input",{id:i.value,value:K,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:t.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",e.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:O=>v(),onFocus:O=>W(),onBlur:O=>ne(),onInput:O=>R(O),onKeydown:[t.withKeys(O=>I(O),["enter"]),t.withKeys(O=>q(O),["tab"])],onKeypress:O=>U(O),onPaste:O=>ee()},null,42,zx)],2)]),"action-buttons":t.withCtx(({selectDate:K,selectionDisabled:R})=>[t.createElementVNode("div",Ix,[t.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:T[0]||(T[0]=I=>{var q;return(q=B.value)==null?void 0:q.closeMenu()})},t.toDisplayString(e.cancelLabel),1),t.createElementVNode("button",{type:"button",disabled:R,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:I=>K()},t.toDisplayString(e.selectLabel),9,Lx)])]),_:2},[e.range?{name:"left-sidebar",fn:t.withCtx(()=>[t.createElementVNode("div",Fx,[M.value.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(M.value,K=>(t.openBlock(),t.createElementBlock("button",{key:K.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:R=>V(K.range)},t.toDisplayString(K.label),9,Rx))),128)):t.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(t.openBlock(),t.createElementBlock("p",$x,t.toDisplayString(a.error),1)):t.createCommentVNode("",!0)],64))],2))}}),Wx=t.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const o=e,a=n,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogRoot),t.normalizeProps(t.guardReactiveProps(t.unref(r))),{default:t.withCtx(()=>[t.renderSlot(s.$slots,"default")]),_:3},16))}}),jx=t.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const o=e,a=n,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogPortal),null,{default:t.withCtx(()=>[t.createVNode(t.unref(ue.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),t.createVNode(t.unref(ue.DialogContent),t.mergeProps({...t.unref(s),...i.$attrs},{class:t.unref(Ee)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:t.withCtx(()=>[t.renderSlot(i.$slots,"default"),t.createVNode(t.unref(ue.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.X),{class:"w-4 h-4"}),l[0]||(l[0]=t.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Ux=t.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogDescription),t.mergeProps(t.unref(a),{class:t.unref(Ee)("text-sm text-muted-foreground",n.class)}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Hx=t.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogTitle),t.mergeProps(t.unref(a),{class:t.unref(Ee)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),qx={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md sticky top-0 z-20"},Gx={class:"flex items-center gap-3"},Xx={class:"flex flex-col"},Yx={key:0,class:"flex items-center gap-2"},Kx={key:1,class:"px-6 py-4 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/50 sticky bottom-0 z-20"},Jx={class:"flex justify-end gap-3 flex-wrap"},Mo=pt(t.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,r=t.useAttrs(),s=t.computed(()=>{const{style:d,...u}=r;return u}),i=t.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=t.computed(()=>o.icon?Et[o.icon]??null:null),c=d=>{a("update:modelValue",d)};return(d,u)=>(t.openBlock(),t.createBlock(t.unref(Wx),{open:e.modelValue,"onUpdate:open":c},{default:t.withCtx(()=>[t.createVNode(t.unref(jx),t.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-950 border-0",onInteractOutside:u[0]||(u[0]=f=>e.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>e.persistent?f.preventDefault():null)}),{default:t.withCtx(()=>[e.title||d.$slots["header-append"]?(t.openBlock(),t.createElementBlock("div",qx,[t.createElementVNode("div",Gx,[l.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):t.createCommentVNode("",!0),t.createElementVNode("div",Xx,[t.createVNode(t.unref(Hx),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1}),t.createVNode(t.unref(Ux),{class:"hidden"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(t.openBlock(),t.createElementBlock("div",Yx,[t.renderSlot(d.$slots,"header-append",{},void 0,!0)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:t.normalizeStyle(e.contentStyle)},[t.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(t.openBlock(),t.createElementBlock("div",Kx,[t.createElementVNode("div",Jx,[t.renderSlot(d.$slots,"actions",{},void 0,!0)])])):t.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),md=t.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const n=e,o=t.computed(()=>Et[n.icon]??Et.X);return(a,r)=>(t.openBlock(),t.createBlock(t.unref(mt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Qx=t.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)(t.unref(ek)({variant:e.variant}),n.class)),role:"alert"},[t.renderSlot(o.$slots,"default")],2))}}),Zx=t.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("text-sm [&_p]:leading-relaxed",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),ek=ao("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Hn=t.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)(t.unref(tk)({variant:e.variant}),n.class))},[t.renderSlot(o.$slots,"default")],2))}}),tk=ao("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),us=t.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),fs=t.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("p-6 pt-0",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),hs=t.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("flex flex-col gap-y-1.5 p-6",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),ms=t.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("h3",{class:t.normalizeClass(t.unref(Ee)("font-medium leading-none tracking-tight",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),nk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},ok={class:"flex flex-wrap items-center justify-center gap-2"},ak=["accept","multiple"],Da=pt(t.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(e,{emit:n}){const o=e,a=n,r=t.ref(null),s=t.ref(!1),i=t.ref(null),l=t.ref(null),c=t.ref(null);t.computed(()=>o.accept||"file/*");const d=t.computed(()=>o.error??i.value);function u(){var w;o.disabled||(w=r.value)==null||w.click()}function f(w){const b=w/1024,A=b/1024;return A>=1?`${A.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${w} B`}function h(w){var A;if(!w)return"File tidak valid";if((A=o.accept)!=null&&A.includes("image/")&&!w.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return w.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(w){l.value=w.name,c.value=w.size}function p(w){if(i.value=null,!w.length)return;if(o.mode==="single"){const A=w[0],D=h(A);if(D){i.value=D,a("error",D);return}o.showSelected&&m(A),a("picked",A);return}const b=[];for(const A of w){const D=h(A);if(D){i.value=D,a("error",D);return}b.push(A)}b.length&&(o.showSelected&&m(b[0]),a("picked:multiple",b))}function x(w){const b=w.target,A=Array.from(b.files??[]);p(A),b.value=""}function y(){o.disabled||(s.value=!0)}function g(){o.disabled||(s.value=!0)}function B(){s.value=!1}function k(w){var D,M;if(o.disabled)return;s.value=!1;const b=Array.from(((D=w.dataTransfer)==null?void 0:D.files)??[]),A=(M=o.accept)!=null&&M.includes("image/")?b.filter(V=>V.type.startsWith("image/")):b;p(A)}const C=t.computed(()=>(o.accept||"file/*").split(",").map(w=>w.trim()).filter(Boolean).map(w=>w==="image/*"?"IMAGE":w.replace(/^image\//,"").replace(/^\./,"")).join(", "));t.computed(()=>`${o.maxSizeMb??0}MB`);const E=t.ref(!1),_=t.computed(()=>{if(o.disabled||!E.value)return{};const w=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:w?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:w?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(w,b)=>(t.openBlock(),t.createBlock(t.unref(us),{class:t.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:t.withCtx(()=>[t.createVNode(t.unref(hs),{class:"pb-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(ms),{class:"text-sm font-semibold dark:text-neutral-100"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})]),_:1}),t.createVNode(t.unref(fs),{class:"pt-2"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",e.disabled?"is-disabled":""]]),style:t.normalizeStyle([{minHeight:"190px"},_.value]),onClick:u,onDragenter:t.withModifiers(y,["prevent"]),onDragover:t.withModifiers(g,["prevent"]),onDragleave:t.withModifiers(B,["prevent"]),onDrop:t.withModifiers(k,["prevent"]),onMouseenter:b[0]||(b[0]=A=>E.value=!0),onMouseleave:b[1]||(b[1]=A=>E.value=!1)},[t.createElementVNode("div",nk,[b[2]||(b[2]=t.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=t.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),t.createElementVNode("div",ok,[t.createVNode(t.unref(Hn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:t.withCtx(()=>[t.createTextVNode(" Allowed: "+t.toDisplayString(C.value),1)]),_:1}),t.createVNode(t.unref(Hn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:t.withCtx(()=>[t.createTextVNode(" Max: "+t.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(t.openBlock(),t.createBlock(t.unref(Hn),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.value)+" • "+t.toDisplayString(c.value?f(c.value):""),1)]),_:1})):t.createCommentVNode("",!0)]),t.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:x},null,40,ak)],38),d.value?(t.openBlock(),t.createBlock(t.unref(Qx),{key:0,variant:"destructive",class:"mt-3"},{default:t.withCtx(()=>[t.createVNode(t.unref(Zx),{class:"text-sm"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.value),1)]),_:1})]),_:1})):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-02ca61c0"]]),rk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},sk=["src"],ik={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},lk={class:"space-y-0.5"},ck={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},dk={class:"text-xs opacity-70"},uk=["disabled"],fk={key:1},hk=["disabled"],mk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},pk={class:"flex gap-2"},gk={class:"font-medium truncate"},bk={class:"flex gap-2"},yk={class:"font-medium"},xk={class:"flex gap-2"},kk={class:"font-medium truncate"},ps=pt(t.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(e,{emit:n}){const o=e,a=n,r=t.ref(null),s=t.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));t.watch(()=>o.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),t.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),u&&u.disconnect()});function i(m){const p=m/1024,x=p/1024;return x>=1?`${x.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${m} B`}const l=t.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=t.ref(!1),d=t.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};t.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=t.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,p)=>e.file?(t.openBlock(),t.createBlock(us,{key:0,class:t.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:t.withCtx(()=>[t.createVNode(hs,{class:"pb-2"},{default:t.withCtx(()=>[t.createVNode(ms,{class:"text-sm font-semibold dark:text-neutral-100"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1}),e.description?(t.openBlock(),t.createElementBlock("div",rk,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0)]),_:1}),t.createVNode(fs,{class:"pt-2"},{default:t.withCtx(()=>{var x,y,g,B,k;return[t.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-800/50 border-border dark:border-neutral-700 w-full",style:t.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:p[2]||(p[2]=C=>c.value=!0),onMouseleave:p[3]||(p[3]=C=>c.value=!1)},[s.value&&r.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,sk)):(t.openBlock(),t.createElementBlock("div",ik,[t.createVNode(t.unref(oe.FileText),{class:"w-10 h-10"}),t.createElementVNode("div",lk,[t.createElementVNode("p",ck,t.toDisplayString((x=l.value)==null?void 0:x.name),1),t.createElementVNode("p",dk,t.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),t.createElementVNode("div",{class:"d-action-buttons",style:t.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[e.showEdit&&s.value?(t.openBlock(),t.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:t.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[0]||(p[0]=C=>a("edit"))},[t.createVNode(t.unref(oe.Pencil),{style:{width:"16px",height:"16px"}})],12,uk)):(t.openBlock(),t.createElementBlock("div",fk)),e.showRemove?(t.openBlock(),t.createElementBlock("button",{key:2,disabled:e.disabled,class:"d-action-btn shadow-md",style:t.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[1]||(p[1]=C=>a("remove"))},[t.createVNode(t.unref(oe.Trash2),{style:{width:"16px",height:"16px"}})],12,hk)):t.createCommentVNode("",!0)],4),t.createElementVNode("div",{class:"d-metadata-overlay",style:t.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[t.createElementVNode("div",mk,[t.createElementVNode("div",pk,[p[4]||(p[4]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),t.createElementVNode("span",gk,t.toDisplayString((g=l.value)==null?void 0:g.name),1)]),t.createElementVNode("div",bk,[p[5]||(p[5]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),t.createElementVNode("span",yk,t.toDisplayString((B=l.value)==null?void 0:B.size),1)]),t.createElementVNode("div",xk,[p[6]||(p[6]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),t.createElementVNode("span",kk,t.toDisplayString((k=l.value)==null?void 0:k.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function gs(){const e=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:e,success:(s,i)=>e({type:"success",message:s,title:i}),error:(s,i)=>e({type:"error",message:s,title:i}),warning:(s,i)=>e({type:"warning",message:s,title:i}),info:(s,i)=>e({type:"info",message:s,title:i})}}const wk={class:"space-y-3"},Ck={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},pd=t.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:n}){const o=e,a=n,r=t.computed({get:()=>o.modelValue,set:_=>a("update:modelValue",_)}),s=t.ref(null),i=t.ref(null);function l(_){i.value=_,a("error",_)}function c(){i.value=null}const d=t.computed(()=>{const _=(o.allowedTypes??"").trim();return _?_.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(_){const w=_.lastIndexOf(".");return w>=0?_.slice(w).toLowerCase():""}const f=t.computed(()=>{if(d.value.length){const _=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),..._].join(",")}return o.accept}),h=t.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(_){if(d.value.length){const w=(_.type||"").toLowerCase(),b=u(_.name);return d.value.some(A=>A.includes("/")?w===A:A.startsWith(".")?b===A:b===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const w=o.accept.split(",").map(D=>D.trim().toLowerCase()),b=(_.type||"").toLowerCase(),A=u(_.name);return w.some(D=>{if(D.endsWith("/*")){const M=D.slice(0,-2);return b.startsWith(M)}return D.startsWith(".")?A===D:b===D})}return!0}function p(_){return _*1024*1024}async function x(_){return _?m(_)?o.minSizeMb!=null&&_.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&_.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:y}=qe(),g=gs(),B=t.ref(!1);async function k(_){var w;if(o.uploadFn){try{B.value=!0;const b=await o.uploadFn(_);r.value=_,a("uploaded",b)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{B.value=!1}return}if(!((w=o.endpoint)!=null&&w.apiUrl)){r.value=_;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{B.value=!0;const b=new FormData;b.append("doc",_);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,M=await y("","",b,{_url:D,_method:A,withCredentials:!0,transformRequest:[(N,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),N)]}),V=(M==null?void 0:M.data)??M;r.value=_,a("uploaded",V)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{B.value=!1}}async function C(_){var b;if(o.disabled)return;c();const w=await x(_);if(w){l(w);return}s.value=_,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await k(_):r.value=_}function E(){c(),r.value=null,s.value=null}return t.watch(()=>o.modelValue,_=>{_&&!s.value&&(s.value=_),_||(s.value=null)},{immediate:!0}),(_,w)=>(t.openBlock(),t.createElementBlock("div",wk,[r.value?B.value?(t.openBlock(),t.createElementBlock("div",Ck,[...w[1]||(w[1]=[t.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(t.openBlock(),t.createBlock(ps,{key:2,file:r.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:E},null,8,["file","title","description","disabled","preview-height","preview-width"])):(t.openBlock(),t.createBlock(Da,{key:0,label:e.label,hint:e.hint,accept:f.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||B.value,onPicked:C,error:i.value,onError:w[0]||(w[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Bk=["for"],_k={key:0,class:"!ml-1 !text-destructive"},Ek={class:"relative w-full block box-border"},Sk={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Ak=["id","readonly","disabled","placeholder"],Vk={class:"absolute inset-y-0 right-4 flex items-center z-10"},Dk={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},Mk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Nk={key:1,class:"text-sm text-muted-foreground text-center"},Pk=["onClick","title"],vk={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},Tk={class:"flex items-center justify-center flex-1"},Ok={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},zk={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},gd=t.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(e,{emit:n}){const o=e,a=n,r=Et,s=t.ref(null),i=t.ref(null),l=Math.random().toString(36).slice(2,7),c=t.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=t.ref(!1),u=t.computed(()=>(o.modelValue??"").trim()||""),f=t.ref(""),h=t.ref(!1),m=t.ref(!1),p=t.ref(!1),x=t.shallowRef([]),y=t.ref(o.pageSize),g=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(m.value||p.value)return;p.value=!0,await new Promise(U=>setTimeout(U,0));const W=Object.keys(r).filter(U=>!g.has(U)).filter(U=>/^[A-Z]/.test(U)).filter(U=>typeof r[U]=="function"||typeof r[U]=="object"&&r[U]).sort((U,ee)=>U.localeCompare(ee));x.value=W,m.value=!0,p.value=!1},k=t.computed(()=>!m.value||!u.value||!x.value.includes(u.value)?null:r[u.value]),C=t.ref(u.value),E=t.computed(()=>!!u.value&&!d.value),_=t.computed(()=>{if(!m.value)return[];const W=(f.value??"").trim().toLowerCase();return W?x.value.filter(U=>U.toLowerCase().includes(W)):x.value}),w=t.computed(()=>_.value.slice(0,y.value)),b=t.computed(()=>{const W=o.columns;return W<=2?"grid-cols-2":W===3?"grid-cols-3":W===4?"grid-cols-4":W===5?"grid-cols-5":W>=8?"grid-cols-8":"grid-cols-6"});t.computed(()=>o.clearable?"!pr-10":"!pr-3"),t.computed(()=>k.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var W;await t.nextTick(),(W=i.value)==null||W.focus()},D=async W=>{if(o.disabled)return;const U=W!==!1;if(h.value){h.value=!1;return}d.value=!0,await B(),U&&(f.value="",C.value=""),y.value=o.pageSize,await A()},M=()=>{d.value=!1,f.value="",C.value=u.value,y.value=o.pageSize},V=async()=>{o.disabled||(d.value?M():await D())};let N=null;const T=async W=>{if(o.disabled)return;a("update:modelValue",null),d.value||await D(!1),N&&clearTimeout(N);const U=C.value;N=setTimeout(()=>{f.value=U},300)},K=W=>{o.disabled||(a("update:modelValue",W),M(),queueMicrotask(()=>{var U;return(U=i.value)==null?void 0:U.blur()}))},R=()=>{o.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,M(),queueMicrotask(()=>{var W;return(W=i.value)==null?void 0:W.focus()}))},I=W=>{if(W.key==="Escape"){W.preventDefault(),M();return}if(W.key==="Enter"&&d.value){const U=_.value[0];U&&(W.preventDefault(),K(U))}},q=W=>{if(!d.value)return;const U=W.target;s.value&&!s.value.contains(U)&&M()},ne=W=>{const U=W.target;U.scrollTop+U.clientHeight>=U.scrollHeight-24&&y.value<_.value.length&&(y.value=Math.min(y.value+o.pageSize,_.value.length))};return t.onMounted(()=>{document.addEventListener("mousedown",q),queueMicrotask(()=>{var W;i.value=((W=s.value)==null?void 0:W.querySelector("input"))??null}),u.value&&B()}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",q),N&&clearTimeout(N)}),t.watch(u,W=>{d.value||(C.value=W)}),t.watch(()=>f.value,()=>{y.value=o.pageSize}),(W,U)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[t.createTextVNode(t.toDisplayString(o.label)+" ",1),o.required?(t.openBlock(),t.createElementBlock("span",_k,"*")):t.createCommentVNode("",!0)],8,Bk)):t.createCommentVNode("",!0),t.createElementVNode("div",Ek,[k.value&&!d.value?(t.openBlock(),t.createElementBlock("div",Sk,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(k.value),{size:18}))])):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("input",{id:c.value,"onUpdate:modelValue":U[0]||(U[0]=ee=>C.value=ee),readonly:E.value,disabled:o.disabled,placeholder:o.placeholder,class:t.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 pr-10 outline-none box-border truncate",[k.value&&!d.value?"pl-10":"pl-4",E.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:T,onKeydown:I},null,42,Ak),[[t.vModelText,C.value]]),t.createElementVNode("div",Vk,[o.clearable&&u.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:U[1]||(U[1]=t.withModifiers(()=>{},["prevent"])),onClick:R,title:"Clear"},[t.createVNode(t.unref(oe.X),{class:"h-4 w-4"})],32)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:U[2]||(U[2]=t.withModifiers(()=>{},["prevent"])),onClick:V,title:"Open"},[t.createVNode(t.unref(oe.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(t.openBlock(),t.createElementBlock("div",Dk,[t.createElementVNode("div",{class:"p-2 overflow-auto",style:t.normalizeStyle({maxHeight:o.maxHeight}),onScroll:ne},[p.value?(t.openBlock(),t.createElementBlock("div",Mk,[t.createVNode(t.unref(oe.Loader2),{class:"h-4 w-4 animate-spin"}),U[3]||(U[3]=t.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&_.value.length===0?(t.openBlock(),t.createElementBlock("div",Nk," Icon tidak ditemukan ")):(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(["grid gap-2",b.value])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,ee=>(t.openBlock(),t.createElementBlock("button",{key:ee,type:"button",class:t.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ee?"ring-1 ring-primary":""]),onClick:v=>K(ee),title:ee},[t.createElementVNode("div",vk,[t.createElementVNode("div",Tk,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(r)[ee]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),t.createElementVNode("span",Ok,t.toDisplayString(ee),1)])],10,Pk))),128))],2)),m.value&&_.value.length>0?(t.openBlock(),t.createElementBlock("div",zk," Showing "+t.toDisplayString(w.value.length)+" / "+t.toDisplayString(_.value.length),1)):t.createCommentVNode("",!0)],36)])):t.createCommentVNode("",!0)])],512))}}),Fk={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Rk={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},Ik={class:"relative overflow-auto p-0"},bs=t.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(e,{emit:n}){const o=e,a=n,r=t.computed({get:()=>o.modelValue,set:k=>a("update:modelValue",k)}),s=t.ref(null),i=t.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function h(k,C,E,_,w){const b=await new Promise((M,V)=>{const N=URL.createObjectURL(k),T=new Image;T.onload=()=>{URL.revokeObjectURL(N),M(T)},T.onerror=K=>{URL.revokeObjectURL(N),V(K)},T.src=N}),A=document.createElement("canvas");A.width=C,A.height=E;const D=A.getContext("2d");return D?(D.drawImage(b,0,0,C,E),await new Promise(M=>{A.toBlob(V=>M(V||k),_,w)})):k}function m(){if(!l||!i.value)return;const k=l.getPlugin("Dashboard"),C=l.getFile(i.value);!k||!C||requestAnimationFrame(()=>{try{k.openFileEditor(C)}catch{try{k.openFileEditor(i.value)}catch{}}})}async function p(k){if(l){l.cancelAll(),i.value=null;try{const C=l.addFile({name:k.name,type:k.type,data:k,source:"Local",isRemote:!1});i.value=String(C)}catch{}}}function x(){if(!s.value)return;l&&f(),l=new tu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const k=document.documentElement.classList.contains("dark");l.use(Fs,{target:s.value,inline:!0,height:480,theme:k?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const C=document.documentElement.classList.contains("dark"),E=l.getPlugin("Dashboard");E&&E.setOptions({theme:C?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(nu,{target:Fs,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",C=>{i.value=(C==null?void 0:C.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async C=>{const E=++d;try{const _=C.data,w=_.type||C.type||"image/jpeg";let b=_;if(o.outputWidth&&o.outputHeight&&(b=await h(_,o.outputWidth,o.outputHeight,w,o.quality)),c||E!==d)return;const A=C.name||"edited-image.jpg",D=new File([b],A,{type:w});await y(D,"UPPY_EDITOR_COMPLETE"),a("done",D),r.value=!1}catch{}})}async function y(k,C="CROP_RESULT"){const E=URL.createObjectURL(k);try{const _=await new Promise((w,b)=>{const A=new Image;A.onload=()=>w(A),A.onerror=b,A.src=E});console.group(C),console.log("file:",k),console.table({name:k.name,type:k.type,sizeBytes:k.size,sizeMB:+(k.size/1024/1024).toFixed(3),width:_.naturalWidth,height:_.naturalHeight,ratio:+(_.naturalWidth/_.naturalHeight).toFixed(4)}),console.log("previewUrl:",E),console.groupEnd()}finally{URL.revokeObjectURL(E)}}t.watch(r,async k=>{c=!k,d++,k?(await t.nextTick(),x(),o.file&&await p(o.file)):f()},{flush:"post"}),t.watch(()=>o.file,async k=>{r.value&&k&&(await t.nextTick(),await p(k))}),t.onBeforeUnmount(()=>{c=!0,d++,f()});const g=k=>{k.key==="Escape"&&r.value&&(r.value=!1)};t.watch(r,k=>{k?globalThis.addEventListener("keydown",g):globalThis.removeEventListener("keydown",g)},{immediate:!0});const B=t.ref(!1);return(k,C)=>r.value?(t.openBlock(),t.createElementBlock("div",Fk,[t.createVNode(t.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:C[0]||(C[0]=E=>r.value=!1)})):t.createCommentVNode("",!0)]),_:1}),t.createVNode(t.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-800 bg-background dark:bg-neutral-900 shadow-2xl transition-all",onClick:C[4]||(C[4]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Rk,[C[6]||(C[6]=t.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),t.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:t.normalizeStyle({opacity:B.value?1:.7}),onClick:C[1]||(C[1]=E=>r.value=!1),onMouseenter:C[2]||(C[2]=E=>B.value=!0),onMouseleave:C[3]||(C[3]=E=>B.value=!1)},[t.createVNode(t.unref(oe.X),{class:"h-4 w-4"}),C[5]||(C[5]=t.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),t.createElementVNode("div",Ik,[t.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):t.createCommentVNode("",!0)]),_:1})])):t.createCommentVNode("",!0)}}),Lk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},$k=["src"],Wk=["disabled"],jk=["disabled"],Uk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Hk={class:"flex gap-2"},qk={class:"font-medium truncate"},Gk={class:"flex gap-2"},Xk={class:"font-medium"},Yk={class:"flex gap-2"},Kk={class:"font-medium truncate"},ys=pt(t.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(e,{emit:n}){const o=e,a=n,r=t.ref(null);t.watch(()=>o.file,h=>{r.value&&URL.revokeObjectURL(r.value),r.value=h?URL.createObjectURL(h):null},{immediate:!0}),t.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(h){const m=h/1024,p=m/1024;return p>=1?`${p.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=t.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=t.ref(!1),c=t.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};t.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=t.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(h,m)=>e.file?(t.openBlock(),t.createBlock(us,{key:0,class:t.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:t.withCtx(()=>[t.createVNode(hs,{class:"pb-2"},{default:t.withCtx(()=>[t.createVNode(ms,{class:"text-sm font-semibold dark:text-neutral-100"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1}),e.description?(t.openBlock(),t.createElementBlock("div",Lk,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0)]),_:1}),t.createVNode(fs,{class:"pt-2"},{default:t.withCtx(()=>{var p,x,y;return[t.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-800/50 border-border dark:border-neutral-700 w-full",style:t.normalizeStyle([{height:`${e.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=g=>l.value=!0),onMouseleave:m[3]||(m[3]=g=>l.value=!1)},[r.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,$k)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"d-action-buttons",style:t.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[e.showEdit?(t.openBlock(),t.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:t.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=g=>a("edit"))},[t.createVNode(t.unref(oe.Pencil),{style:{width:"16px",height:"16px"}})],12,Wk)):t.createCommentVNode("",!0),e.showRemove?(t.openBlock(),t.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:t.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=g=>a("remove"))},[t.createVNode(t.unref(oe.Trash2),{style:{width:"16px",height:"16px"}})],12,jk)):t.createCommentVNode("",!0)],4),t.createElementVNode("div",{class:"d-metadata-overlay",style:t.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[t.createElementVNode("div",Uk,[t.createElementVNode("div",Hk,[m[4]||(m[4]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),t.createElementVNode("span",qk,t.toDisplayString((p=i.value)==null?void 0:p.name),1)]),t.createElementVNode("div",Gk,[m[5]||(m[5]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),t.createElementVNode("span",Xk,t.toDisplayString((x=i.value)==null?void 0:x.size),1)]),t.createElementVNode("div",Yk,[m[6]||(m[6]=t.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),t.createElementVNode("span",Kk,t.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Jk={class:"space-y-3"},Ma=t.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:n}){const o=e,a=n,r=t.computed({get:()=>o.modelValue,set:R=>a("update:modelValue",R)}),s=t.ref(!1),i=t.ref(null),l=t.ref(null),c=t.ref(null);function d(R){c.value=R,a("error",R)}function u(){c.value=null}const f=t.computed(()=>{const R=(o.allowedTypes??"").trim();return R?R.split(/[,\s;]+/g).map(q=>q.trim().toLowerCase()).filter(Boolean).map(q=>q.includes("/")||q.startsWith(".")?q:`.${q}`):[]});function h(R){const I=R.lastIndexOf(".");return I>=0?R.slice(I).toLowerCase():""}const m=t.computed(()=>{if(f.value.length){const R=f.value.filter(q=>q.startsWith("."));return[...f.value.filter(q=>q.includes("/")),...R].join(",")}return o.accept||"image/*"}),p=t.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function x(R){if(f.value.length){const q=(R.type||"").toLowerCase(),ne=h(R.name);return f.value.some(W=>W.includes("/")?q===W:W.startsWith(".")?ne===W:ne===`.${W}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(R.type||"").toLowerCase().startsWith("image/"):!0}function y(R){return R*1024*1024}async function g(R){var I;return(I=R.type)!=null&&I.startsWith("image/")?await new Promise(q=>{const ne=URL.createObjectURL(R),W=new Image;W.onload=()=>{URL.revokeObjectURL(ne),q({w:W.naturalWidth,h:W.naturalHeight})},W.onerror=()=>{URL.revokeObjectURL(ne),q(null)},W.src=ne}):null}async function B(R){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const q=await g(R);return q?o.minWidth!=null&&q.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&q.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&q.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&q.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function k(R){return R?x(R)?o.minSizeMb!=null&&R.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&R.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await B(R):`only Allowed: ${p.value}`:"File tidak valid"}function C(R){o.disabled||(i.value=R,s.value=!0)}async function E(R){if(o.disabled)return;u();const I=await k(R);if(I){d(I);return}l.value=R,C(R)}const{DCodeApi:_}=qe(),w=gs(),b=t.ref(!1);t.ref(null);function A(R,I){return!R||!I?null:R.replace(/\/+$/,"")+"/"+I.replace(/^\/+/,"")}function D(R){var W;const I=(R==null?void 0:R.data)??R,q=(W=I==null?void 0:I.data)==null?void 0:W[0];if(!q)return null;const ne=A(q.server,q.url);return{...q,fullUrl:ne?encodeURI(ne):null}}async function M(R){var I;if(o.uploadFn){try{b.value=!0;const q=await o.uploadFn(R);r.value=R,a("uploaded",q)}catch(q){console.error("Upload Error",q),w.error("Upload Failed",(q==null?void 0:q.message)||"Unknown error"),d((q==null?void 0:q.message)||"Upload Failed")}finally{b.value=!1}return}if(!((I=o.endpoint)!=null&&I.apiUrl)){r.value=R;return}if(typeof _!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const q=new FormData;q.append("doc",R);const ne=(o.endpoint.apiMethod||"POST").toUpperCase(),W=o.endpoint.apiUrl,U=await _("","",q,{_url:W,_method:ne,withCredentials:!0,transformRequest:[(v,O)=>(O&&(delete O["Content-Type"],delete O["content-type"]),v)]}),ee=(U==null?void 0:U.data)??U;D(ee),r.value=R,a("uploaded",ee)}catch(q){console.error("Upload Error",q),w.error("Upload Failed",(q==null?void 0:q.message)||"Unknown error"),d((q==null?void 0:q.message)||"Upload Failed")}finally{b.value=!1}}async function V(R){var I;u(),o.uploadFn||(I=o.endpoint)!=null&&I.apiUrl?await M(R):r.value=R,s.value=!1,i.value=null}function N(){s.value=!1,i.value=null}async function T(){if(!r.value)return;u();const R=o.editUseOriginal?l.value??r.value:r.value,I=await k(R);if(I){d(I);return}C(R)}function K(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return t.watch(()=>o.modelValue,R=>{R&&!l.value&&(l.value=R),R||(l.value=null)},{immediate:!0}),(R,I)=>(t.openBlock(),t.createElementBlock("div",Jk,[r.value?(t.openBlock(),t.createBlock(ys,{key:1,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:T,onRemove:K,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(t.openBlock(),t.createBlock(Da,{key:0,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled,onPicked:E,error:c.value,onError:I[0]||(I[0]=q=>d(q))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),t.createVNode(bs,{modelValue:s.value,"onUpdate:modelValue":I[1]||(I[1]=q=>s.value=q),file:i.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:V,onCancel:N},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),qn=t.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const n=t.useAttrs(),o=e,a=t.computed(()=>o.icon&&Et[o.icon]||null),r=t.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=t.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=t.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=t.computed(()=>{const u=`${r.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=t.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(t.openBlock(),t.createElementBlock("span",t.mergeProps({class:c.value},d.value),[a.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value),{key:0,class:t.normalizeClass(["shrink-0",i.value,e.iconClass])},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(e.label||e.text),1)],16))}}),Qk=["aria-busy"],Zk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ew=["for"],tw={key:0,class:"ml-1 text-destructive"},nw=["id","disabled"],ow={class:"min-w-0 flex-1 text-left"},aw={key:0,class:"flex flex-wrap gap-1.5"},rw={class:"max-w-[220px] truncate"},sw=["onClick"],iw={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},lw={key:1,class:"text-muted-foreground truncate"},cw={class:"flex items-center gap-2 shrink-0"},dw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},uw=["placeholder","onKeydown"],fw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},hw=["disabled","onClick"],mw={class:"truncate"},pw={key:0,class:"text-primary-600 dark:text-primary-400"},gw={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},bw={key:0},yw={key:1},xw={key:1,class:"text-xs text-destructive"},xs=t.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(e,{emit:n}){const o=t.useAttrs(),a=n,r=e,s=t.computed(()=>(r.label||o.label)??void 0),i=t.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=t.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=t.computed(()=>{if(r.required)return!0;const Z=o.required,se=o["aria-required"];return Z===""||Z===!0||Z==="true"||(se==="true"||se===!0)}),u=t.computed(()=>!!r.error);function f(Z){return Z?typeof r.itemTitle=="function"?r.itemTitle(Z)??"":String((Z==null?void 0:Z[r.itemTitle])??""):""}function h(Z){return Z?typeof r.itemValue=="function"?r.itemValue(Z):Z==null?void 0:Z[r.itemValue]:null}function m(Z,se){return h(Z)??se}const p=t.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),x=t.computed(()=>{var Z;return!!((Z=r.endpoint)!=null&&Z.apiUrl)||!!r.fetchItems}),y=t.ref([]),g=t.ref(!1),B=t.ref(!1),k=t.computed(()=>{var se;const Z=(se=r.endpoint)==null?void 0:se.apiOptions;if(Z)return typeof Z=="function"?Z():Z}),C=t.computed(()=>{var we,je;const Z=((we=r.endpoint)==null?void 0:we.apiUrl)??"",se=(((je=r.endpoint)==null?void 0:je.apiMethod)??"GET").toUpperCase(),ce=JSON.stringify(k.value??null);return`${se} ${Z} :: ${ce}`}),E=t.computed(()=>x.value?y.value:r.items||[]);async function _(){var Z;if(x.value&&!(!((Z=r.endpoint)!=null&&Z.apiUrl)&&!r.fetchItems)&&!g.value){g.value=!0;try{let se;if(r.fetchItems){const ce=await r.fetchItems(),we=(ce==null?void 0:ce.data)??ce;se=(we==null?void 0:we.data)??we}else{const{DCodeApi:ce}=qe();if(typeof ce!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const we={page:1,perPage:100,...k.value||{}},je=await ce("","",we,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Tt=(je==null?void 0:je.data)??je;se=(Tt==null?void 0:Tt.data)??Tt}y.value=Array.isArray(se)?se:[],B.value=!0}catch(se){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",se),y.value=[]}finally{g.value=!1}}}t.watch(()=>C.value,()=>{y.value=[],B.value=!1}),t.onMounted(()=>{r.autoFetchOnMount&&x.value&&_()});const w=t.computed(()=>{const Z=p.value;if(r.returnObject)return Z;const se=new Map;for(const ce of E.value)se.set(h(ce),ce);return Z.map(ce=>se.get(ce)??{[r.itemValue]:ce,[r.itemTitle]:String(ce)})}),b=t.computed(()=>r.maxChips===null?w.value:w.value.slice(0,r.maxChips));function A(Z){const se=p.value;if(r.returnObject){const ce=h(Z);return se.some(we=>h(we)===ce)}return se.includes(h(Z))}const D=t.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const Z=Number(r.maxSelected);return Number.isFinite(Z)&&Z>0?Z:null}),M=t.computed(()=>{const Z=D.value;return Z===null?!1:p.value.length>=Z});function V(Z){return!A(Z)&&M.value}const N=t.computed(()=>{const Z=p.value,se=new Set;if(r.returnObject)for(const ce of Z)se.add(h(ce));else for(const ce of Z)se.add(ce);return se}),T=t.computed(()=>{const Z=N.value;return(E.value||[]).filter(se=>!Z.has(h(se)))}),K=t.computed(()=>E.value.length===0?!1:T.value.length===0),R=t.ref(null),I=t.ref(null),q=t.ref(null),ne=t.ref(!1),W=t.ref(""),U=t.ref(0),ee=t.ref(0),{floatingStyles:v}=pr(R,I,{whileElementsMounted:dr,placement:"bottom-start",middleware:[ur(8),hr(),fr({padding:8}),mr({apply({rects:Z,elements:se}){Object.assign(se.floating.style,{width:`${Z.reference.width}px`,"--floating-width":`${Z.reference.width}px`})}})]}),O=t.computed(()=>v.value),$=t.computed(()=>{const Z=Number(r.maxRows);return Number.isFinite(Z)&&Z>0?Z:5});async function X(){r.disabled||(ne.value=!0,ee.value=0,requestAnimationFrame(()=>{q.value&&(q.value.scrollTop=0),U.value=0}),x.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!g.value&&await _())}function te(){ne.value=!1}function ie(){ne.value?te():X()}function re(Z){var ce,we;if(!ne.value)return;const se=Z.target;(ce=R.value)!=null&&ce.contains(se)||(we=I.value)!=null&&we.contains(se)||te()}t.onMounted(()=>document.addEventListener("mousedown",re)),t.onBeforeUnmount(()=>document.removeEventListener("mousedown",re));function z(Z){if(r.disabled)return;if(V(Z)){a("max");return}const se=[...p.value];if(r.returnObject){const ce=h(Z);if(se.some(je=>h(je)===ce))return;a("update:modelValue",[...se,Z])}else{const ce=h(Z);if(se.includes(ce))return;a("update:modelValue",[...se,ce])}W.value="",ee.value=0,requestAnimationFrame(()=>{q.value&&(q.value.scrollTop=0),U.value=0})}function P(Z){if(r.disabled)return;const se=[...p.value];if(r.returnObject){const ce=h(Z);a("update:modelValue",se.filter(we=>h(we)!==ce))}else{const ce=h(Z);a("update:modelValue",se.filter(we=>we!==ce))}}function H(){r.disabled||(a("update:modelValue",[]),a("clear"),te())}const Y=t.computed(()=>{const Z=W.value.trim().toLowerCase(),se=T.value;return Z?se.filter(ce=>f(ce).toLowerCase().includes(Z)):se}),ae=t.computed(()=>Y.value.length);t.watch(ne,Z=>{Z||(W.value="")});const ye=t.computed(()=>{if(K.value)return r.itemHeight;const Z=ae.value;return(Z<=0?1:Math.min(Z,$.value))*r.itemHeight}),xe=t.computed(()=>r.virtual?ae.value*r.itemHeight:0),pe=t.computed(()=>r.virtual?Math.ceil(ye.value/r.itemHeight)+r.overscan:ae.value),ke=t.computed(()=>{if(!r.virtual)return 0;const Z=Math.floor(U.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,Z)}),Fe=t.computed(()=>r.virtual?Math.min(ae.value,ke.value+pe.value):ae.value),Ze=t.computed(()=>r.virtual?ke.value*r.itemHeight:0),it=t.computed(()=>{const Z=Y.value;return r.virtual?Z.slice(ke.value,Fe.value):Z});function _t(Z){const se=Z.target;U.value=se.scrollTop}function et(Z){return Z===ee.value}function G(Z){const se=q.value;if(!se||!r.virtual)return;const ce=Z*r.itemHeight,we=ce+r.itemHeight,je=se.scrollTop,Tt=se.scrollTop+se.clientHeight;ce<je?se.scrollTop=ce:we>Tt&&(se.scrollTop=we-se.clientHeight)}function le(Z){const se=Math.max(0,ae.value-1);ee.value=Math.min(se,Math.max(0,ee.value+Z)),G(ee.value)}function be(){const Z=Y.value[ee.value];Z&&z(Z)}const Oe=t.computed(()=>r.clearable&&!r.disabled&&w.value.length>0),De=t.computed(()=>u.value?"border-destructive ring-1 ring-destructive":ne.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Z,se)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-1 w-full",t.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.value?(t.openBlock(),t.createElementBlock("div",Zk)):t.createCommentVNode("",!0),se[3]||(se[3]=t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.value?(t.openBlock(),t.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[t.createTextVNode(t.toDisplayString(s.value)+" ",1),d.value?(t.openBlock(),t.createElementBlock("span",tw,"*")):t.createCommentVNode("",!0)],8,ew)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"referenceEl",ref:R,class:"relative"},[t.createElementVNode("button",{id:c.value,type:"button",class:t.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",De.value]]),disabled:r.disabled,onClick:ie},[t.createElementVNode("div",ow,[w.value.length?(t.openBlock(),t.createElementBlock("div",aw,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,(ce,we)=>(t.openBlock(),t.createElementBlock("div",{key:`chip-${m(ce,we)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[t.createElementVNode("span",rw,t.toDisplayString(f(ce)),1),r.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:t.withModifiers(je=>P(ce),["stop"]),"aria-label":"Remove"}," ✕ ",8,sw))]))),128)),r.maxChips!==null&&w.value.length>r.maxChips?(t.openBlock(),t.createElementBlock("div",iw," +"+t.toDisplayString(w.value.length-(r.maxChips??0)),1)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("div",lw,t.toDisplayString(r.placeholder),1))]),t.createElementVNode("div",cw,[Oe.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:t.withModifiers(H,["stop"]),"aria-label":"Clear"}," ✕ ")):t.createCommentVNode("",!0),t.createVNode(t.unref(oe.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,nw),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[ne.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:I,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-900 border-gray-200 dark:border-gray-800",style:t.normalizeStyle(O.value)},[r.searchable&&!K.value?(t.openBlock(),t.createElementBlock("div",dw,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":se[0]||(se[0]=ce=>W.value=ce),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-900 border border-gray-200 dark:border-gray-800 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[se[1]||(se[1]=t.withKeys(t.withModifiers(ce=>le(1),["prevent"]),["down"])),se[2]||(se[2]=t.withKeys(t.withModifiers(ce=>le(-1),["prevent"]),["up"])),t.withKeys(t.withModifiers(be,["prevent"]),["enter"]),t.withKeys(t.withModifiers(te,["prevent"]),["esc"])]},null,40,uw),[[t.vModelText,W.value]])])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"listEl",ref:q,class:"relative overflow-auto",style:t.normalizeStyle({height:ye.value+"px"}),onScroll:_t},[K.value?(t.openBlock(),t.createElementBlock("div",fw," All items have been selected ")):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r.virtual?(t.openBlock(),t.createElementBlock("div",{key:0,style:t.normalizeStyle({height:xe.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:t.normalizeStyle(r.virtual?{transform:`translateY(${Ze.value}px)`}:void 0)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(it.value,(ce,we)=>(t.openBlock(),t.createElementBlock("button",{key:String(m(ce,ke.value+we)),type:"button",class:t.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[V(ce)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",et(ke.value+we)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(ce)?"font-semibold":"font-normal"]]),style:t.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||V(ce),onClick:je=>z(ce)},[t.createElementVNode("span",mw,t.toDisplayString(f(ce)),1),A(ce)?(t.openBlock(),t.createElementBlock("span",pw,"✓")):t.createCommentVNode("",!0)],14,hw))),128))],6),ae.value===0?(t.openBlock(),t.createElementBlock("div",gw,[g.value?(t.openBlock(),t.createElementBlock("span",bw,"Loading data…")):(t.openBlock(),t.createElementBlock("span",yw,"Tidak ada data"))])):t.createCommentVNode("",!0)],64))],36)],4)):t.createCommentVNode("",!0)]))],512),u.value?(t.openBlock(),t.createElementBlock("p",xw,t.toDisplayString(r.error),1)):t.createCommentVNode("",!0)],64))],10,Qk)),[[t.vShow,i.value]])}}),kw={class:"space-y-4"},ww={key:0,class:"flex flex-col gap-0.5"},Cw=["for"],Bw=["for"],_w={class:"text-[11px] text-gray-500 dark:text-gray-400"},Ew={class:"flex items-center gap-2 flex-nowrap"},Sw=["id","value","disabled","onKeydown","onInput","onPaste"],Na=t.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(e,{emit:n}){const o=t.useAttrs(),a=Math.random().toString(36).slice(2,7),r=t.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${a}`),s=e,i=n,l=t.ref([]),c=t.ref([]),d=t.ref(!1),{DCodeApi:u}=qe(),f=gs(),h=t.computed(()=>{const _=Number(s.totalInput);return _&&_>0?_:6}),m=()=>{c.value=Array.from({length:h.value},(_,w)=>{var b;return((b=s.default)==null?void 0:b[w])??""}),i("updateOtp",c.value.join(""))};m(),t.watch(()=>[s.totalInput,s.default],()=>m());const p=_=>{_<0||_>=h.value||t.nextTick(()=>{var w;return(w=l.value[_])==null?void 0:w.focus()})},x=_=>_.match(/[a-zA-Z0-9]/)?_.match(/[a-zA-Z0-9]/)[0]:"";async function y(_){var w;if(i("complete",_),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(_);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((w=s.endpoint)!=null&&w.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),A=s.endpoint.apiUrl,D=await u("","",{otp:_},{_url:A,_method:b,withCredentials:!0}),M=(D==null?void 0:D.data)??D;i("success",M)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const g=(_,w)=>{c.value[_]=x(w);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&y(b)},B=(_,w)=>{const b=_.key,A=/^\d$/.test(b),D=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(_.preventDefault(),c.value[w]){g(w,"");return}w>0&&(g(w-1,""),p(w-1));return}if(b==="ArrowLeft"){_.preventDefault(),p(w-1);return}if(b==="ArrowRight"){_.preventDefault(),p(w+1);return}if(A||D){_.preventDefault(),g(w,b),w<h.value-1&&p(w+1);return}b.length===1&&_.preventDefault()},k=(_,w)=>{const b=_.target,A=b.value??"",D=x(A);b.value=D,g(w,D),D&&w<h.value-1&&p(w+1)},C=(_,w)=>{var V;_.preventDefault();const A=(((V=_.clipboardData)==null?void 0:V.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let D=w;for(const N of A){if(D>=h.value)break;c.value[D]=N,D++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&y(M),p(Math.min(D,h.value-1))},E=_=>w=>{l.value[_]=(w==null?void 0:w.$el)??w};return(_,w)=>(t.openBlock(),t.createElementBlock("div",kw,[s.label||h.value?(t.openBlock(),t.createElementBlock("div",ww,[s.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},t.toDisplayString(s.label),9,Cw)):(t.openBlock(),t.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Bw)),t.createElementVNode("p",_w," Ketik "+t.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",Ew,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,b=>(t.openBlock(),t.createElementBlock("input",{key:b,id:b===1?r.value:void 0,ref_for:!0,ref:E(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:t.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[b-1]?"border-blue-500 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300":"border-gray-300 dark:border-gray-700 bg-white dark:bg-neutral-900 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>B(A,b-1),onInput:A=>k(A,b-1),onPaste:A=>C(A,b-1)},null,42,Sw))),128))])]))}}),Aw={class:"w-full"},Vw={key:0,class:"flex items-center justify-between mb-2"},Dw={key:0,class:"text-sm font-medium text-gray-700"},Mw={key:1,class:"text-sm text-gray-600"},Nw={name:"DCodeProgress"},bd=t.defineComponent({...Nw,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=t.computed(()=>Math.min(o.modelValue/o.max*100,100)),r=t.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=t.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=t.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(t.openBlock(),t.createElementBlock("div",Aw,[e.label||e.showValue?(t.openBlock(),t.createElementBlock("div",Vw,[e.label?(t.openBlock(),t.createElementBlock("span",Dw,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),e.showValue?(t.openBlock(),t.createElementBlock("span",Mw,t.toDisplayString(i.value),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(r.value)},[t.createElementVNode("div",{class:t.normalizeClass(s.value),style:t.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),Pw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},yd=pt(t.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(n,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade"},{default:t.withCtx(()=>[e.isApiLoading?(t.openBlock(),t.createElementBlock("div",Pw,[t.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:t.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):t.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),vw={class:"grid gap-3"},Tw={key:0,class:"ml-1 text-destructive"},Ow={class:"flex flex-col"},zw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},Fw={class:"relative flex-shrink-0 mt-0.5"},Rw=["id","name","value","checked","disabled","required","onChange"],Iw=["onClick"],Lw=["for"],$w={key:0,class:"ml-1 text-red-500"},Ww={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},ks=t.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:n}){t.useAttrs();const{apiUrl:o}=qe(),a=n,r=e,s=t.ref([]),i=t.ref(!1),l=t.ref(null),c=async()=>{var C,E;const k=((C=r.endpoint)==null?void 0:C.apiUrl)||r.apiUrl;if(k){i.value=!0,l.value=null;try{const _={page:1,perPage:100},w=((E=r.endpoint)==null?void 0:E.apiMethod)||r.apiMethod,b=await o(k,w,_);let A=b;r.dataPath?A=r.dataPath.split(".").reduce((M,V)=>M&&M[V]!=="undefined"?M[V]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(A=b.data),Array.isArray(A)?s.value=A:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(_){console.error("DCodeRadio fetch error:",_),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};t.onMounted(()=>{var k;((k=r.endpoint)!=null&&k.apiUrl||r.apiUrl)&&c()});const d=t.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const k=r.itemValue||r.model||"id",C=r.itemTitle||(r.label===""?"name":r.label);return C&&r.label!==""?[{[k]:k,[C]:C}]:[]}),u=k=>{if(typeof k!="object")return k;const C=r.itemValue||r.model||"id";return k[C]},f=k=>{if(typeof k!="object")return String(k);const C=r.itemTitle||"name";return k[C]},h=t.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=t.computed(()=>!!r.error||!!l.value),p=t.computed(()=>r.error||l.value),x=k=>k==null?r.modelValue===k:String(r.modelValue)===String(k),y=t.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),g=(k,C)=>{C.target.checked&&(a("update:modelValue",k),a("change",k))},B=k=>{!r.disabled&&!x(k)&&(a("update:modelValue",k),a("change",k))};return(k,C)=>(t.openBlock(),t.createElementBlock("div",vw,[e.label?(t.openBlock(),t.createBlock(Vo,{key:0,class:"text-sm font-medium"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",Tw,"*")):t.createCommentVNode("",!0)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",Ow,[i.value?(t.openBlock(),t.createElementBlock("div",zw,[t.createVNode(t.unref(oe.Loader2),{class:"w-4 h-4 animate-spin"}),C[0]||(C[0]=t.createTextVNode(" Sedang memuat opsi... ",-1))])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(E,_)=>(t.openBlock(),t.createElementBlock("div",{key:_,class:t.normalizeClass(["flex items-start",y.value.container,e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[t.createElementVNode("div",Fw,[t.createElementVNode("input",{id:e.id?`${e.id}-${_}`:`${h.value}-${_}`,name:h.value,type:"radio",value:u(E),checked:x(u(E)),disabled:e.disabled,required:e.required&&_===0,onChange:w=>g(u(E),w),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Rw)]),t.createElementVNode("div",{class:"flex-1 min-w-0",onClick:w=>B(u(E))},[t.createElementVNode("label",{for:e.id?`${e.id}-${_}`:`${h.value}-${_}`,class:t.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled?"cursor-not-allowed opacity-50":""])},[t.createTextVNode(t.toDisplayString(f(E))+" ",1),e.required&&d.value.length===1&&e.label?(t.openBlock(),t.createElementBlock("span",$w,"*")):t.createCommentVNode("",!0)],10,Lw)],8,Iw)],2))),128))],2),m.value&&p.value?(t.openBlock(),t.createElementBlock("div",Ww,[t.createVNode(t.unref(oe.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),t.createTextVNode(" "+t.toDisplayString(p.value),1)])):t.createCommentVNode("",!0)])]))}}),jw={class:"grid gap-3"},Uw={key:0,class:"ml-1 text-destructive"},Hw={class:"flex flex-col"},qw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},Gw=["onClick"],Xw=["id","name","value","checked","disabled","required","onChange"],Yw={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},Kw=["for"],Jw={key:0,class:"ml-1 text-red-500"},Qw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},ws=t.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:n}){t.useAttrs();const{apiUrl:o}=qe(),a=n,r=e,s=t.ref(r.modelValue??void 0);t.watch(()=>r.modelValue,A=>{s.value=A},{immediate:!0});const i=t.ref([]),l=t.ref(!1),c=t.ref(null),d=async()=>{var D,M;const A=((D=r.endpoint)==null?void 0:D.apiUrl)||r.apiUrl;if(A){l.value=!0,c.value=null;try{const V={page:1,perPage:100},N=((M=r.endpoint)==null?void 0:M.apiMethod)||r.apiMethod,T=await o(A,N,V);let K=T;r.dataPath?K=r.dataPath.split(".").reduce((I,q)=>I&&I[q]!=="undefined"?I[q]:void 0,T):typeof T=="object"&&!Array.isArray(T)&&T.data&&(K=T.data),Array.isArray(K)?i.value=K:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(V){console.error("DCodeRadioCustom fetch error:",V),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=t.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};t.onMounted(()=>{var A;((A=r.endpoint)!=null&&A.apiUrl||r.apiUrl)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),t.onBeforeUnmount(()=>{f&&f.disconnect()});const m=t.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(i.value.length>0)return i.value;const A=r.itemValue||r.model||"id",D=r.itemTitle||(r.label===""?"name":r.label);return D&&r.label!==""?[{[A]:A,[D]:D}]:[]}),p=A=>{if(typeof A!="object")return A;const D=r.itemValue||r.model||"id";return A[D]},x=A=>{if(typeof A!="object")return String(A);const D=r.itemTitle||"name";return A[D]},y=Math.random().toString(36).slice(2,7),g=t.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${y}`),B=t.computed(()=>!!r.error||!!c.value),k=t.computed(()=>r.error||c.value),C=A=>{const D=s.value;return A==null?D===A:String(D)===String(A)},E=t.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),_=t.computed(()=>r.icon&&Et[r.icon]||null),w=(A,D)=>{D.target.checked&&(s.value=A,a("update:modelValue",A),a("change",A))},b=A=>{r.disabled||C(A)||(s.value=A,a("update:modelValue",A),a("change",A))};return(A,D)=>(t.openBlock(),t.createElementBlock("div",jw,[e.label?(t.openBlock(),t.createBlock(Vo,{key:0,class:"text-sm font-medium"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",Uw,"*")):t.createCommentVNode("",!0)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",Hw,[l.value?(t.openBlock(),t.createElementBlock("div",qw,[t.createVNode(t.unref(oe.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=t.createTextVNode(" Sedang memuat opsi... ",-1))])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,(M,V)=>(t.openBlock(),t.createElementBlock("div",{key:V,class:t.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",C(p(M))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>!e.disabled&&b(p(M))},[t.createElementVNode("input",{id:e.id?`${e.id}-${V}`:`${g.value}-${V}`,name:g.value,type:"radio",value:p(M),checked:C(p(M)),disabled:e.disabled,required:e.required&&V===0,onChange:N=>w(p(M),N),class:"sr-only",tabindex:"-1"},null,40,Xw),t.createElementVNode("div",{class:t.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",C(p(M))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[_.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value),{key:0,class:"w-6 h-6"})):(t.openBlock(),t.createElementBlock("svg",Yw,[...D[1]||(D[1]=[t.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),t.createElementVNode("label",{for:e.id?`${e.id}-${V}`:`${g.value}-${V}`,class:t.normalizeClass([E.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",C(p(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",e.disabled?"cursor-not-allowed":"cursor-pointer"])},[t.createTextVNode(t.toDisplayString(x(M))+" ",1),e.required&&m.value.length===1&&e.label?(t.openBlock(),t.createElementBlock("span",Jw,"*")):t.createCommentVNode("",!0)],10,Kw)],10,Gw))),128))],2),B.value&&k.value?(t.openBlock(),t.createElementBlock("div",Qw,[t.createVNode(t.unref(oe.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),t.createTextVNode(" "+t.toDisplayString(k.value),1)])):t.createCommentVNode("",!0)])]))}}),Zw={key:0,class:"ml-1 text-destructive"},e1={class:"relative w-full"},t1={key:0,class:"mb-2 flex items-center justify-between"},n1={class:"text-sm text-muted-foreground"},o1={class:"text-sm font-medium text-foreground"},a1={class:"text-sm text-muted-foreground"},r1={class:"relative"},s1=["id","value","min","max","step","disabled","placeholder"],i1={key:1,class:"relative mt-2"},l1={class:"text-xs text-muted-foreground mt-1"},c1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},d1={name:"DCodeSlider"},Pa=t.defineComponent({...d1,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(e,{emit:n}){const o=t.useAttrs(),a=n,r=e,s=t.ref(),i=t.ref(!1),l=t.computed(()=>!!r.error),c=t.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=t.computed(()=>(r.label||o.label)??void 0),u=t.computed(()=>!0),f=t.computed(()=>{const E={sm:"h-2",md:"h-2.5",lg:"h-3"},_={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",E[r.size],_[r.color]||_.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=t.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r.size],r.color==="blue"?"focus:ring-blue-500":r.color==="green"?"focus:ring-green-500":r.color==="red"?"focus:ring-red-500":r.color==="yellow"?"focus:ring-yellow-500":r.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=t.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),p=t.computed(()=>{const E=r.max-r.min;return(r.modelValue-r.min)/E*100}),x=E=>{const _=E.target,w=parseFloat(_.value);a("update:modelValue",w),a("input",w)},y=E=>{const _=E.target,w=parseFloat(_.value);a("change",w)},g=()=>{i.value=!0},B=()=>{i.value=!1},k=E=>{const _=r.max-r.min;return(E-r.min)/_*100},C=t.computed(()=>{const E={sm:16,md:20,lg:24};return`
|
|
67
67
|
input[type="range"]::-webkit-slider-thumb {
|
|
68
68
|
${h.value}
|
|
69
69
|
width: ${E[r.size]}px;
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
input[type="range"]:focus::-moz-range-thumb {
|
|
93
93
|
transform: scale(1.1);
|
|
94
94
|
}
|
|
95
|
-
`});return(E,_)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-2 w-full",n.unref(o).class]),"aria-busy":!1},[d.value?(n.openBlock(),n.createBlock(n.unref(Ma),{key:0,for:c.value,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Kw,"*")):n.createCommentVNode("",!0)]),_:1},8,["for"])):n.createCommentVNode("",!0),n.createElementVNode("div",Jw,[e.showValue?(n.openBlock(),n.createElementBlock("div",Qw,[n.createElementVNode("span",Zw,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.min)+n.toDisplayString(r.valueSuffix),1),n.createElementVNode("span",e1,n.toDisplayString(m.value),1),n.createElementVNode("span",t1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.max)+n.toDisplayString(r.valueSuffix),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",n1,[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:n.normalizeStyle({width:`${p.value}%`})},null,6)],2),n.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:n.normalizeClass(f.value),onInput:b,onChange:y,onMousedown:g,onMouseup:B,onTouchstart:g,onTouchend:B},null,42,o1)]),e.marks.length>0?(n.openBlock(),n.createElementBlock("div",a1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.marks,k=>(n.openBlock(),n.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:n.normalizeStyle({left:`${w(k.value)}%`,transform:"translateX(-50%)"})},[_[0]||(_[0]=n.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),n.createElementVNode("span",r1,n.toDisplayString(k.label),1)],4))),128))])):n.createCommentVNode("",!0)]),l.value?(n.openBlock(),n.createElementBlock("div",s1,[_[1]||(_[1]=n.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),n.createTextVNode(" "+n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0),C.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent("style"),{key:2},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value),1)]),_:1})):n.createCommentVNode("",!0)],2)),[[n.vShow,u.value]])}}),l1={class:"grid gap-3"},c1={key:0,class:"ml-1 text-destructive"},d1={class:"inline-flex items-center gap-3"},u1=["id","name","aria-checked","aria-label","disabled"],f1={key:0,class:"absolute inset-0 flex items-center justify-center"},h1={class:"relative z-10 flex items-center gap-2"},m1=["id","name","aria-checked","aria-label","disabled"],p1={key:0,class:"absolute inset-0 flex items-center justify-center"},g1={name:"DCodeSwitch"},Pa=n.defineComponent({...g1,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(a("update:modelValue",f),a("change",f))}}),s=n.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=n.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=n.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=n.computed(()=>{if(o.disabled)return"bg-gray-300";if(!r.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{r.value=!r.value},u=n.computed(()=>r.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(n.openBlock(),n.createElementBlock("div",l1,[e.title?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",c1,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",d1,[n.createVNode(n.unref(zi),null,{default:n.withCtx(()=>[e.showTooltip?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0,"delay-duration":200},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(n.openBlock(),n.createElementBlock("span",f1,[...h[0]||(h[0]=[n.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,u1)]),_:1}),n.createVNode(n.unref(Oi),{side:"top","side-offset":8,class:n.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:n.withCtx(()=>[n.createElementVNode("span",h1,[n.createElementVNode("span",{class:n.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),n.createTextVNode(" "+n.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(n.openBlock(),n.createElementBlock("span",p1,[...h[1]||(h[1]=[n.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,m1))]),_:1})])]))}}),b1=["aria-busy"],y1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},x1={key:1,class:"flex justify-end"},k1=["for"],w1={key:0,class:"ml-1 text-destructive"},C1={class:"relative w-full group"},B1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},_1={key:1},E1=["id","value","placeholder"],S1={key:1,class:"absolute inset-y-0 right-4 flex items-center"},A1={key:2,class:"absolute inset-y-0 right-4 flex items-center"},V1={key:3,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},D1={key:1,class:"text-xs text-destructive"},va=n.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=n.computed(()=>{var P;return((P=l.valueType)==null?void 0:P.toLowerCase())==="password"||o.type==="password"}),r=n.ref(!1),s=()=>{r.value=!r.value},i=t,l=e,c=n.computed(()=>o.label);n.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=n.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=n.computed(()=>{const P=o.required,H=o["aria-required"];return P===""||P===!0||P==="true"||(H==="true"||H===!0)}),h=n.computed(()=>{const{label:P,class:H,id:Y,required:oe,"aria-required":ye,...xe}=o;return xe}),m=n.computed(()=>{var H,Y;const P={...h.value};return((H=l.valueType)==null?void 0:H.toLowerCase())==="number"&&(P.type="text",P.inputmode="numeric",P.pattern="[0-9]*"),((Y=l.valueType)==null?void 0:Y.toLowerCase())==="email"&&(P.type="email",P.inputmode="email"),a.value&&(P.type=r.value?"text":"password"),l.disabled&&(P.disabled=!0),l.maxLength&&(P.maxlength=l.maxLength),l.minLength&&(P.minlength=l.minLength),l.maxValue&&(P.max=l.maxValue),l.minValue&&(P.min=l.minValue),P}),p=n.computed(()=>{const P=l.modelValue;return P==null||String(P).length===0}),b=n.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),y=n.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),g=n.ref(String(l.modelValue??""));n.watch(()=>l.modelValue,P=>{const H=String(P??"");H!==g.value&&(g.value=H)});const B=n.ref(!1),w=n.ref(!1),C=P=>P.split(/(\s+)/).map(H=>{if(H.trim()==="")return H;const Y=H.toLowerCase();return Y.charAt(0).toUpperCase()+Y.slice(1)}).join(""),E=P=>{const H=P.toLowerCase(),Y=H.search(new RegExp("\\p{L}","u"));return Y<0?H:H.slice(0,Y)+H.charAt(Y).toUpperCase()+H.slice(Y+1)},_=P=>{switch(l.textCase){case"uppercase":return P.toUpperCase();case"lowercase":return P.toLowerCase();case"titlecase":return C(P);case"sentencecase":return E(P);case"none":default:return P}},k=P=>{if(!P)return null;const H=Array.isArray(P)?P.join(""):P;return H?new Set(H):null},x=n.computed(()=>k(l.allowChars)),A=(P,H)=>(P.lastIndex=0,P.test(H)),D=P=>{var pe;const H=(pe=l.valueType)==null?void 0:pe.toLowerCase();if(H==="free"||H==="email"||H==="password")return!0;const Y=P===" ",oe=/\d/.test(P),ye=new RegExp("\\p{L}","u").test(P),xe=new RegExp("\\p{N}","u").test(P);return H==="number"?oe:H==="letter"?ye||l.allowSpaces&&Y:H==="letternumber"?ye||xe||l.allowSpaces&&Y:!0},M=P=>{let H="";for(const Y of P){const oe=!!x.value&&x.value.has(Y);l.pattern&&!oe&&!A(l.pattern,Y)||!oe&&!D(Y)||(H+=Y)}return H},V=n.computed(()=>{const P=l.maxLength??o.maxlength??o.maxLength;let H=Number.NaN;return typeof P=="number"?H=P:typeof P=="string"&&(H=Number.parseInt(P,10)),Number.isFinite(H)&&H>0?H:-1}),N=n.computed(()=>g.value.length),T=n.computed(()=>l.showCharCount?V.value>0:!1),K=P=>V.value>0?P.slice(0,V.value):P,R=P=>{const H=M(P),Y=l.applyTextCaseToValue?_(H):H;return K(Y)};let I=null;const q=P=>{var H;if(P==="")return null;if(((H=l.valueType)==null?void 0:H.toLowerCase())==="number"&&l.returnNumber){const Y=Number(P);return Number.isFinite(Y)?Y:null}return P},ne=P=>{g.value=P,i("update:modelValue",q(P))},W=(P,H)=>{const Y=K(H);w.value=!0,P.value=Y,ne(Y),queueMicrotask(()=>w.value=!1)},U=(P,H)=>{const Y=P.selectionStart??P.value.length,oe=P.selectionEnd??P.value.length;if(V.value>0){const ye=P.value.length-(oe-Y),xe=V.value-ye;if(xe<=0)return;H=H.slice(0,xe)}P.setRangeText(H,Y,oe,"end"),W(P,R(P.value))},ee=P=>{var oe;if(!I||B.value||w.value||!((oe=P.inputType)!=null&&oe.startsWith("insert")))return;const H=P.data;if(H==null)return;const Y=R(H);Y!==H&&(P.preventDefault(),Y.length>0&&U(I,Y))},v=P=>{var oe;if(!I||B.value||w.value)return;const H=((oe=P.clipboardData)==null?void 0:oe.getData("text"))??"",Y=R(H);Y!==H&&(P.preventDefault(),Y.length>0&&U(I,Y))},O=P=>{if(!I||B.value||w.value)return;const H=P.target,Y=H.value??"",oe=R(Y);oe===Y?ne(oe):W(H,oe)},$=()=>B.value=!0,X=()=>{if(B.value=!1,!I)return;const P=I.value??"",H=R(P);H===P?ne(H):W(I,H)};n.onMounted(()=>{if(I=document.getElementById(u.value),!I)return;I.addEventListener("beforeinput",ee),I.addEventListener("paste",v),I.addEventListener("input",O),I.addEventListener("compositionstart",$),I.addEventListener("compositionend",X);const P=I.value??"",H=R(P);H===P?ne(H):W(I,H)}),n.onBeforeUnmount(()=>{I&&(I.removeEventListener("beforeinput",ee),I.removeEventListener("paste",v),I.removeEventListener("input",O),I.removeEventListener("compositionstart",$),I.removeEventListener("compositionend",X),I=null)});const te=()=>{g.value="",I&&(I.value=""),i("update:modelValue",null),i("clear")},ie=n.computed(()=>T.value&&N.value>0),re=n.computed(()=>`${N.value} / ${V.value}`),z=n.computed(()=>!!l.error);return(P,H)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[c.value?(n.openBlock(),n.createElementBlock("div",y1)):n.createCommentVNode("",!0),H[1]||(H[1]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(n.openBlock(),n.createElementBlock("div",x1,[...H[0]||(H[0]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(c.value)+" ",1),f.value?(n.openBlock(),n.createElementBlock("span",w1,"*")):n.createCommentVNode("",!0)],8,k1)):n.createCommentVNode("",!0),n.createElementVNode("div",C1,[l.icon||l.prependInner||P.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",B1,[n.renderSlot(P.$slots,"prepend-inner",{},()=>[l.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(n.openBlock(),n.createElementBlock("span",_1,n.toDisplayString(l.prependInner),1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({id:u.value,value:g.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||P.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${b.value||a.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",z.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,E1),a.value?(n.openBlock(),n.createElementBlock("div",S1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.value?n.unref(ae.Eye):n.unref(ae.EyeOff)),{class:"w-4 h-4"}))])])):n.createCommentVNode("",!0),b.value&&!a.value?(n.openBlock(),n.createElementBlock("div",A1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:te}," ✕ ")])):n.createCommentVNode("",!0),ie.value&&!z.value?(n.openBlock(),n.createElementBlock("p",V1,n.toDisplayString(re.value),1)):n.createCommentVNode("",!0)]),z.value?(n.openBlock(),n.createElementBlock("p",D1,n.toDisplayString(l.error),1)):n.createCommentVNode("",!0)],64))],10,b1)),[[n.vShow,e.visible]])}}),M1=["aria-busy"],N1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},P1=["for"],v1={key:0,class:"ml-1 text-destructive"},T1={class:"relative w-full group"},O1=["id","value"],z1={key:0,class:"absolute top-1 right-2"},F1={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},R1={key:1,class:"text-xs text-destructive"},qn=n.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{const z=o.required,P=o["aria-required"];return z===""||z===!0||z==="true"||(P==="true"||P===!0)}),u=n.computed(()=>{const{label:z,class:P,id:H,required:Y,"aria-required":oe,...ye}=o;return ye}),f=n.computed(()=>{const z=o.maxlength;let P=Number.NaN;return typeof z=="number"?P=z:typeof z=="string"&&(P=Number.parseInt(z,10)),Number.isFinite(P)&&P>0?P:-1}),h=z=>f.value>0?z.slice(0,f.value):z,m=n.computed(()=>{const z=r.modelValue;return z==null||String(z).length===0}),p=n.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),b=n.ref(String(r.modelValue??""));n.watch(()=>r.modelValue,z=>{const P=String(z??"");P!==b.value&&(b.value=P)});const y=n.ref(!1),g=n.ref(!1),B=z=>z.split(/(\s+)/).map(P=>{if(P.trim()==="")return P;const H=P.toLowerCase();return H.charAt(0).toUpperCase()+H.slice(1)}).join(""),w=z=>{const P=z.toLowerCase(),H=P.search(new RegExp("\\p{L}","u"));return H<0?P:P.slice(0,H)+P.charAt(H).toUpperCase()+P.slice(H+1)},C=z=>{switch(r.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return B(z);case"sentencecase":return w(z);case"none":default:return z}},E=n.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),_=z=>{if(!z)return null;const P=Array.isArray(z)?z.join(""):z;return P?new Set(P):null},k=n.computed(()=>_(r.allowChars)),x=(z,P)=>(z.lastIndex=0,z.test(P)),A=z=>{if(z===`
|
|
96
|
-
`)return r.valueType!=="number";if(r.valueType==="free")return!0;const P=z===" ",H=/\d/.test(z),Y=new RegExp("\\p{L}","u").test(z),
|
|
97
|
-
`,""),H=Number(P);return Number.isFinite(H)?H:null}return z},T=z=>{b.value=z,a("update:modelValue",N(z))},K=(z,P)=>{const H=h(P);g.value=!0,z.value=H,T(H),queueMicrotask(()=>g.value=!1)},R=(z,P)=>{const H=z.selectionStart??z.value.length,Y=z.selectionEnd??z.value.length;if(f.value>0){const oe=z.value.length-(Y-H),ye=f.value-oe;if(ye<=0)return;P=P.slice(0,ye)}z.setRangeText(P,H,Y,"end"),K(z,M(z.value))},I=z=>{var Y;if(!V||y.value||g.value||!((Y=z.inputType)!=null&&Y.startsWith("insert")))return;const P=z.data;if(P==null)return;const H=M(P);H!==P&&(z.preventDefault(),H.length>0&&R(V,H))},q=z=>{var Y;if(!V||y.value||g.value)return;const P=((Y=z.clipboardData)==null?void 0:Y.getData("text"))??"",H=M(P);H!==P&&(z.preventDefault(),H.length>0&&R(V,H))},ne=async z=>{if(!V||y.value||g.value)return;const P=z.target,H=P.value??"",Y=M(H);if(Y===H){const oe=P.selectionStart??Y.length,ye=P.selectionEnd??Y.length;K(P,Y),await n.nextTick();try{P.setSelectionRange(oe,ye)}catch{}T(Y)}else{const oe=P.selectionStart??Y.length,ye=P.selectionEnd??Y.length;K(P,Y),await n.nextTick();try{P.setSelectionRange(oe,ye)}catch{}}},W=()=>y.value=!0,U=()=>{if(y.value=!1,!V)return;const z=V.value??"",P=M(z);P===z?T(P):K(V,P)};n.onMounted(()=>{if(V=document.getElementById(c.value),!V)return;V.addEventListener("beforeinput",I),V.addEventListener("paste",q),V.addEventListener("input",ne),V.addEventListener("compositionstart",W),V.addEventListener("compositionend",U);const z=V.value??"",P=M(z);P===z?T(P):K(V,P)}),n.onBeforeUnmount(()=>{V&&(V.removeEventListener("beforeinput",I),V.removeEventListener("paste",q),V.removeEventListener("input",ne),V.removeEventListener("compositionstart",W),V.removeEventListener("compositionend",U),V=null)});const ee=()=>{b.value="",V&&(V.value=""),a("update:modelValue",null),a("clear")},v=n.computed(()=>b.value.length),O=n.computed(()=>r.showCharCount?f.value>0:!1),$=n.computed(()=>O.value&&v.value>0),X=n.computed(()=>`${v.value} / ${f.value}`),te=n.computed(()=>!!r.error),ie=n.computed(()=>{const z=o.rows,P=typeof z=="number"?z:Number.parseInt(String(z??""),10);return Number.isFinite(P)&&P>0?P:3}),re=n.computed(()=>({height:`${ie.value*24+16}px`}));return(z,P)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",N1)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:n.normalizeStyle(re.value)},null,4)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",v1,"*")):n.createCommentVNode("",!0)],8,P1)):n.createCommentVNode("",!0),n.createElementVNode("div",T1,[n.createElementVNode("textarea",n.mergeProps({id:c.value,value:b.value},u.value,{style:`text-transform: ${E.value}; padding-right: ${p.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",te.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,O1),p.value?(n.openBlock(),n.createElementBlock("div",z1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ee}," ✕ ")])):n.createCommentVNode("",!0),$.value&&!te.value?(n.openBlock(),n.createElementBlock("p",F1,n.toDisplayString(X.value),1)):n.createCommentVNode("",!0)]),te.value?(n.openBlock(),n.createElementBlock("p",R1,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,M1)),[[n.vShow,i.value]])}}),gd=n.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.AvatarRoot),{class:n.normalizeClass(n.unref(Ee)(n.unref(I1)({size:e.size,shape:e.shape}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),bd=n.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.AvatarFallback),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),yd=n.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.AvatarImage),n.mergeProps(t,{class:"h-full w-full object-cover"}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),I1=oo("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),Ta=n.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.Separator),n.mergeProps(n.unref(o),{class:n.unref(Ee)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),L1={class:"bg-card text-card-foreground"},$1={class:"pb-6 px-3"},W1={key:0,class:"flex justify-center p-8"},j1={key:1,class:"p-8 text-center text-red-500"},U1={key:2,class:"relative"},H1={class:"space-y-6"},q1={class:"rounded-xl border bg-card text-card-foreground shadow"},G1={class:"p-4"},X1={class:"flex items-center justify-between gap-3"},Y1={class:"font-medium"},K1={class:"text-xs text-muted-foreground"},J1={class:"mt-1 text-sm text-muted-foreground"},Q1={class:"text-foreground"},Z1={class:"text-foreground"},eC={class:"mt-1 text-xs text-muted-foreground"},tC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},nC={class:"flex items-center justify-between gap-3"},oC={class:"font-medium"},aC={class:"text-xs text-muted-foreground"},rC={class:"mt-2 text-sm text-muted-foreground"},sC={class:"flex flex-wrap items-center justify-between gap-3"},iC={class:"flex items-center gap-3"},lC={class:"leading-tight"},cC={class:"text-sm font-medium"},dC={class:"text-xs text-muted-foreground"},uC={class:"flex items-center gap-2"},fC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},hC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},mC=["src"],pC={class:"flex-1"},gC={class:"flex items-center justify-between gap-3"},bC={class:"font-medium"},yC={class:"text-xs text-muted-foreground"},xC={class:"mt-1 text-sm text-muted-foreground"},kC={class:"text-left sm:text-center"},wC={class:"text-xs text-muted-foreground"},CC={class:"text-left sm:text-center"},BC={class:"text-xs text-muted-foreground"},_C={class:"text-left sm:text-center"},EC={class:"text-xs text-muted-foreground"},SC={class:"flex items-center justify-between gap-3"},AC={class:"font-medium"},VC={class:"text-xs text-muted-foreground"},DC={class:"mt-2 text-sm text-muted-foreground"},MC={class:"mt-3 flex items-center gap-3"},NC={class:"text-sm font-medium"},PC={class:"flex items-start justify-between gap-3"},vC={class:"font-medium"},TC={class:"mt-3 grid gap-2 text-sm"},OC={class:"flex items-center justify-between gap-3"},zC={class:"flex items-center gap-2 text-muted-foreground"},FC={class:"font-medium"},RC={class:"flex items-center justify-between gap-3"},IC={class:"flex items-center gap-2 text-muted-foreground"},LC={class:"font-medium"},$C={class:"flex items-center justify-between gap-3"},WC={class:"flex items-center gap-2 text-muted-foreground"},jC={class:"font-medium"},UC={class:"flex items-center justify-between"},HC={class:"flex items-center gap-2"},qC={class:"flex items-start justify-between gap-3"},GC={class:"flex items-center gap-2"},XC={class:"font-medium"},YC={class:"mt-2 text-sm text-muted-foreground"},KC={key:0,class:"mt-1 text-sm text-muted-foreground"},JC={class:"flex flex-wrap items-center justify-between gap-3"},QC={class:"flex items-center gap-2"},ZC={class:"text-xs text-muted-foreground"},xd=n.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(e){const o=Re.useBreakpoints(Re.breakpointsTailwind).smaller("md");n.ref(!1);const a=e,r=n.ref(!1),s=n.ref(null),i=n.ref([]),l=n.computed(()=>i.value.length>0?i.value:a.items&&a.items.length>0?a.items:[]),c=async()=>{if(a.apiUrl){r.value=!0,s.value=null;try{const f=await fetch(a.apiUrl,{method:a.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{r.value=!1}}};n.onMounted(()=>{a.apiUrl&&c()}),n.watch(()=>a.apiUrl,()=>{a.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:ae.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ae.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ae.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ae.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ae.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ae.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ae.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=n.resolveComponent("ShoppingCart"),p=n.resolveComponent("RefreshCcw"),b=n.resolveComponent("MapPin");return n.openBlock(),n.createElementBlock("div",L1,[h[8]||(h[8]=n.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[n.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),n.createElementVNode("div",$1,[r.value?(n.openBlock(),n.createElementBlock("div",W1,[...h[0]||(h[0]=[n.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(n.openBlock(),n.createElementBlock("div",j1,n.toDisplayString(s.value),1)):(n.openBlock(),n.createElementBlock("div",U1,[h[7]||(h[7]=n.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),n.createElementVNode("div",H1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(y,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:"relative pl-14"},[n.createElementVNode("div",{class:n.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(y.type).Circle])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(y.type).Icon),{class:"h-4 w-4"}))],2),n.createElementVNode("div",q1,[n.createElementVNode("div",G1,[y.type==="flight"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",X1,[n.createElementVNode("p",Y1,n.toDisplayString(y.title),1),n.createElementVNode("p",K1,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",J1,[n.createElementVNode("span",Q1,n.toDisplayString(y.from),1),n.createVNode(n.unref(ae.ArrowRight),{class:"mx-2 inline h-4 w-4"}),n.createElementVNode("span",Z1,n.toDisplayString(y.to),1)]),n.createElementVNode("p",eC,n.toDisplayString(y.time),1),y.fileName?(n.openBlock(),n.createElementBlock("div",tC,[n.createVNode(n.unref(ae.FileText),{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("span",null,n.toDisplayString(y.fileName),1)])):n.createCommentVNode("",!0)],64)):y.type==="interview"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",nC,[n.createElementVNode("p",oC,n.toDisplayString(y.title),1),n.createElementVNode("p",aC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",rC,n.toDisplayString(y.desc),1),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",sC,[n.createElementVNode("div",iC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[y.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:y.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("div",lC,[n.createElementVNode("p",cC,n.toDisplayString(y.personName),1),n.createElementVNode("p",dC,n.toDisplayString(y.personRole),1)])]),n.createElementVNode("div",uC,[n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="product"?(n.openBlock(),n.createElementBlock("div",fC,[n.createElementVNode("div",hC,[y.imgUrl?(n.openBlock(),n.createElementBlock("img",{key:0,src:y.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,mC)):(n.openBlock(),n.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),n.createElementVNode("div",pC,[n.createElementVNode("div",gC,[n.createElementVNode("p",bC,n.toDisplayString(y.title),1),n.createElementVNode("p",yC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",xC,n.toDisplayString(y.desc),1),n.createElementVNode("div",{class:n.normalizeClass(["mt-4 grid gap-3",n.unref(o)?"grid-cols-1":"grid-cols-3"])},[n.createElementVNode("div",kC,[h[1]||(h[1]=n.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),n.createElementVNode("p",wC,n.toDisplayString(y.customer),1)]),n.createElementVNode("div",CC,[h[2]||(h[2]=n.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),n.createElementVNode("p",BC,n.toDisplayString(y.price),1)]),n.createElementVNode("div",_C,[h[3]||(h[3]=n.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),n.createElementVNode("p",EC,n.toDisplayString(y.qty),1)])],2)])])):y.type==="design"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("div",SC,[n.createElementVNode("p",AC,n.toDisplayString(y.title),1),n.createElementVNode("p",VC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",DC,n.toDisplayString(y.desc),1),n.createElementVNode("div",MC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[y.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:y.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("p",NC,n.toDisplayString(y.personName),1)])],64)):y.type==="server"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createElementVNode("div",PC,[n.createElementVNode("p",vC,n.toDisplayString(y.title),1),n.createVNode(n.unref(Un),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.chipText??""),1)]),_:2},1024)]),n.createElementVNode("div",TC,[n.createElementVNode("div",OC,[n.createElementVNode("div",zC,[n.createVNode(n.unref(ae.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=n.createElementVNode("span",null,"IP Address",-1))]),n.createElementVNode("span",FC,n.toDisplayString(y.ip),1)]),n.createElementVNode("div",RC,[n.createElementVNode("div",IC,[n.createVNode(n.unref(ae.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=n.createElementVNode("span",null,"CPU",-1))]),n.createElementVNode("span",LC,n.toDisplayString(y.cpu),1)]),n.createElementVNode("div",$C,[n.createElementVNode("div",WC,[n.createVNode(n.unref(ae.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=n.createElementVNode("span",null,"Memory",-1))]),n.createElementVNode("span",jC,n.toDisplayString(y.memory),1)])]),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",UC,[n.createElementVNode("div",HC,[n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Share2),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(p,{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="location"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("div",qC,[n.createElementVNode("div",GC,[n.createVNode(b,{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("p",XC,n.toDisplayString(y.title),1)]),n.createVNode(n.unref(Un),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.chipText),1)]),_:2},1024)]),n.createElementVNode("p",YC,n.toDisplayString(y.desc1),1),y.desc2?(n.openBlock(),n.createElementBlock("p",KC,n.toDisplayString(y.desc2),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",JC,[n.createElementVNode("div",QC,[n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Link),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(mt),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.User),{class:"h-4 w-4"})]),_:1})]),n.createElementVNode("p",ZC,"Due date: "+n.toDisplayString(y.due),1)])],64)):n.createCommentVNode("",!0)])])]))),128))])]))])])}}}),eB={class:"dcode-upload-file"},tB={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},nB={key:0,class:"text-xs text-gray-500 mt-1"},oB=["accept"],aB={key:1,class:"text-xs text-red-600 mt-1"},kd=n.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(r,s)=>(n.openBlock(),n.createElementBlock("div",eB,[e.label?(n.openBlock(),n.createBlock(Hn,{key:0,label:e.label},null,8,["label"])):n.createCommentVNode("",!0),n.createElementVNode("div",tB,[n.createVNode(n.unref(ae.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=n.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[n.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),n.createTextVNode(" or drag and drop ")],-1)),e.accept?(n.openBlock(),n.createElementBlock("p",nB,n.toDisplayString(e.accept),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:e.accept},null,40,oB)]),e.errorMessage?(n.openBlock(),n.createElementBlock("p",aB,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)]))}}),rB=["onClick"],sB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},iB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},lB={key:1},cB={key:0,class:"text-white"},dB={key:1},uB={key:2},fB=["disabled","onClick"],hB={key:1,class:"mr-2 text-sm font-bold opacity-70"},mB={class:"whitespace-normal text-sm text-center leading-tight"},pB={class:"flex flex-col flex-1 min-w-0"},gB={class:"text-sm text-muted-foreground"},bB={class:"px-1"},yB=["disabled"],xB=["type"],kB=["disabled"],ks=Ct(n.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(e,{emit:t}){const o=e,a=t,r=Je(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=n.ref(o.defaultTab),l=n.computed({get(){var k;if(typeof o.modelValue=="string"){const x=(k=o.tabs)==null?void 0:k.findIndex(A=>A.key===o.modelValue);if(x!==void 0&&x>=0)return x}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(k){var x;if(i.value=k,typeof o.modelValue=="string"){const A=(x=o.tabs)==null?void 0:x[k];A?a("update:modelValue",A.key):a("update:modelValue",k)}else a("update:modelValue",k)}}),c=n.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=n.computed(()=>{var k;return(k=o.tabs)==null?void 0:k[l.value]});function u(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}function f(k){return k?typeof k=="string"?Et[k]||null:k:null}const h=n.reactive({});function m(k){return h[k.key]||(h[k.key]={loaded:!1,loading:!1,data:null,error:null}),h[k.key]}function p(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function b(k){const x=k.endpoint||{};return{apiModule:k.apiModule||x.apiModule,apiAction:k.apiAction||x.apiAction,apiUrl:x.apiUrl,apiMethod:x.apiMethod||"GET",apiParams:k.apiParams}}function y(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const x=o.tabs[k];return!(!x||x.disabled)}async function g(k){if(typeof k.tab.fetchData=="function"){const T=await k.tab.fetchData(),K=(T==null?void 0:T.data)??T;return(K==null?void 0:K.data)??K}const x=b(k.tab);if(!(x.apiModule&&x.apiAction||x.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=p();let M;if(x.apiUrl)M=await s("","",D,{_url:x.apiUrl,_method:x.apiMethod,_data:x.apiParams??void 0});else{const T={...D,...x.apiParams};M=await s(x.apiModule,x.apiAction,T)}const V=(M==null?void 0:M.data)??M;return(V==null?void 0:V.data)??V}async function B(k,{force:x=!1}={}){const A=u(k),D=o.tabs[A];if(!D)return;const M=m(D);if(!(o.cache&&M.loaded&&!x)&&!M.loading){M.loading=!0,M.error=null;try{const V=await g({tabIndex:A,tab:D});M.data=V,M.loaded=!0,a("loaded",{tabIndex:A,tab:D,data:V})}catch(V){const N=typeof(V==null?void 0:V.message)=="string"&&V.message||typeof V=="string"&&V||"Failed to load tab data.";M.error=N,a("error",{tabIndex:A,tab:D,message:N})}finally{M.loading=!1}}}function w(k){const x=u(k);y(x)&&x!==l.value&&(l.value=x)}function C(k=l.value){return B(k,{force:!0})}function E(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function _(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return n.watch(()=>o.tabs,k=>{for(const x of k??[])m(x)},{immediate:!0}),n.watch(()=>l.value,async k=>{var A;const x=(A=o.tabs)==null?void 0:A[k];x&&a("change",{tabIndex:k,tab:x}),await B(k)},{immediate:!0}),n.watch(()=>o.autoFetchOnMount,async k=>{k&&await B(l.value)},{immediate:!0}),(k,x)=>{var A,D,M;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[n.createElementVNode("div",{class:n.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[N<l.value?"wizard-num-done":"",N===l.value?"wizard-num-active":N>l.value?"wizard-num-pending":""]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!V.icon&&e.typeWizard!=="none"?(n.openBlock(),n.createElementBlock("span",lB,[N<l.value?(n.openBlock(),n.createElementBlock("span",cB,"✓")):(n.openBlock(),n.createElementBlock("span",dB,n.toDisplayString(N+1),1))])):(n.openBlock(),n.createElementBlock("span",uB))],2),n.createElementVNode("span",{class:n.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",N===l.value?"wizard-text-active":"wizard-text-pending"])},n.toDisplayString(V.title),3)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,onClick:T=>w(N),style:n.normalizeStyle({zIndex:e.tabs.length-N}),class:"relative flex-1 group"},[n.createElementVNode("div",{class:n.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[N>0?"pl-8":"",N===l.value?"wizard-step-active":N<l.value?"wizard-step-done":"wizard-step-pending"]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",sB,n.toDisplayString(N+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",iB,n.toDisplayString(V.title),1)],2),N<e.tabs.length-1?(n.openBlock(),n.createElementBlock("svg",{key:0,class:n.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[N===l.value?"wizard-svg-active":N<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...x[0]||(x[0]=[n.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):n.createCommentVNode("",!0)],12,rB))),128))],2)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("button",{key:V.key,type:"button",disabled:!y(N),onClick:T=>w(N),class:n.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",n.unref(Ee)("border-b border-r",!e.isVertical&&N===e.tabs.length-1&&"border-r-0",N===l.value?"wizard-btn-active":"wizard-btn-pending",!y(N)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",hB,n.toDisplayString(N+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",mB,n.toDisplayString(V.title),1)],10,fB))),128))],2))],2)],2),e.isVertical?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(Ta),{key:0})),n.createElementVNode("div",pB,[n.createElementVNode("div",{class:n.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[d.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?n.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[x[1]||(x[1]=n.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))],!0):n.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=h[d.value.key])==null?void 0:D.data,loaded:(M=h[d.value.key])==null?void 0:M.loaded,reload:C},()=>[n.createElementVNode("div",gB,[x[2]||(x[2]=n.createTextVNode(" Slot ",-1)),n.createElementVNode("code",bB,"tab-"+n.toDisplayString(d.value.key),1),x[3]||(x[3]=n.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):n.createCommentVNode("",!0)],2),e.isWizard||e.showNavigation?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[n.createElementVNode("button",{type:"button",onClick:E,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,yB),l.value<c.value-1?(n.openBlock(),n.createElementBlock("button",{key:0,type:e.isSubmit?"submit":"button",onClick:_,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,xB)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"submit",disabled:e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.submitText),1)],8,kB))],2)):n.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-9379f062"]]),wB={class:"permission-menu w-full space-y-4"},CB={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},BB={class:"flex items-center justify-between"},_B={class:"flex items-center gap-3 flex-1"},EB=["onClick"],SB={key:1,class:"w-7"},AB={key:2,class:"flex-shrink-0"},VB={class:"text-lg font-semibold flex-1"},DB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},MB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},NB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},PB=["checked","disabled","onChange"],vB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},TB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},OB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},zB={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},FB={class:"flex items-center justify-between"},RB={class:"flex items-center gap-3 flex-1"},IB={key:0,class:"flex-shrink-0"},LB={class:"text-base font-semibold flex-1"},$B={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},WB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},jB=["checked","onChange"],UB={class:"text-xs font-medium"},HB={key:0,class:"p-3"},qB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},GB=["checked","disabled","onChange"],XB={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},ws=Ct(n.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(e,{expose:t,emit:o}){const{t:a}=Xt.useI18n(),r=e,s=o,i=n.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=n.ref(new Map),c=n.ref(new Set),d=(D=!0)=>{(V=>{V.forEach(N=>{N.permission.forEach(T=>{const K=`${N.id}-${T.id}-parent`,R=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has(K)||l.value.set(K,R||(D?N.checked??!1:!1))}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.permission.forEach(K=>{const R=`${T.id}-${K.id}-child`,I=K.code==="VIEW"||K.name.toUpperCase()==="VIEW";l.value.has(R)||l.value.set(R,I||(D?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),d(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach(D=>{const M=D.menuId,V=D.actionsIds;i.value.forEach(N=>{N.id===M&&V.forEach(T=>{const K=`${M}-${T}-parent`;l.value.set(K,!0)}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.id===M&&V.forEach(K=>{const R=`${M}-${K}-child`;l.value.set(R,!0)})})})})};u(),n.watch(()=>r.modelValue,()=>{u()},{deep:!0}),n.watch(()=>i.value.length,(D,M)=>{M===0&&D>0&&u()});const f=D=>D.detail&&D.detail.length>0,h=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),p=(D,M,V=!1)=>{const N=`${D}-${M}-${V?"child":"parent"}`;return l.value.get(N)??!1},b=()=>{const D=_();s("update:modelValue",D.permissions)},y=(D,M,V,N=!1)=>{const T=V.target.checked,K=`${D}-${M}-${N?"child":"parent"}`;l.value.set(K,T),s("permission-change",D,M,T,!N),b()},g=D=>D.permission.filter(B),B=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",w=(D,M,V)=>{const N=V.target.checked;M.permission.forEach(T=>{if(B(T)){const R=`${M.id}-${T.id}-child`;l.value.set(R,!0);return}const K=`${M.id}-${T.id}-child`;l.value.set(K,N)}),l.value=new Map(l.value),s("menu-check",M.id,N),b()},C=(D,M=!1)=>{const V=M?D.permission:g(D);return!V||V.length===0?!1:V.every(N=>{const T=`${D.id}-${N.id}-${M?"child":"parent"}`;return l.value.get(T)??!1})},E=()=>{const D={};return i.value.forEach(M=>{var V;D[M.id]={name:M.name,parentPermissions:M.permission.map(N=>({id:N.id,name:N.name,checked:p(M.id,N.id,!1)})),children:((V=M.detail)==null?void 0:V.map(N=>({id:N.id,name:N.name,permissions:N.permission.map(T=>({id:T.id,name:T.name,checked:p(N.id,T.id,!0)}))})))||[]}}),D},_=()=>{const D=[],M=(V,N=!1)=>{const T=[];V.permission.forEach(K=>{const R=`${V.id}-${K.id}-${N?"child":"parent"}`;(l.value.get(R)??!1)&&T.push(K.id)}),T.length>0&&D.push({menuId:V.id,actionsIds:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}};return t({getCurrentStates:E,getPermissionsForDatabase:_,getAllPermissionsWithStatus:()=>{const D=[],M=(V,N=!1)=>{const T=V.permission.map(R=>{const I=`${V.id}-${R.id}-${N?"child":"parent"}`,q=l.value.get(I)??!1;return{id:R.id,name:R.name,checked:q}}),K=T.filter(R=>R.checked).map(R=>R.id);D.push({menuId:V.id,menuName:V.name,actionsIds:K,actions:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,M)=>(n.openBlock(),n.createElementBlock("div",wB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,V=>(n.openBlock(),n.createElementBlock("div",{key:V.id,class:n.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(V)}])},[n.createElementVNode("div",CB,[n.createElementVNode("div",BB,[n.createElementVNode("div",_B,[f(V)?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:N=>h(V.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(V.id)?(n.openBlock(),n.createBlock(n.unref(ae.ChevronDown),{key:0,class:"w-5 h-5"})):(n.openBlock(),n.createBlock(n.unref(ae.ChevronRight),{key:1,class:"w-5 h-5"}))],8,EB)):(n.openBlock(),n.createElementBlock("div",SB)),e.showIcons&&V.icon?(n.openBlock(),n.createElementBlock("span",AB,[n.createElementVNode("i",{class:n.normalizeClass([V.icon,"text-2xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h3",VB,n.toDisplayString(V.name),1)])])]),V.permission&&V.permission.length>0&&!f(V)?(n.openBlock(),n.createElementBlock("div",DB,[n.createElementVNode("h4",MB,n.toDisplayString(n.unref(a)("common.permissions"))+": ",1),n.createElementVNode("div",NB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g(V),N=>(n.openBlock(),n.createElementBlock("label",{key:N.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-neutral-700 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-zinc-800 transition-all group"},[n.createElementVNode("input",{type:"checkbox",checked:B(N)||p(V.id,N.id,!1),disabled:B(N),onChange:T=>y(V.id,N.id,T,!1),class:n.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",B(N)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,PB),n.createElementVNode("span",vB,n.toDisplayString(N.name),1)]))),128))])])):n.createCommentVNode("",!0),n.createVNode(n.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-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:n.withCtx(()=>[f(V)&&m(V.id)?(n.openBlock(),n.createElementBlock("div",TB,[n.createElementVNode("h4",OB,[M[0]||(M[0]=n.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(a)("common.subMenus")),1)]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.detail,N=>(n.openBlock(),n.createElementBlock("div",{key:N.id,class:"bg-white dark:bg-zinc-900 rounded-lg border border-gray-200 dark:border-neutral-700 overflow-hidden shadow-sm hover:shadow transition-shadow"},[n.createElementVNode("div",zB,[n.createElementVNode("div",FB,[n.createElementVNode("div",RB,[e.showIcons&&N.icon?(n.openBlock(),n.createElementBlock("span",IB,[n.createElementVNode("i",{class:n.normalizeClass([N.icon,"text-xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h5",LB,n.toDisplayString(N.name),1),N.path?(n.openBlock(),n.createElementBlock("span",$B,n.toDisplayString(N.path),1)):n.createCommentVNode("",!0),n.createElementVNode("label",WB,[n.createElementVNode("input",{type:"checkbox",checked:C(N,!0),onChange:T=>w(V,N,T),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,jB),n.createElementVNode("span",UB,n.toDisplayString(n.unref(a)("common.selectAll")),1)])])])]),N.permission&&N.permission.length>0?(n.openBlock(),n.createElementBlock("div",HB,[n.createElementVNode("div",qB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.permission,T=>(n.openBlock(),n.createElementBlock("label",{key:T.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[n.createElementVNode("input",{type:"checkbox",checked:B(T)||p(N.id,T.id,!0),disabled:B(T),onChange:K=>y(N.id,T.id,K,!0),class:n.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",B(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,GB),n.createElementVNode("span",XB,n.toDisplayString(T.name),1)]))),128))])])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-5f742a90"]]),YB={class:"space-y-4"},KB={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},JB={key:0,class:"text-danger-500"},QB={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},ZB={class:"text-neutral-600 dark:text-neutral-400"},e_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},t_={class:"text-neutral-500 dark:text-neutral-400"},n_={key:3,class:"space-y-3"},o_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},a_={class:"flex items-center gap-3"},r_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},s_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},i_={class:"flex items-center gap-2 text-sm font-medium"},l_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},c_={class:"p-4"},d_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},u_={class:"ml-2 flex-1 min-w-0"},f_=["for"],h_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},m_={key:4,class:"mt-1 text-xs text-danger-600"},Cs=n.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Xt.useI18n(),s=n.ref(!0),i=n.ref([]),l=n.ref({}),c=n.ref([]),d=n.ref({}),u=g=>{if(console.log(g),!g)return[];if(Array.isArray(g)&&g.length>0&&g[0].module&&Array.isArray(g[0].permissions))return g.map(B=>({menuId:B.menuId,module:B.module,label:B.label||B.module,permissions:B.permissions}));if(Array.isArray(g)&&g.length>0&&g[0].key){const B={};return g.forEach(w=>{const C=w.key,E=C&&C.includes(".")?C.split(".")[0]:"other";B[E]||(B[E]={menuId:0,module:E,label:E,permissions:[]}),B[E].permissions.push({id:w.id,key:w.key,label:w.label,description:w.description})}),Object.values(B)}if(Array.isArray(g)&&g.length>0&&g[0].id&&g[0].name&&Array.isArray(g[0].permission)){const B=[],w=(C,E="")=>{const _=E?`${E}.${C.name}`:C.name,k=_.toLowerCase().replace(/\s+/g,"_"),x=[];if(C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{x.push(A.id)}),C.permission&&C.permission.length>0){const A=C.permission.map(D=>({id:D.id,key:`${k}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${C.name}`,description:`Permission to ${D.name.toLowerCase()} ${C.name.toLowerCase()}`}));B.push({menuId:C.id,module:k,label:C.name,permissions:A,subMenuIds:x.length>0?x:void 0})}C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{w(A,_)})};return g.forEach(C=>w(C)),B}return g.data?u(g.data):[]},f=async()=>{s.value=!0;try{let g;o.treeData&&o.treeData.length>0?g=o.treeData:g=[];const B=u(g);i.value=B;const w={},C=[],E={};B.forEach(k=>{k.permissions.forEach(x=>{const A=typeof x.id=="string"?parseInt(x.id):x.id;E[A]=k.menuId})});const _=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(k=>{C.push(k.menuId),k.actionsIds&&Array.isArray(k.actionsIds)&&k.actionsIds.forEach(x=>_.add(x))}),B.forEach(k=>k.permissions.forEach(x=>{const A=typeof x.id=="string"?parseInt(x.id):x.id;w[A]=_.has(A)})),l.value=w,c.value=C,d.value=E}catch{i.value=[]}finally{s.value=!1}},h=g=>g.permissions.filter(B=>{const w=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[w]}).length,m=g=>g.permissions.every(B=>{const w=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[w]}),p=g=>{const B=h(g);return B>0&&B<g.permissions.length},b=n.ref(!1),y=(g,B)=>{b.value=!0,g.permissions.map(E=>typeof E.id=="string"?parseInt(E.id):E.id),g.permissions.forEach(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;l.value[_]=B});let w=o.modelValue?[...o.modelValue]:[],C=[g.menuId];g.subMenuIds&&g.subMenuIds.length>0&&(C=[...C,...g.subMenuIds],g.subMenuIds.forEach(E=>{const _=i.value.find(k=>k.menuId===E);_&&_.permissions.forEach(k=>{const x=typeof k.id=="string"?parseInt(k.id):k.id;l.value[x]=B})})),B?C.forEach(E=>{const _=i.value.find(k=>k.menuId===E);if(_){const k=_.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),x=w.findIndex(A=>A.menuId===E);x!==-1?w[x]={menuId:E,actionsIds:k}:w.push({menuId:E,actionsIds:k})}}):w=w.filter(E=>!C.includes(E.menuId)),c.value=w.map(E=>E.menuId),console.log("Full Result:",JSON.stringify(w,null,2)),a("update:modelValue",w),setTimeout(()=>{b.value=!1},100)};return n.watch(()=>o.modelValue,g=>{if(!g)return;const B=new Set,w=[];g.forEach(C=>{w.push(C.menuId),C.actionsIds&&Array.isArray(C.actionsIds)&&C.actionsIds.forEach(E=>B.add(E))}),Object.keys(l.value).forEach(C=>{const E=parseInt(C);l.value[E]=B.has(E)}),c.value=w}),n.watch(()=>o.treeData,g=>{g&&g.length>0&&f()},{deep:!0}),n.watch(l,(g,B)=>{if(b.value)return;if(Object.keys(g).map(C=>parseInt(C)).filter(C=>g[C]!==(B==null?void 0:B[C])).length>0){let C=o.modelValue?[...o.modelValue]:[];const E={};Object.keys(g).forEach(_=>{const k=parseInt(_);if(g[k]){const x=d.value[k];console.log(`Permission ${k} belongs to Menu ${x}`),x!==void 0&&(E[x]||(E[x]=[]),E[x].push(k))}}),Object.keys(E).forEach(_=>{const k=parseInt(_),x=E[k],A=C.findIndex(D=>D.menuId===k);A!==-1?C[A]={menuId:k,actionsIds:x}:C.push({menuId:k,actionsIds:x})}),C=C.filter(_=>E[_.menuId]&&E[_.menuId].length>0),c.value=C.map(_=>_.menuId),console.log("Result:",JSON.stringify(C,null,2)),a("update:modelValue",C)}},{deep:!0}),n.onMounted(f),(g,B)=>(n.openBlock(),n.createElementBlock("div",YB,[e.label?(n.openBlock(),n.createElementBlock("label",KB,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",JB,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("div",QB,[n.createVNode(n.unref(ae.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),n.createElementVNode("span",ZB,n.toDisplayString(n.unref(r)("common.loadingPermissions")),1)])):i.value.length===0?(n.openBlock(),n.createElementBlock("div",e_,[n.createElementVNode("p",t_,n.toDisplayString(n.unref(r)("common.noPermissions")),1)])):(n.openBlock(),n.createElementBlock("div",n_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,w=>(n.openBlock(),n.createElementBlock("div",{key:w.module,class:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700 shadow-sm hover:shadow-md transition-shadow"},[n.createElementVNode("div",o_,[n.createElementVNode("div",a_,[n.createVNode(sn,{modelValue:m(w),indeterminate:p(w),"onUpdate:modelValue":C=>y(w,!!C),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),n.createElementVNode("div",null,[n.createElementVNode("div",r_,n.toDisplayString(w.label||w.module),1),n.createElementVNode("div",s_,n.toDisplayString(h(w))+" "+n.toDisplayString(n.unref(r)("common.from"))+" "+n.toDisplayString(w.permissions.length)+" "+n.toDisplayString(n.unref(r)("common.selected")),1)])]),n.createElementVNode("div",i_,[n.createElementVNode("div",l_,n.toDisplayString(h(w))+"/"+n.toDisplayString(w.permissions.length),1)])]),n.createElementVNode("div",c_,[n.createElementVNode("div",d_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.permissions,C=>(n.openBlock(),n.createElementBlock("div",{key:C.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[n.createVNode(sn,{modelValue:l.value[typeof C.id=="string"?parseInt(C.id):C.id],"onUpdate:modelValue":E=>l.value[typeof C.id=="string"?parseInt(C.id):C.id]=E,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),n.createElementVNode("div",u_,[n.createElementVNode("label",{for:`perm-${C.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},n.toDisplayString(C.label||C.key),9,f_),C.description?(n.openBlock(),n.createElementBlock("p",h_,n.toDisplayString(C.description),1)):n.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(n.openBlock(),n.createElementBlock("p",m_,n.toDisplayString(e.error),1)):n.createCommentVNode("",!0)]))}}),p_=(e,t="short",o="id-ID")=>{const a=typeof e=="string"?new Date(e):e,r=c=>String(c).padStart(2,"0"),s=c=>`${r(c.getHours())}:${r(c.getMinutes())}:${r(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return t==="time"?s(a):t==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):t==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(a)},g_=e=>new Promise((t,o)=>{const a=document.createElement("textarea");a.value=e,a.style.top="0",a.style.left="0",a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy")?t():o(new Error("Copy command was unsuccessful"))}catch(r){o(r)}finally{document.body.removeChild(a)}}),b_=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e):g_(e),y_=n.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),x_=n.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const o=e,a=t,r=Re.reactiveOmit(o,"class","side"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ue.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.createVNode(n.unref(ue.DialogContent),n.mergeProps({class:n.unref(Ee)(n.unref(E_)({side:e.side}),o.class)},{...n.unref(s),...i.$attrs}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ue.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),k_=n.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogDescription),n.mergeProps({class:n.unref(Ee)("text-sm text-muted-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),w_=n.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),C_=n.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Ee)("flex flex-col gap-y-2 text-center sm:text-left",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),B_=n.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogTitle),n.mergeProps({class:n.unref(Ee)("text-lg font-medium text-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),__=n.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.DialogTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),E_=oo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),S_={class:"flex-1 overflow-hidden"},A_=n.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.unref(y_),null,{default:n.withCtx(()=>[n.createVNode(n.unref(__),{"as-child":""},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"trigger",{},()=>[n.createVNode(n.unref(mt),{variant:"outline",class:"gap-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Search),{class:"w-4 h-4"}),o[0]||(o[0]=n.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),n.createVNode(n.unref(x_),{class:"flex flex-col h-full"},{default:n.withCtx(()=>[n.createVNode(n.unref(C_),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(B_),{class:"text-xl font-bold"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(k_),{class:"text-sm font-medium text-neutral-600 dark:text-neutral-400"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.description),1)]),_:1})]),_:1}),n.createElementVNode("div",S_,[n.renderSlot(t.$slots,"default")]),n.createVNode(n.unref(w_),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),V_={key:0},D_=["value","name"],wd=n.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const{locale:o}=Xt.useI18n(),a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:sn,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",V_,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,D_)])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),M_=n.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=Re.useVModel(o,"modelValue",a,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>n.withDirectives((n.openBlock(),n.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.isRef(r)?r.value=l:null),class:n.normalizeClass(n.unref(Ee)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[n.vModelText,n.unref(r)]])}}),N_=n.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(e,{emit:t}){const o=e,a=t,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationRoot),n.mergeProps({"data-slot":"pagination"},n.unref(s),{class:o.class}),{default:n.withCtx(c=>[n.renderSlot(i.$slots,"default",n.normalizeProps(n.guardReactiveProps(c)))]),_:3},16,["class"]))}}),P_=n.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationList),n.mergeProps({"data-slot":"pagination-content"},n.unref(o),{class:n.unref(Ee)("flex flex-row items-center gap-1",t.class)}),{default:n.withCtx(s=>[n.renderSlot(a.$slots,"default",n.normalizeProps(n.guardReactiveProps(s)))]),_:3},16,["class"]))}}),v_=n.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationEllipsis),n.mergeProps({"data-slot":"pagination-ellipsis"},n.unref(o),{class:n.unref(Ee)("flex size-9 items-center justify-center",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},()=>[n.createVNode(n.unref(ae.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=n.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),T_=n.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationFirst),n.mergeProps({"data-slot":"pagination-first",class:n.unref(Ee)(n.unref(vn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),O_=n.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const t=e,o=Re.reactiveOmit(t,"class","size","isActive");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationListItem),n.mergeProps({"data-slot":"pagination-item"},n.unref(o),{class:n.unref(Ee)(n.unref(vn)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),z_=n.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationLast),n.mergeProps({"data-slot":"pagination-last",class:n.unref(Ee)(n.unref(vn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),n.createVNode(n.unref(ae.ChevronRightIcon))])]),_:3},16,["class"]))}}),F_=n.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationNext),n.mergeProps({"data-slot":"pagination-next",class:n.unref(Ee)(n.unref(vn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),n.createVNode(n.unref(ae.ChevronRightIcon))])]),_:3},16,["class"]))}}),R_=n.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.PaginationPrev),n.mergeProps({"data-slot":"pagination-previous",class:n.unref(Ee)(n.unref(vn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),I_=n.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const o=e,a=t,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),L_=n.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const o=e,a=t,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ue.SelectContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Ee)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:n.withCtx(()=>[n.createVNode(n.unref(U_)),n.createVNode(n.unref(ue.SelectViewport),{class:n.normalizeClass(n.unref(Ee)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["class"]),n.createVNode(n.unref(j_))]),_:3},16,["class"])]),_:3}))}}),$_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},W_=n.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectItem),n.mergeProps(n.unref(a),{class:n.unref(Ee)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}),{default:n.withCtx(()=>[n.createElementVNode("span",$_,[n.createVNode(n.unref(ue.SelectItemIndicator),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Check),{class:"h-4 w-4"})]),_:1})]),n.createVNode(n.unref(ue.SelectItemText),null,{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),j_=n.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectScrollDownButton),n.mergeProps(n.unref(a),{class:n.unref(Ee)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronDown))])]),_:3},16,["class"]))}}),U_=n.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectScrollUpButton),n.mergeProps(n.unref(a),{class:n.unref(Ee)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronUp))])]),_:3},16,["class"]))}}),H_=n.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Re.reactiveOmit(t,"class"),a=ue.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectTrigger),n.mergeProps(n.unref(a),{class:n.unref(Ee)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default"),n.createVNode(n.unref(ue.SelectIcon),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),q_=n.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ue.SelectValue),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Do={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Gn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},st={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},G_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},X_={dangerouslyHTMLString:!1,multiple:!0,position:Do.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},Y_={rtl:!1,newestOnTop:!1,toastClassName:""},Cd={...X_,...Y_};st.DEFAULT;var Ve=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(Ve||{}),Bs=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(Bs||{});const K_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},J_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},Q_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},Z_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Bd="Toastify--animate Toastify__none-enter";function _d(e,t=!1){var o;let a=K_;if(!e||typeof e=="string")switch(e){case"flip":a=Z_;break;case"zoom":a=Q_;break;case"slide":a=J_;break}else a=e;if(t)a.enter=Bd;else if(a.enter===Bd){const r=(o=a.exit.split("__")[1])==null?void 0:o.split("-")[0];a.enter=`Toastify--animate Toastify__${r}-enter`}return a}function e2(e){return e.containerId||String(e.position)}const Oa="will-unmount";function t2(e=Do.TOP_RIGHT){return!!document.querySelector(`.${Ve.CSS_NAMESPACE}__toast-container--${e}`)}function n2(e=Do.TOP_RIGHT){return`${Ve.CSS_NAMESPACE}__toast-container--${e}`}function o2(e,t,o=!1){const a=[`${Ve.CSS_NAMESPACE}__toast-container`,`${Ve.CSS_NAMESPACE}__toast-container--${e}`,o?`${Ve.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Yn(t)?t({position:e,rtl:o,defaultClassName:a}):`${a} ${t||""}`}function a2(e){var t;const{position:o,containerClassName:a,rtl:r=!1,style:s={}}=e,i=Ve.CSS_NAMESPACE,l=n2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((t=d.className)!=null&&t.includes(Oa)),f=c||document.createElement("div"),h=document.createElement("div");h.className=o2(o,a,r),h.dataset.testid=`${Ve.CSS_NAMESPACE}__toast-container--${o}`,h.id=e2(e);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const p=s[m];h.style[m]=p}return c||(f.className=Ve.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function _s(e){var t,o,a;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((o=e.target)==null?void 0:o.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",_s,!1);try{Mo[r].unmount(),(a=document.getElementById(r))==null||a.remove(),delete Mo[r],delete Qe[r]}catch{}}const Mo=n.reactive({});function r2(e,t){const o=document.getElementById(String(t));o&&(Mo[o.id]=e)}function Es(e,t=!0){const o=String(e);if(!Mo[o])return;const a=document.getElementById(o);a&&a.classList.add(Oa),t?(i2(e),a&&a.addEventListener("animationend",_s,!1)):_s(o),yt.items=yt.items.filter(r=>r.containerId!==e)}function s2(e){for(const t in Mo)Es(t,e);yt.items=[]}function Ed(e,t){const o=document.getElementById(e.toastId);if(o){let a=e;a={...a,..._d(a.transition)};const r=a.appendPosition?`${a.exit}--${a.position}`:a.exit;o.className+=` ${r}`,t&&t(o)}}function i2(e){for(const t in Qe)if(t===e)for(const o of Qe[t]||[])Ed(o)}function l2(e){const t=Xn().find(o=>o.toastId===e);return t==null?void 0:t.containerId}function Ss(e){return document.getElementById(e)}function c2(e){const t=Ss(e.containerId);return t&&t.classList.contains(Oa)}function Sd(e){var t;const o=n.isVNode(e.content)?n.toRaw(e.content.props):null;return o??n.toRaw((t=e.data)!=null?t:{})}function d2(e){return e?yt.items.filter(t=>t.containerId===e).length>0:yt.items.length>0}function u2(){if(yt.items.length>0){const e=yt.items.shift();za(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const Qe=n.reactive({}),yt=n.reactive({items:[]});function Xn(){const e=n.toRaw(Qe);return Object.values(e).reduce((t,o)=>[...t,...o],[])}function f2(e){return Xn().find(t=>t.toastId===e)}function za(e,t={}){if(c2(t)){const o=Ss(t.containerId);o&&o.addEventListener("animationend",As.bind(null,e,t),!1)}else As(e,t)}function As(e,t={}){const o=Ss(t.containerId);o&&o.removeEventListener("animationend",As.bind(null,e,t),!1);const a=Qe[t.containerId]||[],r=a.length>0;if(!r&&!t2(t.position)){const s=a2(t),i=n.createApp(z2,t);t.useHandler&&t.useHandler(i),i.mount(s),r2(i,s.id)}r&&!t.updateId&&(t.position=a[0].position),n.nextTick(()=>{t.updateId?ht.update(t):ht.add(e,t)})}const ht={add(e,t){const{containerId:o=""}=t;o&&(Qe[o]=Qe[o]||[],Qe[o].find(a=>a.toastId===t.toastId)||setTimeout(()=>{var a,r;t.newestOnTop?(a=Qe[o])==null||a.unshift(t):(r=Qe[o])==null||r.push(t),t.onOpen&&t.onOpen(Sd(t))},t.delay||0))},remove(e){if(e){const t=l2(e);if(t){const o=Qe[t];let a=o.find(r=>r.toastId===e);Qe[t]=o.filter(r=>r.toastId!==e),!Qe[t].length&&!d2(t)&&Es(t,!1),u2(),n.nextTick(()=>{a!=null&&a.onClose&&(a.onClose(Sd(a)),a=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){Qe[t]=Qe[t]||[];const o=Qe[t].find(s=>s.toastId===e.toastId),a=(o==null?void 0:o.position)!==e.position||(o==null?void 0:o.transition)!==e.transition,r={...e,disabledEnterTransition:!a,updateId:void 0};ht.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{ze(r.content,r)},e.delay||0)}},clear(e,t=!0){e?Es(e,t):s2(t)},dismissCallback(e){var t;const o=(t=e.currentTarget)==null?void 0:t.id,a=document.getElementById(o);a&&(a.removeEventListener("animationend",ht.dismissCallback,!1),setTimeout(()=>{ht.remove(o)}))},dismiss(e){if(e){const t=Xn();for(const o of t)if(o.toastId===e){Ed(o,a=>{a.addEventListener("animationend",ht.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=Xn();for(const o of t)if(o.toastId===e){const a=document.getElementById(e);a&&(a.remove(),a.removeEventListener("animationend",ht.dismissCallback,!1),ht.remove(e));break}}}},h2=n.reactive({useHandler:void 0}),Ad=n.reactive({}),Fa=n.reactive({});function Vd(){return Math.random().toString(36).substring(2,9)}function m2(e){return typeof e=="number"&&!isNaN(e)}function Vs(e){return typeof e=="string"}function Yn(e){return typeof e=="function"}function Ra(...e){return n.mergeProps(...e)}function Ia(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function p2(e={}){Ad[`${Ve.CSS_NAMESPACE}-default-options`]=e}function Dd(){return Ad[`${Ve.CSS_NAMESPACE}-default-options`]||Cd}function g2(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var La=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(La||{});const Md={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:Do.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:Gn.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:st.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},b2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:st.DEFAULT},theme:{type:String,required:!1,default:Gn.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},y2=n.defineComponent({name:"ProgressBar",props:b2,setup(e,{attrs:t}){const o=n.ref(),a=n.computed(()=>e.hide?"true":"false"),r=n.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=n.computed(()=>[`${Ve.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${Ve.CSS_NAMESPACE}__progress-bar--controlled`:`${Ve.CSS_NAMESPACE}__progress-bar--animated`,`${Ve.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=n.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=n.computed(()=>e.controlledProgress?null:c),u=n.computed(()=>e.controlledProgress?c:null);return n.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>n.createVNode("div",{ref:o,role:"progressbar","aria-hidden":a.value,"aria-label":"notification timer",class:i.value,style:r.value},null)}}),x2=n.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Gn.AUTO},type:{type:String,required:!1,default:Gn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>n.createVNode("button",{class:`${Ve.CSS_NAMESPACE}__close-button ${Ve.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[n.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[n.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),$a=({theme:e,type:t,path:o,...a})=>n.createVNode("svg",n.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},a),[n.createVNode("path",{d:o},null)]);function k2(e){return n.createVNode($a,n.mergeProps(e,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function w2(e){return n.createVNode($a,n.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function C2(e){return n.createVNode($a,n.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function B2(e){return n.createVNode($a,n.mergeProps(e,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function _2(){return n.createVNode("div",{class:`${Ve.CSS_NAMESPACE}__spinner`},null)}const Wa={info:w2,warning:k2,success:C2,error:B2,spinner:_2},E2=e=>e in Wa;function S2({theme:e,type:t,isLoading:o,icon:a}){let r;const s=!!o||t==="loading",i={theme:e,type:t};if(s&&(a===void 0||typeof a=="boolean"))return Wa.spinner();if(a!==!1){if(Ia(a))r=n.toRaw(a);else if(Yn(a)){const l=a;i.type=s?"loading":t,r=l(i),r=!r&&s?Wa.spinner():r}else n.isVNode(a)?r=n.cloneVNode(a,i):Vs(a)||m2(a)?r=a:E2(t)&&(r=Wa[t](i));return r}}const A2=()=>{};function V2(e,t,o=Ve.COLLAPSE_DURATION){const{scrollHeight:a,style:r}=e,s=o;requestAnimationFrame(()=>{r.minHeight="initial",r.height=a+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function D2(e){const t=n.ref(!1),o=n.ref(!1),a=n.ref(!1),r=n.ref(La.Enter),s=n.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||Ve.COLLAPSE_DURATION}),i=s.done||A2,l=n.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=n.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=n.computed(()=>e.pauseOnHover?{onMouseenter:y,onMouseleave:b}:{});function u(){const B=l.value.split(" ");h().addEventListener(Bs.ENTRANCE_ANIMATION_END,b,{once:!0});const w=E=>{const _=h();E.target===_&&(_.dispatchEvent(new Event(Bs.ENTRANCE_ANIMATION_END)),_.removeEventListener("animationend",w),_.removeEventListener("animationcancel",w),r.value===La.Enter&&E.type!=="animationcancel"&&_.classList.remove(...B))},C=()=>{const E=h();E.classList.add(...B),E.addEventListener("animationend",w),E.addEventListener("animationcancel",w)};e.pauseOnFocusLoss&&m(),C()}function f(){if(!h())return;const B=()=>{const C=h();C.removeEventListener("animationend",B),s.collapse?V2(C,i,s.collapseDuration):i()},w=()=>{const C=h();r.value=La.Exit,C&&(C.className+=` ${c.value}`,C.addEventListener("animationend",B))};o.value||(a.value?B():setTimeout(w))}function h(){return e.toastRef.value}function m(){document.hasFocus()||y(),window.addEventListener("focus",b),window.addEventListener("blur",y)}function p(){window.removeEventListener("focus",b),window.removeEventListener("blur",y)}function b(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function y(){t.value=!1}function g(B){B&&(B.stopPropagation(),B.preventDefault()),o.value=!1}return n.watchEffect(f),n.watchEffect(()=>{const B=Xn();o.value=B.findIndex(w=>w.toastId===s.toastId)>-1}),n.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?y():b())}),n.onMounted(u),n.onUnmounted(()=>{e.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:t,hideToast:g,eventHandlers:d}}function M2(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(o=>o in t)}const N2=n.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Md,setup(e){const t=n.ref(),o=n.computed(()=>!!e.isLoading),a=n.computed(()=>e.progress!==void 0&&e.progress!==null),r=n.computed(()=>S2(e)),s=n.computed(()=>[`${Ve.CSS_NAMESPACE}__toast`,`${Ve.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=D2({toastRef:t,loading:o,done:()=>{ht.remove(e.toastId)},..._d(e.transition,e.disabledEnterTransition),...e});function u(){const f=e.content;if(M2(f)){const h=[];return f.title!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-title",class:`${Ve.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-content",class:`${Ve.CSS_NAMESPACE}__toast-text-content`},[f.content])),n.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ve.CSS_NAMESPACE}__toast-text`},[h])}return Ia(f)?n.h(n.toRaw(f),{toastProps:n.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Yn(f)?f({toastProps:n.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?n.h("div",{innerHTML:f}):f}return()=>n.createVNode("div",n.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:f=>{e.closeOnClick&&c(),e.onClick&&e.onClick(f)}},d.value),[n.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${Ve.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&n.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${Ve.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${Ve.CSS_NAMESPACE}--animate-icon ${Ve.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Ia(r.value)?n.h(n.toRaw(r.value),{theme:e.theme,type:e.type}):Yn(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),n.createVNode("div",{"data-testid":"toast-content"},[u()])]),(e.closeButton===void 0||e.closeButton===!0)&&n.createVNode(x2,{theme:e.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Ia(e.closeButton)?n.h(n.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Yn(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,n.createVNode(y2,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:i.value,autoClose:e.autoClose,controlledProgress:a.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),ja="vue3-toastify:url-change";let Ua=0,No;function P2(){if(!(typeof window>"u")&&Fa.lastUrl!==window.location.href){Fa.lastUrl=window.location.href;const e=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Dd().clearOnUrlChange!==!1,t=Object.values(Qe).reduce((o,a)=>(Array.isArray(a)&&o.push(...a),o),[]);for(const o of t)o.toastId&&e(o)&&ht.dismiss(o.toastId);yt.items=yt.items.filter(o=>!e(o.toastProps))}}function v2(){const{history:e}=window,t=e.pushState,o=e.replaceState;return e.pushState=function(...a){const r=t.apply(this,a);return window.dispatchEvent(new Event(ja)),r},e.replaceState=function(...a){const r=o.apply(this,a);return window.dispatchEvent(new Event(ja)),r},()=>{e.pushState=t,e.replaceState=o}}function T2(){if(typeof window>"u"||No)return;const e=v2(),t=()=>P2();window.addEventListener(ja,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),No=()=>{e(),window.removeEventListener(ja,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),No=void 0}}function O2(){No&&(No(),Fa.lastUrl="")}const z2=n.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Md,setup(e){const t=n.computed(()=>e.containerId),o=n.computed(()=>Qe[t.value]||[]),a=n.computed(()=>o.value.filter(r=>r.position===e.position));return n.onMounted(()=>{typeof window<"u"&&(Ua+=1,T2())}),n.onUnmounted(()=>{typeof window<"u"&&Ua>0&&(Ua-=1,Ua===0&&O2())}),()=>n.createVNode(n.Fragment,null,[a.value.map(r=>{const{toastId:s=""}=r;return n.createVNode(N2,n.mergeProps({key:s},r),null)})])}});let Ds=!1;const Nd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Pd(){const e=[];return Xn().forEach(t=>{const o=document.getElementById(t.containerId);o&&!o.classList.contains(Oa)&&e.push(t)}),e}function F2(e){const t=Pd().length,o=e??0;return o>0&&t+yt.items.length>=o}function R2(e){F2(e.limit)&&!e.updateId&&yt.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function dn(e,t,o={}){if(Ds)return;o=Ra(Dd(),{type:t},n.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Vd()),o={...o,...o.type==="loading"?Nd:{},content:e,containerId:o.containerId||String(o.position)};const a=Number(o==null?void 0:o.progress);return!isNaN(a)&&a<0&&(o.progress=0),a>1&&(o.progress=1),o.theme==="auto"&&(o.theme=g2()),R2(o),Fa.lastUrl=window.location.href,o.multiple?yt.items.length?o.updateId&&za(e,o):za(e,o):(Ds=!0,ze.clearAll(void 0,!1),setTimeout(()=>{za(e,o)},0),setTimeout(()=>{Ds=!1},390)),o.toastId}const ze=(e,t)=>dn(e,st.DEFAULT,t);ze.info=(e,t)=>dn(e,st.DEFAULT,{...t,type:st.INFO}),ze.error=(e,t)=>dn(e,st.DEFAULT,{...t,type:st.ERROR}),ze.warning=(e,t)=>dn(e,st.DEFAULT,{...t,type:st.WARNING}),ze.warn=ze.warning,ze.success=(e,t)=>dn(e,st.DEFAULT,{...t,type:st.SUCCESS}),ze.loading=(e,t)=>dn(e,st.DEFAULT,Ra(t,Nd)),ze.dark=(e,t)=>dn(e,st.DEFAULT,Ra(t,{theme:Gn.DARK})),ze.remove=e=>{e?ht.dismiss(e):ht.clear()},ze.clearAll=(e,t)=>{n.nextTick(()=>{ht.clear(e,t)})},ze.isActive=e=>{let t=!1;return t=Pd().findIndex(o=>o.toastId===e)>-1,t},ze.update=(e,t={})=>{setTimeout(()=>{const o=f2(e);if(o){const a=n.toRaw(o),{content:r}=a,s={...a,...t,toastId:t.toastId||e,updateId:Vd()},i=s.render||r;delete s.render,dn(i,s.type,s)}},0)},ze.done=e=>{ze.update(e,{isLoading:!1,progress:1})},ze.promise=I2;function I2(e,{pending:t,error:o,success:a},r){var s,i,l;let c;const d={...r||{},autoClose:!1};t&&(c=Vs(t)?ze.loading(t,d):ze.loading(t.render,{...d,...t}));const u={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(i=r==null?void 0:r.closeOnClick)!=null?i:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,p,b)=>{if(p==null){ze.remove(c);return}const y={type:m,...u,...r,data:b},g=Vs(p)?{render:p}:p;return c?ze.update(c,{...y,...g,isLoading:!1}):ze(g.render,{...y,...g,isLoading:!1}),b},h=Yn(e)?e():e;return h.then(m=>{f("success",a,m)}).catch(m=>{f("error",o,m)}),h}ze.POSITION=Do,ze.THEME=Gn,ze.TYPE=st,ze.TRANSITIONS=G_;const L2={install(e,t={}){h2.useHandler=t.useHandler||(()=>{}),$2(t)}};typeof window<"u"&&(window.Vue3Toastify=L2);function $2(e={}){const t=Ra(Cd,e);p2(t)}const W2={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},j2={class:"dcode-card animate-slide-up"},U2={class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 dark:border-primary-900/50 rounded-t-xl relative z-30"},H2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},q2={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},G2={class:"relative w-full sm:w-64"},X2={key:0,class:"relative"},Y2={class:"flex flex-col h-full"},K2={key:0,class:"flex-1 overflow-y-auto py-4"},J2={class:"grid grid-cols-1 gap-4 px-1"},Q2={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},Z2={class:"flex justify-end gap-2 w-full"},eE={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},tE={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},nE={class:"dcode-table w-full"},oE={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},aE=["onClick"],rE={key:0,class:"flex items-center justify-center w-full"},sE={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},iE={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},lE={key:0,class:"px-3 py-0.5"},cE={key:1},dE=["colspan"],uE={class:"flex flex-col items-center gap-2"},fE={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},hE={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},mE={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},pE={key:0,class:"flex items-center justify-center"},gE={key:0,class:"px-3 py-0.5 !text-center"},bE={key:0,class:"flex items-center justify-center gap-1.5"},yE={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},xE=["colspan"],kE={key:0,class:"px-4 py-3 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-neutral-200 dark:border-neutral-700 flex flex-col sm:flex-row items-center justify-between gap-4 w-full"},wE={class:"flex items-center gap-4"},CE={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},BE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},_E={class:"text-neutral-900 dark:text-neutral-100 font-medium"},EE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},SE={class:"flex-shrink-0"},AE={class:"space-y-4"},VE={class:"text-gray-600 dark:text-gray-400"},DE={class:"grid grid-cols-1 gap-4 py-4 px-1"},ME={class:"flex items-end gap-2"},Kn=n.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(e,{expose:t,emit:o}){var Hd,qd,Gd,Xd,Yd,Kd;const a=e,r=o,s=n.getCurrentInstance(),{apiUrl:i}=Je(),{locale:l}=Xt.useI18n();let c={query:{},params:{},path:""};try{const S=Dn.useRoute();S?c=S:(Gd=(qd=(Hd=s==null?void 0:s.appContext)==null?void 0:Hd.config)==null?void 0:qd.globalProperties)!=null&&Gd.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:S=>{console.warn("Router push() logic called from fallback:",S),typeof S=="string"&&S.startsWith("/")&&(window.location.href=S)}};try{const S=Dn.useRouter();S?d=S:(Kd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.globalProperties)!=null&&Kd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=n.ref(""),f=n.ref(1),h=n.ref(a.perPage),m=n.ref({key:"",direction:"asc"}),p=n.ref([]),b=n.ref(!1),y=n.ref(0),g=n.ref({}),B=n.ref([]),w=n.ref(null),C=n.ref(!0),E=n.ref([]),_=n.ref([]),k=n.ref([]),x=n.ref(!1),A=n.ref(!1),D=n.ref({}),M=n.ref(null),V=n.ref(null),N=n.ref(null),T=n.ref([]),K=n.computed(()=>{if(G.value.length===0)return!1;const S=G.value.map(L=>{const Q=z.value.find(j=>j.type==="CHECKBOX"),F=(Q==null?void 0:Q.keyCheckbox)||"id";return L[F]}).filter(L=>L!=null);return S.length===0?!1:S.every(L=>T.value.includes(L))}),R=n.computed(()=>{if(G.value.length===0)return!1;const S=z.value.find(j=>j.type==="CHECKBOX"),L=(S==null?void 0:S.keyCheckbox)||"id",Q=G.value.map(j=>j[L]).filter(j=>j!=null),F=Q.filter(j=>T.value.includes(j)).length;return F>0&&F<Q.length}),I=S=>{const L=z.value.find(j=>j.type==="CHECKBOX"),Q=(L==null?void 0:L.keyCheckbox)||"id",F=S[Q];return F!==void 0&&T.value.includes(F)},q=S=>{const L=z.value.find(j=>j.type==="CHECKBOX"),Q=(L==null?void 0:L.keyCheckbox)||"id",F=G.value.map(j=>j[Q]).filter(j=>j!=null);if(S){const j=new Set([...T.value,...F]);T.value=Array.from(j)}else T.value=T.value.filter(j=>!F.includes(j))},ne=(S,L)=>{const Q=z.value.find(J=>J.type==="CHECKBOX"),F=(Q==null?void 0:Q.keyCheckbox)||"id",j=S[F];j!=null&&(L?T.value.includes(j)||T.value.push(j):T.value=T.value.filter(J=>J!==j))};n.watch(T,S=>{var Q;r("update:selection",S);const L=K.value||S.length>1;(Q=_.value)!=null&&Q.length&&_.value.forEach(F=>{var j;(j=F.fieldActionGlobal)!=null&&j.length&&F.fieldActionGlobal.forEach(J=>{var Ae,He;const ge=F.endpoint||((Ae=F.propsActionGlobal)==null?void 0:Ae.endpointPropAction)||F.propsActionGlobal,Me=(He=ge==null?void 0:ge.keyParam)==null?void 0:He[0];(Me&&J.model===Me||!Me&&/^(id|ids|idAuditTrail)/i.test(J.model))&&L&&J.model&&(D.value[J.model]=S)})})},{deep:!0});const W=S=>Array.from({length:S}).map((L,Q)=>{const F={id:Q+1,no:Q+1};return z.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?F[j.keyCheckbox||"id"]=Q+1:j.type==="BADGE"||j.type==="badge"||j.condition?F[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":F[j.key]=`Data ${j.label} ${Q+1}`)}),F}),U=S=>S&&typeof S=="string"&&S.trim()?S:void 0,ee=n.computed(()=>{var S,L,Q,F;return U((L=(S=w.value)==null?void 0:S.endpoint)==null?void 0:L.apiModule)||U((F=(Q=w.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiModule)||a.apiModule}),v=n.computed(()=>{var S,L,Q,F;return U((L=(S=w.value)==null?void 0:S.endpoint)==null?void 0:L.apiAction)||U((F=(Q=w.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiAction)||a.apiAction}),O=n.computed(()=>{var S,L,Q,F;return U((L=(S=w.value)==null?void 0:S.endpoint)==null?void 0:L.apiMethod)||U((F=(Q=w.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiMethod)||a.apiMethod||"POST"}),$=n.computed(()=>{var S,L,Q,F;return U((L=(S=w.value)==null?void 0:S.endpoint)==null?void 0:L.apiUrl)||U((F=(Q=w.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiUrl)||a.apiUrl}),X=n.computed(()=>a.permissionBase||""),te=n.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,L)=>(S.seq||0)-(L.seq||0))),ie=S=>{var J,ge,Me;const L=(S==null?void 0:S.column)||((J=S==null?void 0:S.props)==null?void 0:J.column)||((ge=S==null?void 0:S.propsFieldGlobal)==null?void 0:ge.column)||((Me=S==null?void 0:S.propsFieldCustom)==null?void 0:Me.column);if(!L)return"col-span-1";const Q=L.toLowerCase(),j={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[Q]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${L}, returned=${j}`),j},re=()=>{let S=null;if(a.tableConfig&&(S=a.tableConfig),S){w.value=S,S.headers&&(B.value=S.headers.map(F=>{var ge,Me,Ce,Ae,He,$e,Le,zt,Vn,Qa;if(F.key==="action"||((ge=F.custom)==null?void 0:ge.type)==="ACTION"||((Me=F.custom)==null?void 0:Me.type)==="action"){const un=((Ce=F.custom)==null?void 0:Ce.actionCustom)||((Ae=F.custom)==null?void 0:Ae.action);return un&&(E.value=un.map(Gt=>{const Ke=Gt.propsActionCustom||Gt.props||{},Za=Gt.propCustomMessage||{};return{permission:Gt.permission,label:l.value==="id"?Ke.labelID:Ke.labelEN,tooltip:l.value==="id"?Ke.tooltipID||Ke.labelID:Ke.tooltipEN||Ke.labelEN,icon:Ke.icon,variant:Ke.variant||"ghost",bgColor:Ke.bgColor,action:Ke.actionType||Ke.key,route:Ke.route,path:Ke.path,endpoint:Ke.endpointPropAction,requiredCondition:Gt.requiredCondition||!1,propCustomCondition:Gt.propCustomCondition||[],openDialog:Gt.openDialog||!1,fieldActionCustom:(Gt.fieldActionCustom||[]).map(er=>{const Ts=er.propsFieldCustom||er.propsFieldGlobal||er.props||{};return{...er,props:{...Ts,endpoint:Ts.endpointComponent||Ts.endpoint}}}),requireConfirm:Gt.requireConfirm||Ke.requireConfirm||!1,confirmTitle:l.value==="id"?Za.titleID||Ke.confirmTitleID||"Konfirmasi":Za.titleEN||Ke.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Za.messageID||Ke.confirmMessageID||"Apakah Anda yakin?":Za.messageEN||Ke.confirmMessageEN||"Are you sure?"}})),null}let j;const J=((He=F.custom)==null?void 0:He.conditionBadge)||(($e=F.custom)==null?void 0:$e.condition);return(((Le=F.custom)==null?void 0:Le.type)==="BADGE"||((zt=F.custom)==null?void 0:zt.type)==="badge")&&J&&(j=J.map(un=>({value:un.value,label:l.value==="id"?un.labelID:un.labelEN,color:un.color,variant:un.variant}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Vn=F.custom)==null?void 0:Vn.type,condition:j,keyCheckbox:(Qa=F.custom)==null?void 0:Qa.keyCheckbox}}).filter(F=>F!==null));const L=S.filters||S.filter;L&&Array.isArray(L)&&(k.value=L.map(F=>({...F,props:F.propsFilters||F.props||{}})),k.value.forEach(F=>{g.value[F.model]=""}));const Q=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",Q),Q&&Array.isArray(Q)?(_.value=Q.map(F=>{const j=F.propsActionGlobal||F.props||{};return{key:j.key,permission:F.permission,label:l.value==="id"?j.labelID||"Action":j.labelEN||"Action",tooltip:l.value==="id"?j.tooltipID||j.labelID:j.tooltipEN||j.labelEN,icon:j.icon,variant:j.variant||"default",bgColor:j.bgColor,textColor:j.textColor,route:j.route,path:j.path,endpoint:j.endpointPropAction||F.endpoint,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(J=>{const ge=J.propsFieldGlobal||J.props||{};return{...J,props:{...ge,endpoint:ge.endpointComponent||ge.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",_.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(C.value=S.pagination)}};n.watch(()=>a.tableConfig,()=>{re()},{deep:!0,immediate:!0});const z=n.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?B.value:a.columns||[]),P=n.computed(()=>a.hasActions||E.value.length>0),H=n.computed(()=>a.dummyMode?!1:ee.value||$.value?b.value:a.loading),Y=n.computed(()=>!!ee.value||!!$.value),oe=n.computed(()=>[]),ye=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!a.permissionChecker,effectivePath:X.value}),a.menuPermissions&&a.menuPermissions.length>0){const L=c.path,Q=a.menuPermissions.find(F=>L.startsWith(F.path));if(Q&&Q.actions){const F=Q.actions.find(j=>j.code===S.toUpperCase());return F?F.checked:!1}return!1}if(a.permissionChecker){const L=a.permissionChecker(X.value,S);return console.log("[DEBUG] permissionChecker result:",L),L}return oe.value.some(L=>L.code===S)},xe=(S,L)=>{if(!S.visibilityCondition)return!0;const{field:Q,operator:F,value:j}=S.visibilityCondition,J=De(L,Q);switch(F){case"equals":return J===j;case"notEquals":return J!==j;case"in":return Array.isArray(j)&&j.includes(J);case"notIn":return Array.isArray(j)&&!j.includes(J);case"greaterThan":return J>j;case"lessThan":return J<j;case"contains":return String(J).includes(String(j));default:return!0}},pe=n.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:_.value,ignorePermissions:a.ignorePermissions}),_.value.length===0)return _.value;const S=_.value.filter(L=>{if(a.ignorePermissions)return!0;if(!L.permission)return console.log("[DEBUG] Action no permission, showing:",L.label),!0;if(a.checkPermission){const F=a.checkPermission(L.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(a.permissions){const F=a.permissions.includes(L.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const Q=ye(L.permission);return console.log("[DEBUG] Internal permission check:",{label:L.label,permission:L.permission,hasPerm:Q}),Q});return console.log("[DEBUG] Filtered header actions:",S.length),S}),ke=n.computed(()=>E.value.length===0?E.value:E.value.filter(S=>a.ignorePermissions||!S.permission?!0:a.checkPermission?a.checkPermission(S.permission):a.permissions?a.permissions.includes(S.permission):ye(S.permission))),Fe=S=>ke.value.filter(L=>xe(L,S)),Ze=(S,L)=>{var j,J;if(S.requiredCondition&&((j=S.propCustomCondition)==null?void 0:j.length)>0){const ge=De(L,"status"),Me=S.propCustomCondition.find(Ce=>Ce.value===ge);if(Me)return Me.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const Q=De(L,S.colorCondition.field),F=(J=S.colorCondition.conditions)==null?void 0:J.find(ge=>ge.value===Q);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},it=S=>{const L=(S||"left").toLowerCase();return L==="center"?"justify-center":L==="right"?"justify-end":"justify-start"},_t={ToggleLeft:ae.ToggleLeft,SquarePen:ae.SquarePen,Trash2:ae.Trash2,Eye:ae.Eye,CheckCircle:ae.CheckCircle,Plus:ae.Plus,Download:ae.Download,RefreshCw:ae.RefreshCw,Search:ae.Search,SlidersHorizontal:ae.SlidersHorizontal},et=S=>S?Et[S]?Et[S]:_t[S]||null:null,G=n.computed(()=>a.dummyMode?z.value.length>0?W(10):[]:Y.value?p.value.map((S,L)=>({...S,no:(f.value-1)*h.value+L+1})):ce.value),le=n.computed(()=>a.dummyMode?10:Y.value?y.value:Z.value.length),be=n.computed(()=>le.value===0?0:(f.value-1)*h.value+1),Oe=n.computed(()=>{const S=f.value*h.value;return S>le.value?le.value:S}),De=(S,L)=>{if(!(!S||!L))return L in S?S[L]:L.split(".").reduce((Q,F)=>Q&&Q[F],S)},Z=n.computed(()=>{if(Y.value)return[];if(!u.value)return a.data;const S=u.value.toLowerCase();return a.data.filter(L=>z.value.some(Q=>{const F=De(L,Q.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),se=n.computed(()=>Y.value?[]:m.value.key?[...Z.value].sort((L,Q)=>{const F=De(L,m.value.key),j=De(Q,m.value.key);if(F===j)return 0;let J=0;return typeof F=="number"&&typeof j=="number"?J=F-j:J=String(F).localeCompare(String(j)),m.value.direction==="asc"?J:-J}):Z.value),ce=n.computed(()=>{if(Y.value)return[];const S=(f.value-1)*h.value,L=S+h.value;return se.value.slice(S,L).map((Q,F)=>({...Q,no:S+F+1}))}),we=n.computed(()=>Y.value?Object.values(g.value).some(S=>!!S):!!u.value),je=[10,25,50,100],Ot=()=>{Y.value&&(g.value={...g.value,keyword:u.value},f.value=1,rt())};let qa;const zd=()=>{a.enableQuickSearch&&(clearTimeout(qa),qa=setTimeout(()=>{Ot()},500))};let Ga;const Fd=()=>{clearTimeout(Ga),Ga=setTimeout(()=>{Y.value&&rt()},1e3)};n.watch(u,()=>{a.enableQuickSearch&&Y.value&&zd()});const rt=async()=>{if(!a.dummyMode&&Y.value&&!(!ee.value&&!$.value))try{b.value=!0;const S={page:f.value,perPage:h.value,...g.value,...a.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(Q=>{(S[Q]===""||S[Q]===null||S[Q]===void 0)&&delete S[Q]});let L;ee.value?L=await i(ee.value,v.value,S):$.value&&(L=await i($.value,O.value,S)),Rd(L)}catch(S){console.error("DataTable fetch error",S),b.value=!1}},Rd=S=>{console.log("DataTable handleResponseData:",S),S&&(a.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(B.value=S.columns.map(L=>({key:L.key||L.field||L.name,label:L.label||L.header||L.name,width:L.width,align:L.align||"LEFT",sortable:L.sortable!==!1,type:L.type,condition:L.condition,format:L.format}))),S.data&&Array.isArray(S.data)?(p.value=S.data,S.totalData?y.value=S.totalData:S.maxPage?y.value=S.maxPage*h.value:y.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(p.value=S,y.value=S.length):S.users?(p.value=S.users,y.value=S.users.length):S.items&&Array.isArray(S.items)?(p.value=S.items,y.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(p.value=S.list,y.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(p.value=S.rows,y.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(p.value=S.result,y.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),p.value=[],y.value=0)),b.value=!1};n.onUnmounted(()=>{clearTimeout(qa),clearTimeout(Ga)});const Xa=()=>{Object.keys(g.value).forEach(S=>{g.value[S]=""}),u.value="",f.value=1,rt()},Id=()=>{f.value=1,rt()},Ya=(S,L)=>{const Q=De(S,L.key);let F={variant:"secondary",class:"",label:Q};if(L.condition){const j=L.condition.find(J=>{const ge=(Me,Ce)=>typeof Me=="string"&&typeof Ce=="string"?Me.toLowerCase().trim()===Ce.toLowerCase().trim():Me==Ce;return typeof Q=="object"&&Q!==null?ge(J.value,Q.code)||ge(J.value,Q.id):ge(J.value,Q)});if(j){if(j.variant&&(F.variant=j.variant),F.label=j.label||(typeof Q=="object"?Q.name||Q.code:Q),j.color){const J=j.color.toLowerCase(),ge=F.variant==="outline",Me={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow"},Ce={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Ae={danger:"destructive",secondary:"secondary",primary:"default"};ge?Ce[J]&&(F.class=Ce[J]):Ae[J]?F.variant=Ae[J]:Me[J]&&(F.class=Me[J])}}else F.label=typeof Q=="object"?(Q==null?void 0:Q.name)||(Q==null?void 0:Q.code)||"-":Q}else F.label=typeof Q=="object"?(Q==null?void 0:Q.name)||(Q==null?void 0:Q.code)||"-":Q;return F},Ld=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),r("update:sort",m.value)},vs=S=>{S!==f.value&&(f.value=S,Y.value&&rt(),r("update:page",S))},$d=S=>{h.value=S,f.value=1,Y.value&&rt()},Wd=S=>{const L=Math.random()*15+75;if(S.width){const Q=parseInt(String(S.width));return Q<100?`${Math.floor(Q*(Math.random()*.2+.7))}px`:`${L}%`}return`${L}%`},Ka=()=>{u.value="",g.value={},f.value=1,rt()},CS=S=>{var L;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const Q=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${Q}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){V.value=S,N.value=null,D.value={};const Q=S.fieldActionGlobal||S.field||[];Q.length&&Q.forEach(F=>{var ge;const j=S.endpoint||((ge=S.propsActionGlobal)==null?void 0:ge.endpointPropAction)||S.propsActionGlobal,J=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;J&&F.model===J||!J&&/^(id|ids|idAuditTrail)/i.test(F.model)?D.value[F.model]=T.value:D.value[F.model]||(D.value[F.model]="")}),A.value=!0}else r("action",{action:((L=S.propsActionCustom)==null?void 0:L.key)||S.key||"create",row:null,selection:T.value})},BS=async(S,L)=>{var Q,F,j,J;if(S.requireConfirm){M.value={button:S,row:L},x.value=!0;return}if(S.openDialog){V.value=S,N.value=L,D.value={};const ge=z.value.find(Ae=>Ae.type==="CHECKBOX"),Me=(ge==null?void 0:ge.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Ae=>{/^(id|ids|idAuditTrail)/i.test(Ae.model)?D.value[Ae.model]=[L[Me]]:S.action==="showToken"&&Ae.model==="token"?D.value[Ae.model]=L.token!==void 0?L.token:"":L[Ae.model]!==void 0?D.value[Ae.model]=L[Ae.model]:D.value[Ae.model]=""});const Ce=S.endpoint||((Q=S.propsActionGlobal)==null?void 0:Q.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||((j=S.props)==null?void 0:j.endpointPropAction);if(((J=Ce==null?void 0:Ce.apiMethod)==null?void 0:J.toUpperCase())==="GET"&&Ce.apiUrl){b.value=!0;const{apiUrl:Ae}=Je(),He={};Ce.keyParam&&Array.isArray(Ce.keyParam)&&Ce.keyParam.forEach(($e,Le)=>{const zt=Ce.model&&Le===0?Ce.model:$e;L[$e]!==void 0&&(He[zt]=L[$e])}),Object.keys(He).length===0&&L.id&&(He.id=L.id),Ae(Ce.apiUrl,"GET",He).then($e=>{let Le=$e;if($e&&$e.data!==void 0?Le=$e.data:$e&&$e.result!==void 0&&(Le=$e.result),Le!=null){if(typeof Le=="string")D.value.hasOwnProperty("token")&&(D.value.token=Le);else if(typeof Le=="object"&&(Le.item&&(Le=Le.item),Array.isArray(Le)&&(Le=Le[0]||{}),Object.keys(Le).forEach(zt=>{D.value[zt]=Le[zt]}),!D.value.token)){const zt=Object.keys(Le).find(Vn=>Vn.toLowerCase().includes("token"));if(zt)D.value.token=Le[zt];else{const Vn=Object.values(Le).filter(Qa=>typeof Qa=="string");Vn.length===1&&(D.value.token=Vn[0])}}}A.value=!0}).catch($e=>{console.error("Fetch Data Failed",$e)}).finally(()=>{b.value=!1});return}A.value=!0;return}jd(S,L)},jd=(S,L)=>{if(S.route){if(S.path){const j=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${j}`,S.path)}let Q=S.route;Q.includes(":")?Q=Q.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,J)=>L[J]||L.id||J):L.id&&(Q=`${Q.replace(/\/$/,"")}/${L.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:Q,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){b.value=!0;const{apiUrl:Q}=Je(),F=S.endpoint.apiUrl,j=S.endpoint.apiMethod||"POST",J={};S.endpoint.keyParam&&Array.isArray(S.endpoint.keyParam)&&S.endpoint.keyParam.forEach((ge,Me)=>{const Ce=S.endpoint.model&&Me===0?S.endpoint.model:ge;L[ge]!==void 0&&(J[Ce]=L[ge])}),Object.keys(J).length===0&&L.id&&(J.id=L.id),Q(F,j,J).then(()=>{rt(),r("action",{action:S.action||"success",row:L})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{b.value=!1})}else r("action",{action:S.action,row:L})},_S=()=>{M.value&&(jd(M.value.button,M.value.row),Ud())},ES=()=>{var S,L,Q;if(V.value){const F=V.value,j=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let J=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!J){const Ae=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(He=>/^(id|ids|idAuditTrail)/i.test(He.model));J=Ae?Ae.model:"ids"}let ge=null,Me=!1;if(N.value){const Ce=z.value.find($e=>$e.type==="CHECKBOX"),Ae=(Ce==null?void 0:Ce.keyCheckbox)||"id",He=N.value[Ae];j!=null&&j.apiUrl&&(ge={...D.value},ge[J]||(ge[J]=[He]),Me=!0)}else j!=null&&j.apiUrl&&(ge={...D.value},ge[J]||(ge[J]=T.value||[]),Me=!0);if(Me&&ge&&(j!=null&&j.apiUrl)){if(((L=j==null?void 0:j.apiMethod)==null?void 0:L.toUpperCase())==="GET"){A.value=!1,N.value||(T.value=[]);return}const{apiUrl:Ce}=Je(),Ae=j.apiUrl,He=j.apiMethod||"POST";Ce(Ae,He,ge).then(()=>{A.value=!1,N.value||(T.value=[]),rt(),r("action",{action:"success",row:null})}).catch($e=>{console.error("Action Failed",$e)})}else if(N.value){const Ce=z.value.find(Le=>Le.type==="CHECKBOX"),Ae=(Ce==null?void 0:Ce.keyCheckbox)||"id",He=N.value[Ae],$e={...D.value};$e[J]||($e[J]=[He]),r("action",{action:V.value.action,row:$e}),A.value=!1}else{const Ce={...D.value};Ce[J]||(Ce[J]=T.value);const Ae={action:((Q=V.value.propsActionGlobal)==null?void 0:Q.key)||V.value.key,row:Ce,selection:T.value};r("action",Ae),A.value=!1}}},SS=S=>{const L=D.value[S];L&&b_(String(L)).then(()=>{ze.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Q=>{console.error("Failed to copy",Q)})},Ud=()=>{x.value=!1,M.value=null},AS=n.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),VS=n.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");t({fetchData:rt,filters:g,resetFilters:Xa,handleRefresh:Ka});const Ja=n.ref(""),DS=S=>{if(!S)return"";const L=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:L.apiUrl||S.apiUrl,module:L.apiModule||S.apiModule,action:L.apiAction||S.apiAction,method:L.apiMethod||S.apiMethod,params:S.apiParams,socket:L.socket||S.socketEndpoint,socketParams:S.socketParams})};return n.watch(()=>a.tableConfig,()=>{if(a.tableConfig){re();const S=DS(a.tableConfig);S!==Ja.value&&(!Ja.value&&Y.value?(Ja.value=S,rt()):(Ja.value=S,Y.value&&Fd()))}},{deep:!0,immediate:!0}),n.watch(()=>a.apiModule,()=>{Y.value&&rt()}),n.watch(()=>a.apiParams,()=>{Y.value&&rt()},{deep:!0}),n.watch(()=>_.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const L=pe.value;console.log("[DEBUG] visibleHeaderActions evaluated:",L.length,"items")},{deep:!0}),n.onMounted(()=>{re(),Y.value&&(a.tableConfig||(b.value=!0,rt()))}),(S,L)=>{var Q;return n.openBlock(),n.createElementBlock("div",j2,[n.createElementVNode("div",U2,[n.createElementVNode("div",H2,[e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",q2,[n.createElementVNode("div",G2,[n.createVNode(n.unref(ae.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),n.createVNode(n.unref(M_),{modelValue:u.value,"onUpdate:modelValue":L[0]||(L[0]=F=>u.value=F),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:n.withKeys(Ot,["enter"])},null,8,["modelValue"])]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",X2,[n.createVNode(A_,null,{trigger:n.withCtx(()=>[n.createVNode(Xe,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:n.withCtx(()=>[n.createElementVNode("div",Z2,[n.renderSlot(S.$slots,"filter-footer",{fetch:rt,reset:Xa})])]),default:n.withCtx(()=>[L[8]||(L[8]=n.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),n.createElementVNode("div",Y2,[n.renderSlot(S.$slots,"filter-form",{filters:g.value},()=>[k.value.length>0?(n.openBlock(),n.createElementBlock("div",K2,[n.createElementVNode("div",J2,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te.value,(F,j)=>(n.openBlock(),n.createElementBlock("div",{key:j,class:n.normalizeClass(ie(F))},[n.createVNode(wd,{field:F,modelValue:g.value[F.model],"onUpdate:modelValue":J=>g.value[F.model]=J},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):n.createCommentVNode("",!0)]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",Q2,[n.createVNode(Xe,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Xa,disabled:H.value},null,8,["disabled"]),n.createVNode(Xe,{onClick:Id,disabled:H.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):n.createCommentVNode("",!0)])]),_:3})])):n.createCommentVNode("",!0)])),n.createElementVNode("div",{class:n.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":e.nested}])},[e.nested?(n.openBlock(),n.createElementBlock("span",eE)):n.createCommentVNode("",!0),e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Xe,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:Ka,disabled:H.value},{icon:n.withCtx(()=>[n.createVNode(n.unref(ae.RefreshCw),{class:n.normalizeClass(["w-3.5 h-3.5",{"animate-spin":H.value}])},null,8,["class"])]),_:1},8,["disabled"])),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(pe.value,(F,j)=>(n.openBlock(),n.createBlock(Xe,{key:j,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:J=>CS(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),n.renderSlot(S.$slots,"header-actions")],2)])]),n.createElementVNode("div",tE,[n.createElementVNode("table",nE,[n.createElementVNode("thead",oE,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,F=>(n.openBlock(),n.createElementBlock("th",{key:F.key,class:n.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"",F.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:n.normalizeStyle(F.width?{width:F.width}:{}),onClick:j=>F.sortable&&Ld(F.key)},[F.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",rE,[n.createVNode(sn,{"model-value":K.value,indeterminate:R.value,"onUpdate:modelValue":L[1]||(L[1]=j=>q(!!j)),onClick:L[2]||(L[2]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-2 w-full",it(F.align)])},[n.createElementVNode("span",null,n.toDisplayString(F.label),1)],2))],14,aE))),128)),P.value?(n.openBlock(),n.createElementBlock("th",sE,[...L[9]||(L[9]=[n.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("tbody",iE,[H.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(h.value,F=>(n.openBlock(),n.createElementBlock("tr",{key:`skeleton-${F}`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,j=>{var J,ge;return n.openBlock(),n.createElementBlock("td",{key:j.key,class:n.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[n.createElementVNode("div",{class:n.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(j.type??"")||j.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((J=j.align)==null?void 0:J.toLowerCase())==="center"?"mx-auto":"",((ge=j.align)==null?void 0:ge.toLowerCase())==="right"?"ml-auto":""]]),style:n.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:Wd(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),e.hasActions?(n.openBlock(),n.createElementBlock("td",lE,[...L[10]||(L[10]=[n.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):n.createCommentVNode("",!0)]))),128)):G.value.length===0?(n.openBlock(),n.createElementBlock("tr",cE,[n.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"text-center py-16"},[n.createElementVNode("div",uE,[n.createVNode(n.unref(eu.Vue3Lottie),{animationData:n.unref(W2),height:200,width:200},null,8,["animationData"]),n.createElementVNode("div",null,[n.createElementVNode("p",fE,n.toDisplayString(we.value?"No search results":"No data"),1),n.createElementVNode("p",hE,n.toDisplayString(we.value?"Try changing keywords":"No data added"),1)])])],8,dE)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(G.value,(F,j)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:j},[n.createElementVNode("tr",mE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,J=>(n.openBlock(),n.createElementBlock("td",{key:J.key,class:n.normalizeClass([J.align?`text-${J.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[n.renderSlot(S.$slots,`cell-${J.key}`,{row:F,value:De(F,J.key)},()=>[J.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",pE,[n.createVNode(sn,{"model-value":I(F),"onUpdate:modelValue":ge=>ne(F,!!ge),onClick:L[3]||(L[3]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):J.type==="badge"||J.type==="BADGE"||J.condition?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[J.align?`justify-${J.align.toLowerCase()}`:"justify-start"]])},[n.createVNode(n.unref(Un),{variant:Ya(F,J).variant,class:n.normalizeClass([Ya(F,J).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Ya(F,J).label),1)]),_:2},1032,["variant","class"])],2)):J.key==="no"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode(n.toDisplayString((f.value-1)*h.value+j+1),1)],64)):J.type==="date"||J.type==="DATE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(De(F,J.key)?n.unref(p_)(De(F,J.key),"long"):"-"),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createTextVNode(n.toDisplayString(J.format?J.format(De(F,J.key)):De(F,J.key)),1)],64))])],2))),128)),P.value?(n.openBlock(),n.createElementBlock("td",gE,[n.renderSlot(S.$slots,"actions",{row:F,buttons:Fe(F),getButtonColor:Ze,getIconComponent:et},()=>[Fe(F).length>0?(n.openBlock(),n.createElementBlock("div",bE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Fe(F),(J,ge)=>(n.openBlock(),n.createElementBlock("div",{key:ge,class:"group relative"},[n.createVNode(Xe,{tooltip:J.tooltip||J.label,icon:J.icon,size:"icon",rounded:J.rounded||"sm",borderStyle:J.borderStyle||"none",variant:J.variant||"ghost","bg-color":Ze(J,F),onClick:Me=>BS(J,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(n.openBlock(),n.createElementBlock("tr",yE,[n.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"px-0 py-0"},[n.renderSlot(S.$slots,"expanded-row",{row:F,index:j})],8,xE)])):n.createCommentVNode("",!0)],64))),128))])])]),!H.value&&G.value.length>0&&e.showPagination&&C.value?(n.openBlock(),n.createElementBlock("div",kE,[n.createElementVNode("div",wE,[n.createVNode(n.unref(I_),{"model-value":String(h.value),"onUpdate:modelValue":L[4]||(L[4]=F=>$d(Number(F)))},{default:n.withCtx(()=>[n.createVNode(n.unref(H_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:n.withCtx(()=>[n.createVNode(n.unref(q_),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),n.createVNode(n.unref(L_),null,{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(je,F=>n.createVNode(n.unref(W_),{key:F,value:String(F)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),L[15]||(L[15]=n.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),n.createElementVNode("span",CE,[L[11]||(L[11]=n.createTextVNode(" Showing ",-1)),n.createElementVNode("span",BE,n.toDisplayString(be.value),1),L[12]||(L[12]=n.createTextVNode(" to ",-1)),n.createElementVNode("span",_E,n.toDisplayString(Oe.value),1),L[13]||(L[13]=n.createTextVNode(" of ",-1)),n.createElementVNode("span",EE,n.toDisplayString(le.value),1),L[14]||(L[14]=n.createTextVNode(" items ",-1))])]),n.createElementVNode("div",SE,[n.createVNode(n.unref(N_),{total:le.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":vs,class:"scale-90 origin-right"},{default:n.withCtx(()=>[n.createVNode(n.unref(P_),{class:"flex items-center gap-1"},{default:n.withCtx(({items:F})=>[n.createVNode(n.unref(T_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(R_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(F,(j,J)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[j.type==="page"?(n.openBlock(),n.createBlock(n.unref(O_),{key:J,value:j.value,"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(mt),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:ge=>vs(j.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(n.openBlock(),n.createBlock(n.unref(v_),{key:j.type,index:J},null,8,["index"]))],64))),256)),n.createVNode(n.unref(F_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronRight),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(z_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):n.createCommentVNode("",!0),n.createVNode(Vo,{modelValue:x.value,"onUpdate:modelValue":L[5]||(L[5]=F=>x.value=F),title:AS.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:n.withCtx(()=>[n.createVNode(Xe,{variant:"outline",onClick:Ud,text:"Cancel"}),n.createVNode(Xe,{variant:"default",onClick:_S,text:"Yes"})]),default:n.withCtx(()=>[n.createElementVNode("div",AE,[n.createElementVNode("p",VE,n.toDisplayString(VS.value),1)])]),_:1},8,["modelValue","title"]),n.createVNode(Vo,{modelValue:A.value,"onUpdate:modelValue":L[7]||(L[7]=F=>A.value=F),title:((Q=V.value)==null?void 0:Q.label)||"Action",icon:"AlertCircle","max-width":450},{actions:n.withCtx(()=>[n.createVNode(Xe,{variant:"outline",onClick:L[6]||(L[6]=F=>A.value=!1),text:"Cancel"}),n.createVNode(Xe,{variant:"default",onClick:ES,text:"Save"})]),default:n.withCtx(()=>{var F,j;return[n.createElementVNode("div",DE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(((F=V.value)==null?void 0:F.fieldActionCustom)||((j=V.value)==null?void 0:j.fieldActionGlobal)||[],(J,ge)=>{var Me,Ce,Ae;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ge},[J.isHidden?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(ie(J))},[n.createElementVNode("div",ME,[n.createVNode(wd,{class:"flex-1 w-full",field:J,modelValue:D.value[J.model],"onUpdate:modelValue":He=>D.value[J.model]=He},null,8,["field","modelValue","onUpdate:modelValue"]),J.isCopyable||(Me=J.props)!=null&&Me.isCopyable||((Ce=V.value)==null?void 0:Ce.action)==="showToken"||((Ae=V.value)==null?void 0:Ae.action)==="copyToken"?(n.openBlock(),n.createBlock(Xe,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:He=>SS(J.model)},null,8,["onClick"])):n.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function NE(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const PE={class:"flex flex-col gap-3 w-full"},vE={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-dashed border-slate-200 dark:border-slate-800 rounded-lg opacity-70 pointer-events-none animate-pulse"},TE={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-slate-400"},OE={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-800 rounded-lg opacity-70"},zE={class:"text-sm font-medium text-slate-500"},FE={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},RE={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},IE=["onClick"],LE=["for","onDrop"],$E={class:"text-xs text-slate-500 dark:text-slate-400"},WE={key:2,class:"text-xs text-slate-400"},jE=["id","disabled","accept","onChange"],UE=n.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,{t:r,locale:s}=Xt.useI18n(),i=n.computed(()=>{const g=o.endpoint;if(!(g!=null&&g.apiUrl))return null;let B=g.apiUrl;if(!B.startsWith("http")&&o.baseUrl){const w=o.baseUrl.replace(/\/$/,""),C=B.startsWith("/")?B:`/${B}`;B=`${w}${C}`}return B}),l=n.computed(()=>{const g=c.value.length;return g<=1?"grid-cols-1":g===2?"grid-cols-1 md:grid-cols-2":g===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":g===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=n.ref([]),d=n.ref([]),u=n.ref(new Set),f=n.ref(!0),h=async()=>{var g;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((g=o.endpointReference)!=null&&g.apiUrl)){f.value=!1;return}try{const{apiUrl:B}=Je(),w=await B(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let C=(w==null?void 0:w.data)||w;Array.isArray(C)||(C=[C]),c.value=C}catch(B){console.error("Failed to fetch dynamic document list",B)}finally{f.value=!1}};n.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=structuredClone(n.toRaw(o.modelValue))),h()}),n.watch(()=>o.modelValue,g=>{Array.isArray(g)&&JSON.stringify(g)!==JSON.stringify(d.value)&&(d.value=structuredClone(n.toRaw(g)))},{deep:!0}),n.watch(()=>{var g;return(g=o.endpointReference)==null?void 0:g.apiUrl},(g,B)=>{g!==B&&h()}),n.watch(()=>{var g;return(g=o.endpointReference)==null?void 0:g.apiMethod},(g,B)=>{g!==B&&h()}),n.watch(()=>o.items,g=>{c.value=g??[],f.value=!1},{deep:!0,immediate:!0});const m=g=>{const B=g[o.itemValue]||g.id||g.typeDocument;return d.value.find(w=>w.typeDocument===B||w.idDocumentType===B||w[o.itemValue]===B)||null},p=async(g,B,w)=>{var k,x;const C=w.target,E=(k=C.files)==null?void 0:k[0];if(!E)return;const _=g[o.itemValue]||g.id||g.typeDocument;if(g[o.itemTitle]||g.name||g.filename,!i.value){const A=[...d.value],D=A.findIndex(V=>V.typeDocument===_||V.idDocumentType===_),M={id:null,filename:E.name,document:E.name,typeDocument:_};D>-1?A[D]={...A[D],...M}:A.push(M),d.value=A,a("update:modelValue",A);return}u.value.add(B);try{const{apiUrl:A}=Je(),D=new FormData;D.append("doc",E),D.append("typeDocument",String(_));const M=await A(i.value,((x=o.endpoint)==null?void 0:x.apiMethod)||"POST",D),V=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,N=(V==null?void 0:V.url)||(V==null?void 0:V.document)||E.name,T=(V==null?void 0:V.id)||null,K=(V==null?void 0:V.filename)||(V==null?void 0:V.name)||E.name,R=[...d.value],I=R.findIndex(ne=>ne.typeDocument===_||ne.idDocumentType===_),q={id:T,filename:K,document:N,typeDocument:_};I>-1?R[I]={...R[I],...q}:R.push(q),d.value=R,a("update:modelValue",R)}catch(A){console.error("Upload failed",A)}finally{u.value.delete(B),C.value=""}},b=g=>{const B=g[o.itemValue]||g.id||g.typeDocument,w=d.value.filter(C=>C.typeDocument!==B&&C.idDocumentType!==B);d.value=w,a("update:modelValue",w)},y=(g,B,w)=>{var _,k;w.preventDefault();const C=(k=(_=w.dataTransfer)==null?void 0:_.files)==null?void 0:k[0];if(!C)return;p(g,B,{target:{files:[C],value:""}})};return(g,B)=>(n.openBlock(),n.createElementBlock("div",PE,[e.label||e.labelID||e.labelEN?(n.openBlock(),n.createBlock(Hn,{key:0,text:e.label||(n.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(n.openBlock(),n.createElementBlock("div",vE,[n.createVNode(Hn,{text:n.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),n.createElementVNode("div",TE,[n.createVNode(n.unref(ae.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(n.openBlock(),n.createElementBlock("div",OE,[n.createVNode(n.unref(ae.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),n.createElementVNode("span",zE,n.toDisplayString(n.unref(r)("dynamicUploadList.noDocsRequired")),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(w,C)=>{var E;return n.openBlock(),n.createElementBlock("div",{key:C,class:"flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg shadow-sm"},[n.createVNode(Hn,{text:w[e.itemTitle]||w.name||w.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(w)?(n.openBlock(),n.createElementBlock("div",FE,[n.createVNode(n.unref(ae.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),n.createElementVNode("span",RE,n.toDisplayString(((E=m(w))==null?void 0:E.filename)||n.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:_=>b(w)},[n.createVNode(n.unref(ae.X),{class:"w-4 h-4"})],8,IE))])):(n.openBlock(),n.createElementBlock("label",{key:1,for:`dyn-upload-input-${C}`,class:n.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(C)?"pointer-events-none opacity-70":""]]),onDragover:B[0]||(B[0]=n.withModifiers(()=>{},["prevent"])),onDrop:_=>!e.disabled&&!u.value.has(C)&&y(w,C,_)},[u.value.has(C)?(n.openBlock(),n.createBlock(n.unref(ae.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(n.openBlock(),n.createBlock(n.unref(ae.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),n.createElementVNode("span",$E,n.toDisplayString(u.value.has(C)?n.unref(r)("dynamicUploadList.uploading"):n.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(n.openBlock(),n.createElementBlock("span",WE,n.toDisplayString(e.typeFile),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:`dyn-upload-input-${C}`,type:"file",class:"sr-only",disabled:e.disabled||u.value.has(C),accept:e.typeFile,onChange:_=>p(w,C,_)},null,40,jE)],42,LE))])}),128))],2)]))}}),HE={key:0},qE=["value","name"],GE={key:2,class:"text-xs text-neutral-400 italic"},Ms=n.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){let o=n.ref("en");try{o=Xt.useI18n().locale}catch{}const a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:sn,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na,DCodeRadio:ys,DCodeRadioCustom:xs,DCodeDynamicUploadList:UE,DCodeMultiSelect:bs,DCodeCurrencyField:ls,DCodePermissionMenu:ws,DCodeTreePermissions:Cs},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.field.props||{},f={};if((u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),f.required=a.required!==void 0?a.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(p=>{a.formData&&a.formData[p]!=null&&(m[p]=a.formData[p])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),a.options&&a.options.length>0&&(f.options=a.options,f.items=a.options),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",HE,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,qE)])):l.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(n.openBlock(),n.createElementBlock("div",GE," Unknown field: "+n.toDisplayString(e.field.component),1))}}),XE={class:"w-full space-y-6"},YE={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},KE={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},JE={key:0,class:"px-4 py-3"},QE={class:"text-sm font-semibold text-white"},ZE={class:"px-4 py-3"},eS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},tS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},nS={key:2,class:"w-full"},oS={class:"space-y-6 mt-4"},aS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},rS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},sS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},iS=n.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action"],setup(e,{emit:t}){const o=e,a=t;let r=n.ref("en"),s=v=>v;try{const v=Xt.useI18n();r=v.locale,s=v.t}catch{}const i=n.ref(!1),l=n.ref(null),c=n.computed(()=>o.schema||l.value),d=n.reactive({}),u=n.reactive({}),f=n.reactive({}),h=v=>{var O,$,X;return((O=v.propsForm)==null?void 0:O.key)||(($=v.propsTable)==null?void 0:$.key)||((X=v.propsWizard)==null?void 0:X.key)||v.id||"unknown-section"},m=v=>{var X;const O=((X=v.propsWizard)==null?void 0:X.propsSteps)||[],$=r.value==="en";return O.map((te,ie)=>{let re=[];if(Array.isArray(te.sectionsWizard))re=te.sectionsWizard;else if(te.sectionsWizard&&typeof te.sectionsWizard=="object"){const z=te.sectionsWizard;re=[{type:z.type||(z.fields?"FORM":z.isDataTable?"TABLE":"UNKNOWN"),...z}]}return{key:te.key||`step-${ie}`,title:$?te.titleEN:te.titleID,description:$?te.descriptionEN:te.descriptionID,icon:te.icon||void 0,sections:re}})},p=v=>v?[...v].sort((O,$)=>(O.seq||0)-($.seq||0)):[],b=(v,O)=>{d[v]=O},y=(v,O)=>{var z,P;if(O==null)return O;let $=null;if((P=(z=c.value)==null?void 0:z.sections)==null||P.forEach(H=>{var ye,xe,pe;const oe=(((ye=H.propsForm)==null?void 0:ye.fields)||H.fields||((xe=H.sectionsWizard)==null?void 0:xe.fields)||[]).find(ke=>ke.model===v);oe&&($=oe),H.type==="WIZARD"&&(((pe=H.propsWizard)==null?void 0:pe.propsSteps)||[]).forEach(Fe=>{(Array.isArray(Fe.sectionsWizard)?Fe.sectionsWizard:[Fe.sectionsWizard].filter(Boolean)).forEach(it=>{if(it.fields){const _t=it.fields.find(et=>et.model===v);_t&&($=_t)}})})}),!$)return O;const X=B[$.key];if(!X||!Array.isArray(X))return O;const te=$.props||{},ie=te.itemValue||te.model||"id",re=X.find(H=>String(H[ie])===String(O));return re&&re.code?re.code:re&&re.value?re.value:O},g=(v,O)=>{if(v==null)return!0;if(typeof v!="object")return v;if(Object.keys(v).length===0)return null;if("var"in v)return O[v.var]??null;if("=="in v){const $=(v["=="]||[])[0],X=(v["=="]||[])[1],te=g($,O),ie=g(X,O);if(String(te)===String(ie))return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie} ? true (direct)`),!0;if($&&typeof $=="object"&&$.var){const re=y($.var,te);if(String(re)===String(ie))return console.log(`[DynamicForm] evaluateLogic ==: ${te}(->${re}) == ${ie} ? true (resolved)`),!0}if(X&&typeof X=="object"&&X.var){const re=y(X.var,ie);if(String(te)===String(re))return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie}(->${re}) ? true (resolved)`),!0}return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie} ? false`),!1}if("!="in v)return!g({"==":v["!="]},O);if(">"in v){const[$,X]=(v[">"]||[]).map(te=>g(te,O));return Number($)>Number(X)}if(">="in v){const[$,X]=(v[">="]||[]).map(te=>g(te,O));return Number($)>=Number(X)}if("<"in v){const[$,X]=(v["<"]||[]).map(te=>g(te,O));return Number($)<Number(X)}if("<="in v){const[$,X]=(v["<="]||[]).map(te=>g(te,O));return Number($)<=Number(X)}if("and"in v)return v.and.every($=>g($,O));if("or"in v)return v.or.some($=>g($,O));if("!"in v)return!g(v["!"],O);if("length"in v){const $=g(v.length,O);return $==null?0:typeof $=="string"||Array.isArray($)?$.length:0}return!0},B=n.reactive({}),w=async v=>{const O=v.props||{},$=O.endpointReference||O.endpoint;if(!(!($!=null&&$.apiUrl)||B[v.key]))try{console.log(`[DynamicForm] Prefetching for ${v.key} from ${$.apiUrl}`);const{apiUrl:X}=Je(),te=await X($.apiUrl,$.apiMethod||"GET",{page:1,perPage:100});let ie=(te==null?void 0:te.data)||te;Array.isArray(ie)||(ie=ie?[ie]:[]),B[v.key]=ie,console.log(`[DynamicForm] Prefetched ${ie.length} items for ${v.key}`)}catch(X){console.error(`[DynamicForm] Failed prefetching for ${v.key}`,X),B[v.key]=[]}},C=v=>{var re,z;const O=v.props||{},$=B[v.key]||O.items||O.options||[];if(!((re=v.logic)!=null&&re.optionsFilterRule)||!Array.isArray(v.logic.optionsFilterRule))return $;console.log(`[DynamicForm] getFilteredItems check for ${v.key}`,{formData:JSON.parse(JSON.stringify(d)),hasRules:!!((z=v.logic)!=null&&z.optionsFilterRule)});const X=v.logic.optionsFilterRule.find(P=>P.condition?g(P.condition,d):!0);if(!X)return console.log(`[DynamicForm] getFilteredItems: No active rule found for ${v.key}`),$;const te=O.itemValue||O.model||"id",ie=$.filter(P=>typeof P!="object"?X.values.includes(String(P))||X.values.includes(P):[te,"code","id","value"].some(Y=>{const oe=P[Y];return oe==null?!1:X.values.includes(String(oe))||X.values.includes(oe)}));return console.log(`[DynamicForm] Filtering ${v.key}: ${$.length} -> ${ie.length} items (rule active)`,{ruleValues:X.values}),ie},E=v=>{if(!v||typeof v!="object")return[];if("var"in v)return[v.var];let O=[];return Object.values(v).forEach($=>{Array.isArray($)?$.forEach(X=>{O=O.concat(E(X))}):typeof $=="object"&&(O=O.concat(E($)))}),O};n.watch(()=>c.value,v=>{if(!(v!=null&&v.sections))return;const O=new Set,$=X=>{X&&["visibleRule","requiredRule","optionsFilterRule"].forEach(te=>{X[te]&&E(X[te]).forEach(ie=>O.add(ie))})};v.sections.forEach(X=>{var te,ie,re,z,P,H;if(((te=X.type)==null?void 0:te.toUpperCase())==="FORM"&&((ie=X.propsForm)!=null&&ie.fields)&&X.propsForm.fields.forEach(Y=>{var oe;$(Y.logic),(oe=Y.logic)!=null&&oe.optionsFilterRule&&w(Y)}),((re=X.type)==null?void 0:re.toUpperCase())==="TABLE"&&((z=X.propsTable)!=null&&z.modelDatatable)){const Y=X.propsTable.modelDatatable;(!d[Y]||!Array.isArray(d[Y]))&&(d[Y]=[])}else if(((P=X.type)==null?void 0:P.toUpperCase())==="WIZARD"){const Y=h(X);u[Y]===void 0&&(u[Y]=0),(((H=X.propsWizard)==null?void 0:H.propsSteps)||[]).forEach(ye=>{(Array.isArray(ye.sectionsWizard)?ye.sectionsWizard:[ye.sectionsWizard].filter(Boolean)).forEach(pe=>{pe.fields&&pe.fields.forEach(ke=>{var Fe;$(ke.logic),(Fe=ke.logic)!=null&&Fe.optionsFilterRule&&w(ke)})})})}}),v.sections.forEach(X=>{var ie,re;(((ie=X.propsForm)==null?void 0:ie.fields)||X.fields||[]).forEach(z=>{O.has(z.model)&&w(z)}),X.type==="WIZARD"&&(((re=X.propsWizard)==null?void 0:re.propsSteps)||[]).forEach(P=>{(Array.isArray(P.sectionsWizard)?P.sectionsWizard:[P.sectionsWizard].filter(Boolean)).forEach(Y=>{Y.fields&&Y.fields.forEach(oe=>{O.has(oe.model)&&w(oe)})})})})},{immediate:!0});const _=v=>{var $;const O=($=v.logic)==null?void 0:$.visibleRule;return!O||Object.keys(O).length===0?!0:!!g(O,d)},k=v=>{var X,te;const O=((X=v.props)==null?void 0:X.required)??!1,$=(te=v.logic)==null?void 0:te.requiredRule;return!$||Object.keys($).length===0?O:!!g($,d)},x=async v=>{const O=v.propsActionGlobal;if(!O)return;const $=O.fieldMapping;let X={};$&&typeof $=="object"&&Object.keys($).length>0?Object.keys($).forEach(te=>{const ie=$[te];d[te]!==void 0&&(X[ie]=d[te])}):X={...d},a("action",O.key||"",v,X)},A=async()=>{i.value=!0;try{a("submit",{...d})}finally{i.value=!1}},D=()=>{a("cancel")},M=v=>v.permission?o.isEditMode?v.permission!=="CREATE":v.permission!=="UPDATE":!0,V=v=>{const O=v.modelDatatable;if(!O)return[];const $=d[O];return Array.isArray($)?$:[]},N=n.ref(!1),T=n.ref(""),K=n.ref([]),R=n.reactive({}),I=n.ref(""),q=n.ref(null),ne=n.ref(null),W=(v,O)=>{var X,te;I.value=v.modelDatatable||"",ne.value=O,q.value=null;const $=O.fieldActionGlobal||[];K.value=$,T.value=((X=O.propsActionGlobal)==null?void 0:X.labelID)||((te=O.propsActionGlobal)==null?void 0:te.labelEN)||"Add Row",Object.keys(R).forEach(ie=>delete R[ie]),$.forEach(ie=>{R[ie.model]=null}),N.value=!0},U=(v,O)=>{var Y;const{action:$,row:X}=O;if(/delete|trash|remove/i.test($)){const oe=v.modelDatatable;if(oe&&Array.isArray(d[oe])){const ye=d[oe].indexOf(X);if(ye!==-1)d[oe].splice(ye,1);else{const xe=JSON.stringify(X),pe=d[oe].findIndex(ke=>JSON.stringify(ke)===xe);pe!==-1&&d[oe].splice(pe,1)}}return}const ie=v.modelDatatable||"";I.value=ie;const re=d[ie],z=Array.isArray(re)?re.indexOf(X):-1;q.value=z!==-1?z:null;const P=v.actionTableGlobal||[],H=((Y=P[0])==null?void 0:Y.fieldActionGlobal)||[];K.value=H,T.value="Edit Row",ne.value=P[0],Object.keys(R).forEach(oe=>delete R[oe]),H.forEach(oe=>{R[oe.model]=X[oe.model]??null}),N.value=!0},ee=()=>{const v=I.value;if(!v)return;Array.isArray(d[v])||(d[v]=[]);const O={...R};q.value!==null?d[v].splice(q.value,1,O):d[v].push(O),N.value=!1};return(v,O)=>{var $,X,te,ie,re;return n.openBlock(),n.createElementBlock("div",XE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(($=c.value)==null?void 0:$.sections,(z,P)=>{var H,Y,oe,ye,xe;return n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[((H=z.type)==null?void 0:H.toUpperCase())==="FORM"&&z.propsForm?(n.openBlock(),n.createElementBlock("div",YE,[n.createElementVNode("div",KE,[z.propsForm.titleID||z.propsForm.titleEN?(n.openBlock(),n.createElementBlock("div",JE,[n.createElementVNode("h3",QE,n.toDisplayString(n.unref(r)==="id"?z.propsForm.titleID:z.propsForm.titleEN),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",ZE,[n.createVNode(Xe,{size:"sm",icon:"List",text:n.unref(s)("common.back"),variant:"outline",onClick:D},null,8,["text"])])]),n.createElementVNode("div",{class:n.normalizeClass(["p-4 grid gap-4",z.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(z.propsForm.fields),pe=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:pe.key},[_(pe)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([pe.column==="FULL"&&z.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:pe,"model-value":d[pe.model],"form-data":d,required:k(pe),options:C(pe),"onUpdate:modelValue":ke=>b(pe.model,ke)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)])):((Y=z.type)==null?void 0:Y.toUpperCase())==="TABLE"&&z.propsTable?(n.openBlock(),n.createElementBlock("div",eS,[(oe=z.propsTable.actionTableGlobal)!=null&&oe.length?(n.openBlock(),n.createElementBlock("div",tS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.propsTable.actionTableGlobal,(pe,ke)=>{var Fe,Ze;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ke},[pe.propsActionGlobal?(n.openBlock(),n.createBlock(Xe,{key:0,icon:pe.propsActionGlobal.icon,"bg-color":((Fe=pe.propsActionGlobal.bgColor)==null?void 0:Fe.toLowerCase())||"primary",variant:((Ze=pe.propsActionGlobal.variant)==null?void 0:Ze.toLowerCase())||"default",size:"sm",onClick:it=>W(z.propsTable,pe)},null,8,["icon","bg-color","variant","onClick"])):n.createCommentVNode("",!0)],64)}),128))])):n.createCommentVNode("",!0),n.createVNode(Kn,{"table-config":z.propsTable,data:V(z.propsTable),nested:!0,"show-pagination":z.propsTable.pagination??!0,onAction:pe=>U(z.propsTable,pe)},null,8,["table-config","data","show-pagination","onAction"])])):((ye=z.type)==null?void 0:ye.toUpperCase())==="WIZARD"&&z.propsWizard?(n.openBlock(),n.createElementBlock("div",nS,[n.createVNode(ks,{tabs:m(z),modelValue:u[h(z)],"onUpdate:modelValue":pe=>u[h(z)]=pe,"is-vertical":z.propsWizard.isVertical,"is-wizard":z.propsWizard.isWizard,"type-wizard":((xe=z.propsWizard.typeWizard)==null?void 0:xe.toLowerCase())||"icon",loading:i.value},n.createSlots({_:2},[n.renderList(m(z),pe=>({name:`tab-${pe.key}`,fn:n.withCtx(()=>[n.createElementVNode("div",oS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(pe.sections,(ke,Fe)=>{var Ze,it,_t;return n.openBlock(),n.createElementBlock(n.Fragment,{key:Fe},[((Ze=ke.type)==null?void 0:Ze.toUpperCase())==="FORM"?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["grid gap-4",ke.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(ke.fields),et=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:et.key},[_(et)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([et.column==="FULL"&&ke.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:et,"model-value":d[et.model],"form-data":d,required:k(et),options:C(et),"onUpdate:modelValue":G=>b(et.model,G)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)):((it=ke.type)==null?void 0:it.toUpperCase())==="TABLE"||ke.isDataTable?(n.openBlock(),n.createElementBlock("div",aS,[n.createVNode(Kn,{"table-config":ke.propsDataTableWizard||ke.propsTable,data:V(ke.propsDataTableWizard||ke.propsTable),nested:!0,"show-pagination":((_t=ke.propsDataTableWizard||ke.propsTable)==null?void 0:_t.pagination)??!0,onAction:et=>U(ke.propsDataTableWizard||ke.propsTable,et)},null,8,["table-config","data","show-pagination","onAction"])])):(n.openBlock(),n.createElementBlock("div",rS," Unknown section type: "+n.toDisplayString(ke.type),1))],64)}),128))])])}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):n.createCommentVNode("",!0)],64)}),128)),f!=null&&f.global?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(((te=(X=c.value)==null?void 0:X.ui)==null?void 0:te.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(re=(ie=c.value)==null?void 0:ie.actionGlobal)!=null&&re.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(c.value.actionGlobal,(z,P)=>{var H,Y;return n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[z.propsActionGlobal&&M(z)?(n.openBlock(),n.createBlock(Xe,{key:0,icon:z.propsActionGlobal.icon,text:n.unref(r)==="id"?z.propsActionGlobal.labelID:z.propsActionGlobal.labelEN,"bg-color":((H=z.propsActionGlobal.bgColor)==null?void 0:H.toLowerCase())||"primary",variant:((Y=z.propsActionGlobal.variant)==null?void 0:Y.toLowerCase())||"default",loading:i.value,onClick:oe=>x(z)},null,8,["icon","text","bg-color","variant","loading","onClick"])):n.createCommentVNode("",!0)],64)}),128)):(n.openBlock(),n.createBlock(Xe,{key:1,text:"Submit","bg-color":"primary",loading:i.value,onClick:A},null,8,["loading"]))],2)),n.createVNode(Vo,{modelValue:N.value,"onUpdate:modelValue":O[1]||(O[1]=z=>N.value=z),title:T.value,icon:"Plus","max-width":700},{actions:n.withCtx(()=>[n.createVNode(Xe,{variant:"outline",text:"Cancel",onClick:O[0]||(O[0]=z=>N.value=!1)}),n.createVNode(Xe,{text:"Save",onClick:ee})]),default:n.withCtx(()=>[K.value.length?(n.openBlock(),n.createElementBlock("div",sS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(K.value,z=>(n.openBlock(),n.createElementBlock("div",{key:z.key,class:n.normalizeClass(z.column==="FULL"?"md:col-span-2":"col-span-1")},[n.createVNode(Ms,{field:z,"model-value":R[z.model],"form-data":R,"onUpdate:modelValue":P=>R[z.model]=P},null,8,["field","model-value","form-data","onUpdate:modelValue"])],2))),128))])):n.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}}),lS={class:"w-full space-y-6 animate-pulse"},cS={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},dS=n.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",lS,[o[2]||(o[2]=n.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(2,a=>n.createElementVNode("div",{key:a,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=n.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[n.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),n.createElementVNode("div",cS,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(6,r=>n.createElementVNode("div",{key:r,class:n.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[n.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),n.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=n.createElementVNode("div",{class:"flex items-center gap-2"},[n.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),n.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),uS={class:"w-full"},fS={class:"relative mx-auto min-h-[37.5rem]"},hS={key:"content",class:"w-full"},mS={class:"mb-6"},pS={class:"text-neutral-500 dark:text-neutral-400"},gS={key:"skeleton",class:"w-full"},bS={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Ns=Ct(n.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean}},emits:["submit-success","cancel","action-success"],setup(e,{emit:t}){var A,D,M,V,N,T,K,R;const o=e,a=t,r=(D=(A=n.getCurrentInstance())==null?void 0:A.appContext)==null?void 0:D.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const I=Dn.useRoute();if(I&&Object.keys(I).length>0)s=I;else{const q=n.getCurrentInstance();(N=(V=(M=q==null?void 0:q.appContext)==null?void 0:M.config)==null?void 0:V.globalProperties)!=null&&N.$route&&(s=q.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:I=>{typeof window<"u"&&(typeof I=="string"?window.location.href=I:I&&I.path&&(window.location.href=I.path))},__isFallback:!0};try{const I=Dn.useRouter();if(I)i=I;else{const q=n.getCurrentInstance();(R=(K=(T=q==null?void 0:q.appContext)==null?void 0:T.config)==null?void 0:K.globalProperties)!=null&&R.$router&&(i=q.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Je();let d;try{d=Xt.useI18n().locale}catch{d=n.ref("en")}const{setPageTitle:u}=NE(),f=n.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);n.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=n.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const I=s.path.match(/\/edit\/([^\/]+)$/);return I?I[1]:null}),m=n.ref({}),p=n.ref(null),b=n.ref(!0),y=n.ref(!1),g="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",B="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",w=n.ref(o.layoutCode),C=n.computed(()=>{var ne;if(!p.value)return"";const I=((ne=d==null?void 0:d.value)==null?void 0:ne.toLowerCase())||"en";return(I==="en"||I.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});n.watch(C,I=>{I&&u(I)},{immediate:!0});const E=async()=>{var I,q,ne,W,U,ee;b.value=!0;try{let v=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(v=s.query.code||o.layoutCode);const O="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",$=O?{Authorization:`Bearer ${O}`}:{},X=`${g}${v}`;let te=await l(X,"GET",null,$);if(!te.status||!te.data||Array.isArray(te.data)&&te.data.length===0)try{const ie=`${B}${v}`,re=await l(ie,"GET",null,$);if(re.status){const z=Array.isArray(re.data)?re.data[0]:re.data;z&&z.code&&(v=z.code,w.value=v,te=await l(`${g}${v}`,"GET",null,$))}}catch(ie){console.warn("Failed to resolve layout code via datatable",ie)}if(te.status){p.value=Array.isArray(te.data)?te.data[0]:te.data;const ie={};if((I=p.value)!=null&&I.sections&&p.value.sections.forEach(re=>{((re.propsForm||re.props||{}).fields||re.fields||[]).forEach(H=>{var oe;const Y=H.model||((oe=H.props)==null?void 0:oe.model)||H.key;Y&&(ie[Y]=null)})}),m.value=ie,b.value=!1,f.value&&h.value){y.value=!0;try{const re=(W=(ne=(q=p.value.sections)==null?void 0:q[0])==null?void 0:ne.propsForm)==null?void 0:W.endpointForm,z=p.value.endpointForm,P=re||z;if(P!=null&&P.apiUrl){const H=P.apiUrl,Y=P.apiMethod||"GET",oe=P.keyParam||[],ye={};oe.length>0?oe.forEach(pe=>{ye[pe]=h.value}):ye.id=h.value;const xe=await c(H,Y,ye);if(xe.status){let pe=Array.isArray(xe.data)?xe.data[0]:xe.data;xe.payload&&(pe={...pe,...xe.payload}),m.value={...m.value,...pe}}}else if((U=p.value.endpointGlobal)!=null&&U.apiUrl){const H=p.value.endpointGlobal.apiUrl,Y=p.value.endpointGlobal.apiMethod||"GET",oe={id:h.value},ye=await c(H,Y,oe);if(ye.status){const xe=Array.isArray(ye.data)?ye.data[0]:ye.data;m.value={...m.value,...xe}}}else{const H=((ee=p.value.endpoint)==null?void 0:ee.detailUrl)||`/api/${w.value}/detail/${h.value}`,Y=await l(H,"GET");if(Y.status){let oe=Array.isArray(Y.data)?Y.data[0]:Y.data;if(Y.payload){const xe={...Y.payload};if(Object.keys(xe).forEach(pe=>{oe[pe]!==void 0&&oe[pe]!==null&&(xe[pe]=oe[pe])}),!("id"in xe)&&oe.id){const pe=Object.keys(xe).find(ke=>ke.startsWith("id")&&ke.length>2&&!xe[ke]);pe&&(xe[pe]=oe.id)}oe=xe}const ye={...oe};Object.keys(m.value).forEach(xe=>{if(ye[xe]===void 0||ye[xe]===null){if(xe.toLowerCase().startsWith("id")&&xe.length>2){const ke=xe.substring(2).toLowerCase(),Fe=Array.isArray(Y.data)?Y.data[0]:Y.data,Ze=Object.keys(Fe).find(it=>it.toLowerCase()===ke);Ze&&Fe[Ze]&&typeof Fe[Ze]=="object"&&"id"in Fe[Ze]&&(ye[xe]=Fe[Ze].id)}if(xe==="idSupervisor"){const ke=Array.isArray(Y.data)?Y.data[0]:Y.data;ke.supervisorId&&(ye[xe]=ke.supervisorId)}}}),m.value={...m.value,...ye}}}}catch(re){console.error("Failed to fetch record data:",re)}finally{y.value=!1}}}}catch(v){console.error("Failed to load form layout:",v),b.value=!1}},_=async I=>{var q,ne,W;try{const U=(W=(ne=(q=p.value.sections)==null?void 0:q[0])==null?void 0:ne.propsForm)==null?void 0:W.endpointForm,ee=p.value.endpointGlobal||p.value.endpoint,v=(U==null?void 0:U.submitUrl)||(ee==null?void 0:ee.submitUrl)||`/api/generic/${o.layoutCode}`,O=(U==null?void 0:U.submitMethod)||(ee==null?void 0:ee.submitMethod)||(f.value?"PUT":"POST"),$={...I};f.value&&h.value&&!$.id&&($.id=h.value),await l(v,O,$),a("submit-success",$),i.back()}catch(U){console.error("Submit failed:",U)}},k=async(I,q,ne)=>{if(I==="cancel"){x();return}const W=q.endpointPropAction||q.propsActionGlobal&&q.propsActionGlobal.endpointPropAction;if(W)try{b.value=!0;const U=ne?{...ne}:{...m.value};f.value&&q.model&&h.value&&(U[q.model]=h.value);const ee=W.apiUrl,v=W.apiMethod||"POST";(await c(ee,v,U)).status&&(a("action-success",I,q,U),i.back())}catch(U){console.error("Action failed:",U)}finally{b.value=!1}},x=()=>{a("cancel"),i.back()};return n.onMounted(()=>{E()}),n.onUnmounted(()=>{u("")}),(I,q)=>(n.openBlock(),n.createElementBlock("div",uS,[n.createElementVNode("div",fS,[n.createVNode(n.Transition,{name:"fade",mode:"out-in"},{default:n.withCtx(()=>[!b.value&&p.value?(n.openBlock(),n.createElementBlock("div",hS,[n.createElementVNode("div",mS,[n.createElementVNode("p",pS,n.toDisplayString(p.value.description),1)]),n.createVNode(iS,{schema:p.value,model:m.value,"is-edit-mode":f.value,loading:y.value,onSubmit:_,onCancel:x,onAction:k,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):b.value?(n.openBlock(),n.createElementBlock("div",gS,[n.createVNode(dS)])):(n.openBlock(),n.createElementBlock("div",bS," Failed to load form configuration for "+n.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-5ba0fa8c"]]),yS={class:"h-full flex flex-col"},xS={key:1,class:"flex-1 flex items-center justify-center"},kS={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ps=n.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(e,{emit:t}){var B,w,C,E,_,k;const o=e,a=t,r=n.getCurrentInstance(),{apiUrl:s}=Je();let i={query:{},params:{},path:""};try{const x=Dn.useRoute();x?i=x:(C=(w=(B=r==null?void 0:r.appContext)==null?void 0:B.config)==null?void 0:w.globalProperties)!=null&&C.$route&&(i=r.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:x=>{typeof window<"u"&&(typeof x=="string"?window.location.href=x:x&&x.path&&(window.location.href=x.path))}};try{const x=Dn.useRouter();x?l=x:(k=(_=(E=r==null?void 0:r.appContext)==null?void 0:E.config)==null?void 0:_.globalProperties)!=null&&k.$router&&(l=r.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=n.inject("hasActionAccess",()=>!1),d=n.inject("userPermissions",null),u=n.ref(null),f=n.ref(!0),h=n.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",p=n.computed(()=>`${m}${o.layoutCode}`),b=async()=>{var x;f.value=!0;try{const A="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=A?{Authorization:`Bearer ${A}`}:{},M=await s(p.value,"GET",null,D);M.status&&(u.value=Array.isArray(M.data)?M.data[0]:M.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),console.log("[DEBUG] actionGlobal in config:",(x=u.value)==null?void 0:x.actionGlobal))}catch(A){console.error("Gagal Menampilkan Datatable:",A)}finally{f.value=!1}},y=x=>{x.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",x.action,x)},g=x=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",x);let A=x.route;if(A||(A=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),A){const D=x.path?{code:x.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:A,query:D}),a("navigate",{route:A,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return n.onMounted(()=>{b()}),(x,A)=>(n.openBlock(),n.createElementBlock("div",yS,[!f.value&&u.value?(n.openBlock(),n.createBlock(Kn,{key:0,ref_key:"dtRef",ref:h,"api-url":p.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||n.unref(d),"permission-checker":n.unref(c),checkPermission:o.checkPermission,onAction:y,onNavigate:g},{"header-actions":n.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(n.openBlock(),n.createElementBlock("div",xS,[...A[1]||(A[1]=[n.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(n.openBlock(),n.createElementBlock("div",kS," Failed to load configuration for "+n.toDisplayString(o.layoutCode),1))]))}}),vd=n.defineCustomElement(Ns),Td=n.defineCustomElement(Ps);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",vd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Td));const wS=[Lo,ri,Xe,Ri,Xc,sn,ls,Sa,Vo,ud,Aa,fd,hs,hd,ps,Va,gs,Hn,bs,Da,md,pd,ys,xs,Na,Pa,va,qn,xd,kd,ks,ws,Cs,Kn,Ns,Ps],Od={install(e,t={}){t&&Object.keys(t).length>0&&zs(t),wS.forEach(o=>{o.name&&e.component(o.name,o)})}};de.AutoLayoutDatatable=Ps,de.AutoLayoutForm=Ns,de.DCodeAutoComplete=Lo,de.DCodeButton=Xe,de.DCodeCard=Ri,de.DCodeChart=Xc,de.DCodeCheckbox=sn,de.DCodeCurrencyField=ls,de.DCodeDatePicker=Sa,de.DCodeDialog=Vo,de.DCodeDialogCloseBtn=ud,de.DCodeDropzone=Aa,de.DCodeFileField=fd,de.DCodeFileResult=hs,de.DCodeIconDropdown=hd,de.DCodeImageCropperDialog=ps,de.DCodeImageField=Va,de.DCodeImageResult=gs,de.DCodeInfiniteAutoComplete=ri,de.DCodeLabel=Hn,de.DCodeMultiSelect=bs,de.DCodeOtpInput=Da,de.DCodePermissionMenu=ws,de.DCodeProgress=md,de.DCodeProgressBar=pd,de.DCodeRadio=ys,de.DCodeRadioCustom=xs,de.DCodeSlider=Na,de.DCodeSwitch=Pa,de.DCodeTextField=va,de.DCodeTextarea=qn,de.DCodeTimelineWithIcons=xd,de.DCodeTreePermissions=Cs,de.DCodeUploadFile=kd,de.DCodeWizard=ks,de.DataTable=Kn,de.DataTableComponent=Kn,de.DynamicUI=Od,de.MicroDynamicDatatable=Td,de.MicroDynamicForm=vd,de.cn=Ee,de.default=Od,de.setApiConfig=zs,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
95
|
+
`});return(E,_)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-2 w-full",t.unref(o).class]),"aria-busy":!1},[d.value?(t.openBlock(),t.createBlock(t.unref(Vo),{key:0,for:c.value,class:"text-sm font-medium"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.value)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",Zw,"*")):t.createCommentVNode("",!0)]),_:1},8,["for"])):t.createCommentVNode("",!0),t.createElementVNode("div",e1,[e.showValue?(t.openBlock(),t.createElementBlock("div",t1,[t.createElementVNode("span",n1,t.toDisplayString(r.valuePrefix)+t.toDisplayString(e.min)+t.toDisplayString(r.valueSuffix),1),t.createElementVNode("span",o1,t.toDisplayString(m.value),1),t.createElementVNode("span",a1,t.toDisplayString(r.valuePrefix)+t.toDisplayString(e.max)+t.toDisplayString(r.valueSuffix),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",r1,[t.createElementVNode("div",{class:t.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[t.createElementVNode("div",{class:t.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:t.normalizeStyle({width:`${p.value}%`})},null,6)],2),t.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:t.normalizeClass(f.value),onInput:x,onChange:y,onMousedown:g,onMouseup:B,onTouchstart:g,onTouchend:B},null,42,s1)]),e.marks.length>0?(t.openBlock(),t.createElementBlock("div",i1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.marks,w=>(t.openBlock(),t.createElementBlock("div",{key:w.value,class:"absolute flex flex-col items-center",style:t.normalizeStyle({left:`${k(w.value)}%`,transform:"translateX(-50%)"})},[_[0]||(_[0]=t.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),t.createElementVNode("span",l1,t.toDisplayString(w.label),1)],4))),128))])):t.createCommentVNode("",!0)]),l.value?(t.openBlock(),t.createElementBlock("div",c1,[_[1]||(_[1]=t.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),t.createTextVNode(" "+t.toDisplayString(e.error),1)])):t.createCommentVNode("",!0),C.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent("style"),{key:2},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0)],2)),[[t.vShow,u.value]])}}),u1={class:"grid gap-3"},f1={key:0,class:"ml-1 text-destructive"},h1={class:"inline-flex items-center gap-3"},m1=["id","name","aria-checked","aria-label","disabled"],p1={key:0,class:"absolute inset-0 flex items-center justify-center"},g1={class:"relative z-10 flex items-center gap-2"},b1=["id","name","aria-checked","aria-label","disabled"],y1={key:0,class:"absolute inset-0 flex items-center justify-center"},x1={name:"DCodeSwitch"},va=t.defineComponent({...x1,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(e,{emit:n}){const o=e,a=n,r=t.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(a("update:modelValue",f),a("change",f))}}),s=t.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=t.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=t.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=t.computed(()=>{if(o.disabled)return"bg-gray-300";if(!r.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{r.value=!r.value},u=t.computed(()=>r.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(t.openBlock(),t.createElementBlock("div",u1,[e.title?(t.openBlock(),t.createBlock(Vo,{key:0,class:"text-sm font-medium"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",f1,"*")):t.createCommentVNode("",!0)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",h1,[t.createVNode(t.unref(Ri),null,{default:t.withCtx(()=>[e.showTooltip?(t.openBlock(),t.createBlock(t.unref(zi),{key:0,"delay-duration":200},{default:t.withCtx(()=>[t.createVNode(t.unref(Ii),{"as-child":""},{default:t.withCtx(()=>[t.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:t.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[t.createElementVNode("span",{class:t.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(t.openBlock(),t.createElementBlock("span",p1,[...h[0]||(h[0]=[t.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[t.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):t.createCommentVNode("",!0),t.createVNode(t.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:t.withCtx(()=>[r.value&&!e.loading?(t.openBlock(),t.createBlock(t.unref(oe.Check),{key:0,class:t.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(t.openBlock(),t.createBlock(t.unref(oe.X),{key:1,class:t.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):t.createCommentVNode("",!0)]),_:1})],2)],10,m1)]),_:1}),t.createVNode(t.unref(Fi),{side:"top","side-offset":8,class:t.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:t.withCtx(()=>[t.createElementVNode("span",g1,[t.createElementVNode("span",{class:t.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),t.createTextVNode(" "+t.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:t.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[t.createElementVNode("span",{class:t.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(t.openBlock(),t.createElementBlock("span",y1,[...h[1]||(h[1]=[t.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[t.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):t.createCommentVNode("",!0),t.createVNode(t.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:t.withCtx(()=>[r.value&&!e.loading?(t.openBlock(),t.createBlock(t.unref(oe.Check),{key:0,class:t.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(t.openBlock(),t.createBlock(t.unref(oe.X),{key:1,class:t.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):t.createCommentVNode("",!0)]),_:1})],2)],10,b1))]),_:1})])]))}}),k1=["aria-busy"],w1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},C1={key:1,class:"flex justify-end"},B1=["for"],_1={key:0,class:"ml-1 text-destructive"},E1={class:"relative w-full group"},S1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},A1={key:1},V1=["id","value","placeholder"],D1={key:1,class:"absolute inset-y-0 right-4 flex items-center"},M1={key:2,class:"absolute inset-y-0 right-4 flex items-center"},N1={key:3,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},P1={key:1,class:"text-xs text-destructive"},Ta=t.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(e,{emit:n}){const o=t.useAttrs(),a=t.computed(()=>{var P;return((P=l.valueType)==null?void 0:P.toLowerCase())==="password"||o.type==="password"}),r=t.ref(!1),s=()=>{r.value=!r.value},i=n,l=e,c=t.computed(()=>o.label);t.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=t.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=t.computed(()=>{const P=o.required,H=o["aria-required"];return P===""||P===!0||P==="true"||(H==="true"||H===!0)}),h=t.computed(()=>{const{label:P,class:H,id:Y,required:ae,"aria-required":ye,...xe}=o;return xe}),m=t.computed(()=>{var H,Y;const P={...h.value};return((H=l.valueType)==null?void 0:H.toLowerCase())==="number"&&(P.type="text",P.inputmode="numeric",P.pattern="[0-9]*"),((Y=l.valueType)==null?void 0:Y.toLowerCase())==="email"&&(P.type="email",P.inputmode="email"),a.value&&(P.type=r.value?"text":"password"),l.disabled&&(P.disabled=!0),l.maxLength&&(P.maxlength=l.maxLength),l.minLength&&(P.minlength=l.minLength),l.maxValue&&(P.max=l.maxValue),l.minValue&&(P.min=l.minValue),P}),p=t.computed(()=>{const P=l.modelValue;return P==null||String(P).length===0}),x=t.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),y=t.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),g=t.ref(String(l.modelValue??""));t.watch(()=>l.modelValue,P=>{const H=String(P??"");H!==g.value&&(g.value=H)});const B=t.ref(!1),k=t.ref(!1),C=P=>P.split(/(\s+)/).map(H=>{if(H.trim()==="")return H;const Y=H.toLowerCase();return Y.charAt(0).toUpperCase()+Y.slice(1)}).join(""),E=P=>{const H=P.toLowerCase(),Y=H.search(new RegExp("\\p{L}","u"));return Y<0?H:H.slice(0,Y)+H.charAt(Y).toUpperCase()+H.slice(Y+1)},_=P=>{switch(l.textCase){case"uppercase":return P.toUpperCase();case"lowercase":return P.toLowerCase();case"titlecase":return C(P);case"sentencecase":return E(P);case"none":default:return P}},w=P=>{if(!P)return null;const H=Array.isArray(P)?P.join(""):P;return H?new Set(H):null},b=t.computed(()=>w(l.allowChars)),A=(P,H)=>(P.lastIndex=0,P.test(H)),D=P=>{var pe;const H=(pe=l.valueType)==null?void 0:pe.toLowerCase();if(H==="free"||H==="email"||H==="password")return!0;const Y=P===" ",ae=/\d/.test(P),ye=new RegExp("\\p{L}","u").test(P),xe=new RegExp("\\p{N}","u").test(P);return H==="number"?ae:H==="letter"?ye||l.allowSpaces&&Y:H==="letternumber"?ye||xe||l.allowSpaces&&Y:!0},M=P=>{let H="";for(const Y of P){const ae=!!b.value&&b.value.has(Y);l.pattern&&!ae&&!A(l.pattern,Y)||!ae&&!D(Y)||(H+=Y)}return H},V=t.computed(()=>{const P=l.maxLength??o.maxlength??o.maxLength;let H=Number.NaN;return typeof P=="number"?H=P:typeof P=="string"&&(H=Number.parseInt(P,10)),Number.isFinite(H)&&H>0?H:-1}),N=t.computed(()=>g.value.length),T=t.computed(()=>l.showCharCount?V.value>0:!1),K=P=>V.value>0?P.slice(0,V.value):P,R=P=>{const H=M(P),Y=l.applyTextCaseToValue?_(H):H;return K(Y)};let I=null;const q=P=>{var H;if(P==="")return null;if(((H=l.valueType)==null?void 0:H.toLowerCase())==="number"&&l.returnNumber){const Y=Number(P);return Number.isFinite(Y)?Y:null}return P},ne=P=>{g.value=P,i("update:modelValue",q(P))},W=(P,H)=>{const Y=K(H);k.value=!0,P.value=Y,ne(Y),queueMicrotask(()=>k.value=!1)},U=(P,H)=>{const Y=P.selectionStart??P.value.length,ae=P.selectionEnd??P.value.length;if(V.value>0){const ye=P.value.length-(ae-Y),xe=V.value-ye;if(xe<=0)return;H=H.slice(0,xe)}P.setRangeText(H,Y,ae,"end"),W(P,R(P.value))},ee=P=>{var ae;if(!I||B.value||k.value||!((ae=P.inputType)!=null&&ae.startsWith("insert")))return;const H=P.data;if(H==null)return;const Y=R(H);Y!==H&&(P.preventDefault(),Y.length>0&&U(I,Y))},v=P=>{var ae;if(!I||B.value||k.value)return;const H=((ae=P.clipboardData)==null?void 0:ae.getData("text"))??"",Y=R(H);Y!==H&&(P.preventDefault(),Y.length>0&&U(I,Y))},O=P=>{if(!I||B.value||k.value)return;const H=P.target,Y=H.value??"",ae=R(Y);ae===Y?ne(ae):W(H,ae)},$=()=>B.value=!0,X=()=>{if(B.value=!1,!I)return;const P=I.value??"",H=R(P);H===P?ne(H):W(I,H)};t.onMounted(()=>{if(I=document.getElementById(u.value),!I)return;I.addEventListener("beforeinput",ee),I.addEventListener("paste",v),I.addEventListener("input",O),I.addEventListener("compositionstart",$),I.addEventListener("compositionend",X);const P=I.value??"",H=R(P);H===P?ne(H):W(I,H)}),t.onBeforeUnmount(()=>{I&&(I.removeEventListener("beforeinput",ee),I.removeEventListener("paste",v),I.removeEventListener("input",O),I.removeEventListener("compositionstart",$),I.removeEventListener("compositionend",X),I=null)});const te=()=>{g.value="",I&&(I.value=""),i("update:modelValue",null),i("clear")},ie=t.computed(()=>T.value&&N.value>0),re=t.computed(()=>`${N.value} / ${V.value}`),z=t.computed(()=>!!l.error);return(P,H)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-1 w-full",t.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[c.value?(t.openBlock(),t.createElementBlock("div",w1)):t.createCommentVNode("",!0),H[1]||(H[1]=t.createElementVNode("div",{class:"relative w-full"},[t.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(t.openBlock(),t.createElementBlock("div",C1,[...H[0]||(H[0]=[t.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[c.value?(t.openBlock(),t.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[t.createTextVNode(t.toDisplayString(c.value)+" ",1),f.value?(t.openBlock(),t.createElementBlock("span",_1,"*")):t.createCommentVNode("",!0)],8,B1)):t.createCommentVNode("",!0),t.createElementVNode("div",E1,[l.icon||l.prependInner||P.$slots["prepend-inner"]?(t.openBlock(),t.createElementBlock("div",S1,[t.renderSlot(P.$slots,"prepend-inner",{},()=>[l.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(t.openBlock(),t.createElementBlock("span",A1,t.toDisplayString(l.prependInner),1)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("input",t.mergeProps({id:u.value,value:g.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||P.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${x.value||a.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",z.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,V1),a.value?(t.openBlock(),t.createElementBlock("div",D1,[t.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value?t.unref(oe.Eye):t.unref(oe.EyeOff)),{class:"w-4 h-4"}))])])):t.createCommentVNode("",!0),x.value&&!a.value?(t.openBlock(),t.createElementBlock("div",M1,[t.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:te}," ✕ ")])):t.createCommentVNode("",!0),ie.value&&!z.value?(t.openBlock(),t.createElementBlock("p",N1,t.toDisplayString(re.value),1)):t.createCommentVNode("",!0)]),z.value?(t.openBlock(),t.createElementBlock("p",P1,t.toDisplayString(l.error),1)):t.createCommentVNode("",!0)],64))],10,k1)),[[t.vShow,e.visible]])}}),v1=["aria-busy"],T1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},O1=["for"],z1={key:0,class:"ml-1 text-destructive"},F1={class:"relative w-full group"},R1=["id","value"],I1={key:0,class:"absolute top-1 right-2"},L1={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},$1={key:1,class:"text-xs text-destructive"},Gn=t.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(e,{emit:n}){const o=t.useAttrs(),a=n,r=e,s=t.computed(()=>o.label),i=t.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=t.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=t.computed(()=>{const z=o.required,P=o["aria-required"];return z===""||z===!0||z==="true"||(P==="true"||P===!0)}),u=t.computed(()=>{const{label:z,class:P,id:H,required:Y,"aria-required":ae,...ye}=o;return ye}),f=t.computed(()=>{const z=o.maxlength;let P=Number.NaN;return typeof z=="number"?P=z:typeof z=="string"&&(P=Number.parseInt(z,10)),Number.isFinite(P)&&P>0?P:-1}),h=z=>f.value>0?z.slice(0,f.value):z,m=t.computed(()=>{const z=r.modelValue;return z==null||String(z).length===0}),p=t.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),x=t.ref(String(r.modelValue??""));t.watch(()=>r.modelValue,z=>{const P=String(z??"");P!==x.value&&(x.value=P)});const y=t.ref(!1),g=t.ref(!1),B=z=>z.split(/(\s+)/).map(P=>{if(P.trim()==="")return P;const H=P.toLowerCase();return H.charAt(0).toUpperCase()+H.slice(1)}).join(""),k=z=>{const P=z.toLowerCase(),H=P.search(new RegExp("\\p{L}","u"));return H<0?P:P.slice(0,H)+P.charAt(H).toUpperCase()+P.slice(H+1)},C=z=>{switch(r.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return B(z);case"sentencecase":return k(z);case"none":default:return z}},E=t.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),_=z=>{if(!z)return null;const P=Array.isArray(z)?z.join(""):z;return P?new Set(P):null},w=t.computed(()=>_(r.allowChars)),b=(z,P)=>(z.lastIndex=0,z.test(P)),A=z=>{if(z===`
|
|
96
|
+
`)return r.valueType!=="number";if(r.valueType==="free")return!0;const P=z===" ",H=/\d/.test(z),Y=new RegExp("\\p{L}","u").test(z),ae=new RegExp("\\p{N}","u").test(z);return r.valueType==="number"?H:r.valueType==="letter"?Y||r.allowSpaces&&P:r.valueType==="letternumber"?Y||ae||r.allowSpaces&&P:!0},D=z=>{let P="";for(const H of z){const Y=!!w.value&&w.value.has(H);r.pattern&&!Y&&!b(r.pattern,H)||!Y&&!A(H)||(P+=H)}return P},M=z=>{const P=D(z),H=r.applyTextCaseToValue?C(P):P;return h(H)};let V=null;const N=z=>{if(z==="")return null;if(r.valueType==="number"&&r.returnNumber){const P=z.replaceAll(`
|
|
97
|
+
`,""),H=Number(P);return Number.isFinite(H)?H:null}return z},T=z=>{x.value=z,a("update:modelValue",N(z))},K=(z,P)=>{const H=h(P);g.value=!0,z.value=H,T(H),queueMicrotask(()=>g.value=!1)},R=(z,P)=>{const H=z.selectionStart??z.value.length,Y=z.selectionEnd??z.value.length;if(f.value>0){const ae=z.value.length-(Y-H),ye=f.value-ae;if(ye<=0)return;P=P.slice(0,ye)}z.setRangeText(P,H,Y,"end"),K(z,M(z.value))},I=z=>{var Y;if(!V||y.value||g.value||!((Y=z.inputType)!=null&&Y.startsWith("insert")))return;const P=z.data;if(P==null)return;const H=M(P);H!==P&&(z.preventDefault(),H.length>0&&R(V,H))},q=z=>{var Y;if(!V||y.value||g.value)return;const P=((Y=z.clipboardData)==null?void 0:Y.getData("text"))??"",H=M(P);H!==P&&(z.preventDefault(),H.length>0&&R(V,H))},ne=async z=>{if(!V||y.value||g.value)return;const P=z.target,H=P.value??"",Y=M(H);if(Y===H){const ae=P.selectionStart??Y.length,ye=P.selectionEnd??Y.length;K(P,Y),await t.nextTick();try{P.setSelectionRange(ae,ye)}catch{}T(Y)}else{const ae=P.selectionStart??Y.length,ye=P.selectionEnd??Y.length;K(P,Y),await t.nextTick();try{P.setSelectionRange(ae,ye)}catch{}}},W=()=>y.value=!0,U=()=>{if(y.value=!1,!V)return;const z=V.value??"",P=M(z);P===z?T(P):K(V,P)};t.onMounted(()=>{if(V=document.getElementById(c.value),!V)return;V.addEventListener("beforeinput",I),V.addEventListener("paste",q),V.addEventListener("input",ne),V.addEventListener("compositionstart",W),V.addEventListener("compositionend",U);const z=V.value??"",P=M(z);P===z?T(P):K(V,P)}),t.onBeforeUnmount(()=>{V&&(V.removeEventListener("beforeinput",I),V.removeEventListener("paste",q),V.removeEventListener("input",ne),V.removeEventListener("compositionstart",W),V.removeEventListener("compositionend",U),V=null)});const ee=()=>{x.value="",V&&(V.value=""),a("update:modelValue",null),a("clear")},v=t.computed(()=>x.value.length),O=t.computed(()=>r.showCharCount?f.value>0:!1),$=t.computed(()=>O.value&&v.value>0),X=t.computed(()=>`${v.value} / ${f.value}`),te=t.computed(()=>!!r.error),ie=t.computed(()=>{const z=o.rows,P=typeof z=="number"?z:Number.parseInt(String(z??""),10);return Number.isFinite(P)&&P>0?P:3}),re=t.computed(()=>({height:`${ie.value*24+16}px`}));return(z,P)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col gap-1 w-full",t.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.value?(t.openBlock(),t.createElementBlock("div",T1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:t.normalizeStyle(re.value)},null,4)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.value?(t.openBlock(),t.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[t.createTextVNode(t.toDisplayString(s.value)+" ",1),d.value?(t.openBlock(),t.createElementBlock("span",z1,"*")):t.createCommentVNode("",!0)],8,O1)):t.createCommentVNode("",!0),t.createElementVNode("div",F1,[t.createElementVNode("textarea",t.mergeProps({id:c.value,value:x.value},u.value,{style:`text-transform: ${E.value}; padding-right: ${p.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",te.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,R1),p.value?(t.openBlock(),t.createElementBlock("div",I1,[t.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ee}," ✕ ")])):t.createCommentVNode("",!0),$.value&&!te.value?(t.openBlock(),t.createElementBlock("p",L1,t.toDisplayString(X.value),1)):t.createCommentVNode("",!0)]),te.value?(t.openBlock(),t.createElementBlock("p",$1,t.toDisplayString(r.error),1)):t.createCommentVNode("",!0)],64))],10,v1)),[[t.vShow,i.value]])}}),xd=t.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.AvatarRoot),{class:t.normalizeClass(t.unref(Ee)(t.unref(W1)({size:e.size,shape:e.shape}),n.class))},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),kd=t.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.AvatarFallback),t.normalizeProps(t.guardReactiveProps(n)),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),wd=t.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.AvatarImage),t.mergeProps(n,{class:"h-full w-full object-cover"}),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),W1=ao("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),Oa=t.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.Separator),t.mergeProps(t.unref(o),{class:t.unref(Ee)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),j1={class:"bg-card text-card-foreground"},U1={class:"pb-6 px-3"},H1={key:0,class:"flex justify-center p-8"},q1={key:1,class:"p-8 text-center text-red-500"},G1={key:2,class:"relative"},X1={class:"space-y-6"},Y1={class:"rounded-xl border bg-card text-card-foreground shadow"},K1={class:"p-4"},J1={class:"flex items-center justify-between gap-3"},Q1={class:"font-medium"},Z1={class:"text-xs text-muted-foreground"},eC={class:"mt-1 text-sm text-muted-foreground"},tC={class:"text-foreground"},nC={class:"text-foreground"},oC={class:"mt-1 text-xs text-muted-foreground"},aC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},rC={class:"flex items-center justify-between gap-3"},sC={class:"font-medium"},iC={class:"text-xs text-muted-foreground"},lC={class:"mt-2 text-sm text-muted-foreground"},cC={class:"flex flex-wrap items-center justify-between gap-3"},dC={class:"flex items-center gap-3"},uC={class:"leading-tight"},fC={class:"text-sm font-medium"},hC={class:"text-xs text-muted-foreground"},mC={class:"flex items-center gap-2"},pC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},gC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},bC=["src"],yC={class:"flex-1"},xC={class:"flex items-center justify-between gap-3"},kC={class:"font-medium"},wC={class:"text-xs text-muted-foreground"},CC={class:"mt-1 text-sm text-muted-foreground"},BC={class:"text-left sm:text-center"},_C={class:"text-xs text-muted-foreground"},EC={class:"text-left sm:text-center"},SC={class:"text-xs text-muted-foreground"},AC={class:"text-left sm:text-center"},VC={class:"text-xs text-muted-foreground"},DC={class:"flex items-center justify-between gap-3"},MC={class:"font-medium"},NC={class:"text-xs text-muted-foreground"},PC={class:"mt-2 text-sm text-muted-foreground"},vC={class:"mt-3 flex items-center gap-3"},TC={class:"text-sm font-medium"},OC={class:"flex items-start justify-between gap-3"},zC={class:"font-medium"},FC={class:"mt-3 grid gap-2 text-sm"},RC={class:"flex items-center justify-between gap-3"},IC={class:"flex items-center gap-2 text-muted-foreground"},LC={class:"font-medium"},$C={class:"flex items-center justify-between gap-3"},WC={class:"flex items-center gap-2 text-muted-foreground"},jC={class:"font-medium"},UC={class:"flex items-center justify-between gap-3"},HC={class:"flex items-center gap-2 text-muted-foreground"},qC={class:"font-medium"},GC={class:"flex items-center justify-between"},XC={class:"flex items-center gap-2"},YC={class:"flex items-start justify-between gap-3"},KC={class:"flex items-center gap-2"},JC={class:"font-medium"},QC={class:"mt-2 text-sm text-muted-foreground"},ZC={key:0,class:"mt-1 text-sm text-muted-foreground"},eB={class:"flex flex-wrap items-center justify-between gap-3"},tB={class:"flex items-center gap-2"},nB={class:"text-xs text-muted-foreground"},Cd=t.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(e){const o=Re.useBreakpoints(Re.breakpointsTailwind).smaller("md");t.ref(!1);const a=e,r=t.ref(!1),s=t.ref(null),i=t.ref([]),l=t.computed(()=>i.value.length>0?i.value:a.items&&a.items.length>0?a.items:[]),c=async()=>{if(a.apiUrl){r.value=!0,s.value=null;try{const f=await fetch(a.apiUrl,{method:a.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{r.value=!1}}};t.onMounted(()=>{a.apiUrl&&c()}),t.watch(()=>a.apiUrl,()=>{a.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:oe.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:oe.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:oe.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:oe.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:oe.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:oe.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:oe.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=t.resolveComponent("ShoppingCart"),p=t.resolveComponent("RefreshCcw"),x=t.resolveComponent("MapPin");return t.openBlock(),t.createElementBlock("div",j1,[h[8]||(h[8]=t.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[t.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),t.createElementVNode("div",U1,[r.value?(t.openBlock(),t.createElementBlock("div",H1,[...h[0]||(h[0]=[t.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(t.openBlock(),t.createElementBlock("div",q1,t.toDisplayString(s.value),1)):(t.openBlock(),t.createElementBlock("div",G1,[h[7]||(h[7]=t.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),t.createElementVNode("div",X1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(y,g)=>(t.openBlock(),t.createElementBlock("div",{key:g,class:"relative pl-14"},[t.createElementVNode("div",{class:t.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(y.type).Circle])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(d(y.type).Icon),{class:"h-4 w-4"}))],2),t.createElementVNode("div",Y1,[t.createElementVNode("div",K1,[y.type==="flight"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",J1,[t.createElementVNode("p",Q1,t.toDisplayString(y.title),1),t.createElementVNode("p",Z1,t.toDisplayString(y.meta),1)]),t.createElementVNode("p",eC,[t.createElementVNode("span",tC,t.toDisplayString(y.from),1),t.createVNode(t.unref(oe.ArrowRight),{class:"mx-2 inline h-4 w-4"}),t.createElementVNode("span",nC,t.toDisplayString(y.to),1)]),t.createElementVNode("p",oC,t.toDisplayString(y.time),1),y.fileName?(t.openBlock(),t.createElementBlock("div",aC,[t.createVNode(t.unref(oe.FileText),{class:"h-4 w-4 text-muted-foreground"}),t.createElementVNode("span",null,t.toDisplayString(y.fileName),1)])):t.createCommentVNode("",!0)],64)):y.type==="interview"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",rC,[t.createElementVNode("p",sC,t.toDisplayString(y.title),1),t.createElementVNode("p",iC,t.toDisplayString(y.meta),1)]),t.createElementVNode("p",lC,t.toDisplayString(y.desc),1),t.createVNode(t.unref(Oa),{class:"my-4"}),t.createElementVNode("div",cC,[t.createElementVNode("div",dC,[t.createVNode(t.unref(xd),{class:"h-10 w-10"},{default:t.withCtx(()=>[y.avatarUrl?(t.openBlock(),t.createBlock(t.unref(wd),{key:0,src:y.avatarUrl},null,8,["src"])):t.createCommentVNode("",!0),t.createVNode(t.unref(kd),null,{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),t.createElementVNode("div",uC,[t.createElementVNode("p",fC,t.toDisplayString(y.personName),1),t.createElementVNode("p",hC,t.toDisplayString(y.personRole),1)])]),t.createElementVNode("div",mC,[t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.MessageSquare),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="product"?(t.openBlock(),t.createElementBlock("div",pC,[t.createElementVNode("div",gC,[y.imgUrl?(t.openBlock(),t.createElementBlock("img",{key:0,src:y.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,bC)):(t.openBlock(),t.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),t.createElementVNode("div",yC,[t.createElementVNode("div",xC,[t.createElementVNode("p",kC,t.toDisplayString(y.title),1),t.createElementVNode("p",wC,t.toDisplayString(y.meta),1)]),t.createElementVNode("p",CC,t.toDisplayString(y.desc),1),t.createElementVNode("div",{class:t.normalizeClass(["mt-4 grid gap-3",t.unref(o)?"grid-cols-1":"grid-cols-3"])},[t.createElementVNode("div",BC,[h[1]||(h[1]=t.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),t.createElementVNode("p",_C,t.toDisplayString(y.customer),1)]),t.createElementVNode("div",EC,[h[2]||(h[2]=t.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),t.createElementVNode("p",SC,t.toDisplayString(y.price),1)]),t.createElementVNode("div",AC,[h[3]||(h[3]=t.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),t.createElementVNode("p",VC,t.toDisplayString(y.qty),1)])],2)])])):y.type==="design"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("div",DC,[t.createElementVNode("p",MC,t.toDisplayString(y.title),1),t.createElementVNode("p",NC,t.toDisplayString(y.meta),1)]),t.createElementVNode("p",PC,t.toDisplayString(y.desc),1),t.createElementVNode("div",vC,[t.createVNode(t.unref(xd),{class:"h-10 w-10"},{default:t.withCtx(()=>[y.avatarUrl?(t.openBlock(),t.createBlock(t.unref(wd),{key:0,src:y.avatarUrl},null,8,["src"])):t.createCommentVNode("",!0),t.createVNode(t.unref(kd),null,{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),t.createElementVNode("p",TC,t.toDisplayString(y.personName),1)])],64)):y.type==="server"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createElementVNode("div",OC,[t.createElementVNode("p",zC,t.toDisplayString(y.title),1),t.createVNode(t.unref(Hn),{variant:"destructive",class:"h-6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.chipText??""),1)]),_:2},1024)]),t.createElementVNode("div",FC,[t.createElementVNode("div",RC,[t.createElementVNode("div",IC,[t.createVNode(t.unref(oe.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=t.createElementVNode("span",null,"IP Address",-1))]),t.createElementVNode("span",LC,t.toDisplayString(y.ip),1)]),t.createElementVNode("div",$C,[t.createElementVNode("div",WC,[t.createVNode(t.unref(oe.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=t.createElementVNode("span",null,"CPU",-1))]),t.createElementVNode("span",jC,t.toDisplayString(y.cpu),1)]),t.createElementVNode("div",UC,[t.createElementVNode("div",HC,[t.createVNode(t.unref(oe.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=t.createElementVNode("span",null,"Memory",-1))]),t.createElementVNode("span",qC,t.toDisplayString(y.memory),1)])]),t.createVNode(t.unref(Oa),{class:"my-4"}),t.createElementVNode("div",GC,[t.createElementVNode("div",XC,[t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.Share2),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(p,{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="location"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createElementVNode("div",YC,[t.createElementVNode("div",KC,[t.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),t.createElementVNode("p",JC,t.toDisplayString(y.title),1)]),t.createVNode(t.unref(Hn),{variant:"destructive",class:"h-6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.chipText),1)]),_:2},1024)]),t.createElementVNode("p",QC,t.toDisplayString(y.desc1),1),y.desc2?(t.openBlock(),t.createElementBlock("p",ZC,t.toDisplayString(y.desc2),1)):t.createCommentVNode("",!0),t.createVNode(t.unref(Oa),{class:"my-4"}),t.createElementVNode("div",eB,[t.createElementVNode("div",tB,[t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.Link),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.MessageSquare),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref(mt),{size:"icon",variant:"ghost"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.User),{class:"h-4 w-4"})]),_:1})]),t.createElementVNode("p",nB,"Due date: "+t.toDisplayString(y.due),1)])],64)):t.createCommentVNode("",!0)])])]))),128))])]))])])}}}),oB={class:"dcode-upload-file"},aB={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},rB={key:0,class:"text-xs text-gray-500 mt-1"},sB=["accept"],iB={key:1,class:"text-xs text-red-600 mt-1"},Bd=t.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=n,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(r,s)=>(t.openBlock(),t.createElementBlock("div",oB,[e.label?(t.openBlock(),t.createBlock(qn,{key:0,label:e.label},null,8,["label"])):t.createCommentVNode("",!0),t.createElementVNode("div",aB,[t.createVNode(t.unref(oe.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=t.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[t.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),t.createTextVNode(" or drag and drop ")],-1)),e.accept?(t.openBlock(),t.createElementBlock("p",rB,t.toDisplayString(e.accept),1)):t.createCommentVNode("",!0),t.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:e.accept},null,40,sB)]),e.errorMessage?(t.openBlock(),t.createElementBlock("p",iB,t.toDisplayString(e.errorMessage),1)):t.createCommentVNode("",!0)]))}}),lB=["onClick"],cB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},dB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},uB={key:1},fB={key:0,class:"text-white"},hB={key:1},mB={key:2},pB=["disabled","onClick"],gB={key:1,class:"mr-2 text-sm font-bold opacity-70"},bB={class:"whitespace-normal text-sm text-center leading-tight"},yB={class:"flex flex-col flex-1 min-w-0"},xB={class:"text-sm text-muted-foreground"},kB={class:"px-1"},wB=["disabled"],CB=["type"],BB=["disabled"],Cs=pt(t.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(e,{emit:n}){const o=e,a=n,r=qe(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=t.ref(o.defaultTab),l=t.computed({get(){var w;if(typeof o.modelValue=="string"){const b=(w=o.tabs)==null?void 0:w.findIndex(A=>A.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(w){var b;if(i.value=w,typeof o.modelValue=="string"){const A=(b=o.tabs)==null?void 0:b[w];A?a("update:modelValue",A.key):a("update:modelValue",w)}else a("update:modelValue",w)}}),c=t.computed(()=>{var w;return((w=o.tabs)==null?void 0:w.length)??0}),d=t.computed(()=>{var w;return(w=o.tabs)==null?void 0:w[l.value]});function u(w){return c.value<=0?0:Math.min(Math.max(w,0),c.value-1)}function f(w){return w?typeof w=="string"?Et[w]||null:w:null}const h=t.reactive({});function m(w){return h[w.key]||(h[w.key]={loaded:!1,loading:!1,data:null,error:null}),h[w.key]}function p(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function x(w){const b=w.endpoint||{};return{apiModule:w.apiModule||b.apiModule,apiAction:w.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:w.apiParams}}function y(w){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[w];return!(!b||b.disabled)}async function g(w){if(typeof w.tab.fetchData=="function"){const T=await w.tab.fetchData(),K=(T==null?void 0:T.data)??T;return(K==null?void 0:K.data)??K}const b=x(w.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=p();let M;if(b.apiUrl)M=await s("","",D,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const T={...D,...b.apiParams};M=await s(b.apiModule,b.apiAction,T)}const V=(M==null?void 0:M.data)??M;return(V==null?void 0:V.data)??V}async function B(w,{force:b=!1}={}){const A=u(w),D=o.tabs[A];if(!D)return;const M=m(D);if(!(o.cache&&M.loaded&&!b)&&!M.loading){M.loading=!0,M.error=null;try{const V=await g({tabIndex:A,tab:D});M.data=V,M.loaded=!0,a("loaded",{tabIndex:A,tab:D,data:V})}catch(V){const N=typeof(V==null?void 0:V.message)=="string"&&V.message||typeof V=="string"&&V||"Failed to load tab data.";M.error=N,a("error",{tabIndex:A,tab:D,message:N})}finally{M.loading=!1}}}function k(w){const b=u(w);y(b)&&b!==l.value&&(l.value=b)}function C(w=l.value){return B(w,{force:!0})}function E(){const w=u(l.value-1);w!==l.value&&(l.value=w)}function _(){const w=u(l.value+1);w!==l.value&&(l.value=w)}return t.watch(()=>o.tabs,w=>{for(const b of w??[])m(b)},{immediate:!0}),t.watch(()=>l.value,async w=>{var A;const b=(A=o.tabs)==null?void 0:A[w];b&&a("change",{tabIndex:w,tab:b}),await B(w)},{immediate:!0}),t.watch(()=>o.autoFetchOnMount,async w=>{w&&await B(l.value)},{immediate:!0}),(w,b)=>{var A,D,M;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[t.createElementVNode("div",{class:t.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[t.createElementVNode("div",{class:t.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.tabs,(V,N)=>(t.openBlock(),t.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[t.createElementVNode("div",{class:t.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[N<l.value?"wizard-num-done":"",N===l.value?"wizard-num-active":N>l.value?"wizard-num-pending":""]])},[e.typeWizard==="icon"&&V.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!V.icon&&e.typeWizard!=="none"?(t.openBlock(),t.createElementBlock("span",uB,[N<l.value?(t.openBlock(),t.createElementBlock("span",fB,"✓")):(t.openBlock(),t.createElementBlock("span",hB,t.toDisplayString(N+1),1))])):(t.openBlock(),t.createElementBlock("span",mB))],2),t.createElementVNode("span",{class:t.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",N===l.value?"wizard-text-active":"wizard-text-pending"])},t.toDisplayString(V.title),3)]))),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.tabs,(V,N)=>(t.openBlock(),t.createElementBlock("div",{key:V.key,onClick:T=>k(N),style:t.normalizeStyle({zIndex:e.tabs.length-N}),class:"relative flex-1 group"},[t.createElementVNode("div",{class:t.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[N>0?"pl-8":"",N===l.value?"wizard-step-active":N<l.value?"wizard-step-done":"wizard-step-pending"]])},[e.typeWizard==="icon"&&V.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(t.openBlock(),t.createElementBlock("span",cB,t.toDisplayString(N+1),1)):t.createCommentVNode("",!0),t.createElementVNode("span",dB,t.toDisplayString(V.title),1)],2),N<e.tabs.length-1?(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[N===l.value?"wizard-svg-active":N<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[t.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):t.createCommentVNode("",!0)],12,lB))),128))],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabs,(V,N)=>(t.openBlock(),t.createElementBlock("button",{key:V.key,type:"button",disabled:!y(N),onClick:T=>k(N),class:t.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",t.unref(Ee)("border-b border-r",!e.isVertical&&N===e.tabs.length-1&&"border-r-0",N===l.value?"wizard-btn-active":"wizard-btn-pending",!y(N)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&V.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(t.openBlock(),t.createElementBlock("span",gB,t.toDisplayString(N+1),1)):t.createCommentVNode("",!0),t.createElementVNode("span",bB,t.toDisplayString(V.title),1)],10,pB))),128))],2))],2)],2),e.isVertical?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(Oa),{key:0})),t.createElementVNode("div",yB,[t.createElementVNode("div",{class:t.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?t.renderSlot(w.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[b[1]||(b[1]=t.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))],!0):t.renderSlot(w.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=h[d.value.key])==null?void 0:D.data,loaded:(M=h[d.value.key])==null?void 0:M.loaded,reload:C},()=>[t.createElementVNode("div",xB,[b[2]||(b[2]=t.createTextVNode(" Slot ",-1)),t.createElementVNode("code",kB,"tab-"+t.toDisplayString(d.value.key),1),b[3]||(b[3]=t.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):t.createCommentVNode("",!0)],2),e.isWizard||e.showNavigation?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[t.createElementVNode("button",{type:"button",onClick:E,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,wB),l.value<c.value-1?(t.openBlock(),t.createElementBlock("button",{key:0,type:e.isSubmit?"submit":"button",onClick:_,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,CB)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"submit",disabled:e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[e.loading?(t.openBlock(),t.createBlock(t.unref(oe.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(e.submitText),1)],8,BB))],2)):t.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-9379f062"]]),_B={class:"permission-menu w-full space-y-4"},EB={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},SB={class:"flex items-center justify-between"},AB={class:"flex items-center gap-3 flex-1"},VB=["onClick"],DB={key:1,class:"w-7"},MB={key:2,class:"flex-shrink-0"},NB={class:"text-lg font-semibold flex-1"},PB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},vB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},TB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},OB=["checked","disabled","onChange"],zB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},FB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},RB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},IB={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},LB={class:"flex items-center justify-between"},$B={class:"flex items-center gap-3 flex-1"},WB={key:0,class:"flex-shrink-0"},jB={class:"text-base font-semibold flex-1"},UB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},HB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},qB=["checked","onChange"],GB={class:"text-xs font-medium"},XB={key:0,class:"p-3"},YB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},KB=["checked","disabled","onChange"],JB={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Bs=pt(t.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(e,{expose:n,emit:o}){const{t:a}=Yt.useI18n(),r=e,s=o,i=t.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=t.ref(new Map),c=t.ref(new Set),d=(D=!0)=>{(V=>{V.forEach(N=>{N.permission.forEach(T=>{const K=`${N.id}-${T.id}-parent`,R=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has(K)||l.value.set(K,R||(D?N.checked??!1:!1))}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.permission.forEach(K=>{const R=`${T.id}-${K.id}-child`,I=K.code==="VIEW"||K.name.toUpperCase()==="VIEW";l.value.has(R)||l.value.set(R,I||(D?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),d(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach(D=>{const M=D.menuId,V=D.actionsIds;i.value.forEach(N=>{N.id===M&&V.forEach(T=>{const K=`${M}-${T}-parent`;l.value.set(K,!0)}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.id===M&&V.forEach(K=>{const R=`${M}-${K}-child`;l.value.set(R,!0)})})})})};u(),t.watch(()=>r.modelValue,()=>{u()},{deep:!0}),t.watch(()=>i.value.length,(D,M)=>{M===0&&D>0&&u()});const f=D=>D.detail&&D.detail.length>0,h=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),p=(D,M,V=!1)=>{const N=`${D}-${M}-${V?"child":"parent"}`;return l.value.get(N)??!1},x=()=>{const D=_();s("update:modelValue",D.permissions)},y=(D,M,V,N=!1)=>{const T=V.target.checked,K=`${D}-${M}-${N?"child":"parent"}`;l.value.set(K,T),s("permission-change",D,M,T,!N),x()},g=D=>D.permission.filter(B),B=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",k=(D,M,V)=>{const N=V.target.checked;M.permission.forEach(T=>{if(B(T)){const R=`${M.id}-${T.id}-child`;l.value.set(R,!0);return}const K=`${M.id}-${T.id}-child`;l.value.set(K,N)}),l.value=new Map(l.value),s("menu-check",M.id,N),x()},C=(D,M=!1)=>{const V=M?D.permission:g(D);return!V||V.length===0?!1:V.every(N=>{const T=`${D.id}-${N.id}-${M?"child":"parent"}`;return l.value.get(T)??!1})},E=()=>{const D={};return i.value.forEach(M=>{var V;D[M.id]={name:M.name,parentPermissions:M.permission.map(N=>({id:N.id,name:N.name,checked:p(M.id,N.id,!1)})),children:((V=M.detail)==null?void 0:V.map(N=>({id:N.id,name:N.name,permissions:N.permission.map(T=>({id:T.id,name:T.name,checked:p(N.id,T.id,!0)}))})))||[]}}),D},_=()=>{const D=[],M=(V,N=!1)=>{const T=[];V.permission.forEach(K=>{const R=`${V.id}-${K.id}-${N?"child":"parent"}`;(l.value.get(R)??!1)&&T.push(K.id)}),T.length>0&&D.push({menuId:V.id,actionsIds:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}};return n({getCurrentStates:E,getPermissionsForDatabase:_,getAllPermissionsWithStatus:()=>{const D=[],M=(V,N=!1)=>{const T=V.permission.map(R=>{const I=`${V.id}-${R.id}-${N?"child":"parent"}`,q=l.value.get(I)??!1;return{id:R.id,name:R.name,checked:q}}),K=T.filter(R=>R.checked).map(R=>R.id);D.push({menuId:V.id,menuName:V.name,actionsIds:K,actions:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,M)=>(t.openBlock(),t.createElementBlock("div",_B,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,V=>(t.openBlock(),t.createElementBlock("div",{key:V.id,class:t.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(V)}])},[t.createElementVNode("div",EB,[t.createElementVNode("div",SB,[t.createElementVNode("div",AB,[f(V)?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:N=>h(V.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(V.id)?(t.openBlock(),t.createBlock(t.unref(oe.ChevronDown),{key:0,class:"w-5 h-5"})):(t.openBlock(),t.createBlock(t.unref(oe.ChevronRight),{key:1,class:"w-5 h-5"}))],8,VB)):(t.openBlock(),t.createElementBlock("div",DB)),e.showIcons&&V.icon?(t.openBlock(),t.createElementBlock("span",MB,[t.createElementVNode("i",{class:t.normalizeClass([V.icon,"text-2xl"])},null,2)])):t.createCommentVNode("",!0),t.createElementVNode("h3",NB,t.toDisplayString(V.name),1)])])]),V.permission&&V.permission.length>0&&!f(V)?(t.openBlock(),t.createElementBlock("div",PB,[t.createElementVNode("h4",vB,t.toDisplayString(t.unref(a)("common.permissions"))+": ",1),t.createElementVNode("div",TB,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g(V),N=>(t.openBlock(),t.createElementBlock("label",{key:N.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-neutral-700 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-zinc-800 transition-all group"},[t.createElementVNode("input",{type:"checkbox",checked:B(N)||p(V.id,N.id,!1),disabled:B(N),onChange:T=>y(V.id,N.id,T,!1),class:t.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",B(N)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,OB),t.createElementVNode("span",zB,t.toDisplayString(N.name),1)]))),128))])])):t.createCommentVNode("",!0),t.createVNode(t.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-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:t.withCtx(()=>[f(V)&&m(V.id)?(t.openBlock(),t.createElementBlock("div",FB,[t.createElementVNode("h4",RB,[M[0]||(M[0]=t.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("common.subMenus")),1)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.detail,N=>(t.openBlock(),t.createElementBlock("div",{key:N.id,class:"bg-white dark:bg-zinc-900 rounded-lg border border-gray-200 dark:border-neutral-700 overflow-hidden shadow-sm hover:shadow transition-shadow"},[t.createElementVNode("div",IB,[t.createElementVNode("div",LB,[t.createElementVNode("div",$B,[e.showIcons&&N.icon?(t.openBlock(),t.createElementBlock("span",WB,[t.createElementVNode("i",{class:t.normalizeClass([N.icon,"text-xl"])},null,2)])):t.createCommentVNode("",!0),t.createElementVNode("h5",jB,t.toDisplayString(N.name),1),N.path?(t.openBlock(),t.createElementBlock("span",UB,t.toDisplayString(N.path),1)):t.createCommentVNode("",!0),t.createElementVNode("label",HB,[t.createElementVNode("input",{type:"checkbox",checked:C(N,!0),onChange:T=>k(V,N,T),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,qB),t.createElementVNode("span",GB,t.toDisplayString(t.unref(a)("common.selectAll")),1)])])])]),N.permission&&N.permission.length>0?(t.openBlock(),t.createElementBlock("div",XB,[t.createElementVNode("div",YB,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.permission,T=>(t.openBlock(),t.createElementBlock("label",{key:T.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[t.createElementVNode("input",{type:"checkbox",checked:B(T)||p(N.id,T.id,!0),disabled:B(T),onChange:K=>y(N.id,T.id,K,!0),class:t.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",B(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,KB),t.createElementVNode("span",JB,t.toDisplayString(T.name),1)]))),128))])])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-5f742a90"]]),QB={class:"space-y-4"},ZB={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},e_={key:0,class:"text-danger-500"},t_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},n_={class:"text-neutral-600 dark:text-neutral-400"},o_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},a_={class:"text-neutral-500 dark:text-neutral-400"},r_={key:3,class:"space-y-3"},s_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},i_={class:"flex items-center gap-3"},l_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},c_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},d_={class:"flex items-center gap-2 text-sm font-medium"},u_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},f_={class:"p-4"},h_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},m_={class:"ml-2 flex-1 min-w-0"},p_=["for"],g_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},b_={key:4,class:"mt-1 text-xs text-danger-600"},_s=t.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,{t:r}=Yt.useI18n(),s=t.ref(!0),i=t.ref([]),l=t.ref({}),c=t.ref([]),d=t.ref({}),u=g=>{if(console.log(g),!g)return[];if(Array.isArray(g)&&g.length>0&&g[0].module&&Array.isArray(g[0].permissions))return g.map(B=>({menuId:B.menuId,module:B.module,label:B.label||B.module,permissions:B.permissions}));if(Array.isArray(g)&&g.length>0&&g[0].key){const B={};return g.forEach(k=>{const C=k.key,E=C&&C.includes(".")?C.split(".")[0]:"other";B[E]||(B[E]={menuId:0,module:E,label:E,permissions:[]}),B[E].permissions.push({id:k.id,key:k.key,label:k.label,description:k.description})}),Object.values(B)}if(Array.isArray(g)&&g.length>0&&g[0].id&&g[0].name&&Array.isArray(g[0].permission)){const B=[],k=(C,E="")=>{const _=E?`${E}.${C.name}`:C.name,w=_.toLowerCase().replace(/\s+/g,"_"),b=[];if(C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{b.push(A.id)}),C.permission&&C.permission.length>0){const A=C.permission.map(D=>({id:D.id,key:`${w}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${C.name}`,description:`Permission to ${D.name.toLowerCase()} ${C.name.toLowerCase()}`}));B.push({menuId:C.id,module:w,label:C.name,permissions:A,subMenuIds:b.length>0?b:void 0})}C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{k(A,_)})};return g.forEach(C=>k(C)),B}return g.data?u(g.data):[]},f=async()=>{s.value=!0;try{let g;o.treeData&&o.treeData.length>0?g=o.treeData:g=[];const B=u(g);i.value=B;const k={},C=[],E={};B.forEach(w=>{w.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;E[A]=w.menuId})});const _=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(b=>_.add(b))}),B.forEach(w=>w.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;k[A]=_.has(A)})),l.value=k,c.value=C,d.value=E}catch{i.value=[]}finally{s.value=!1}},h=g=>g.permissions.filter(B=>{const k=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[k]}).length,m=g=>g.permissions.every(B=>{const k=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[k]}),p=g=>{const B=h(g);return B>0&&B<g.permissions.length},x=t.ref(!1),y=(g,B)=>{x.value=!0,g.permissions.map(E=>typeof E.id=="string"?parseInt(E.id):E.id),g.permissions.forEach(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;l.value[_]=B});let k=o.modelValue?[...o.modelValue]:[],C=[g.menuId];g.subMenuIds&&g.subMenuIds.length>0&&(C=[...C,...g.subMenuIds],g.subMenuIds.forEach(E=>{const _=i.value.find(w=>w.menuId===E);_&&_.permissions.forEach(w=>{const b=typeof w.id=="string"?parseInt(w.id):w.id;l.value[b]=B})})),B?C.forEach(E=>{const _=i.value.find(w=>w.menuId===E);if(_){const w=_.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),b=k.findIndex(A=>A.menuId===E);b!==-1?k[b]={menuId:E,actionsIds:w}:k.push({menuId:E,actionsIds:w})}}):k=k.filter(E=>!C.includes(E.menuId)),c.value=k.map(E=>E.menuId),console.log("Full Result:",JSON.stringify(k,null,2)),a("update:modelValue",k),setTimeout(()=>{x.value=!1},100)};return t.watch(()=>o.modelValue,g=>{if(!g)return;const B=new Set,k=[];g.forEach(C=>{k.push(C.menuId),C.actionsIds&&Array.isArray(C.actionsIds)&&C.actionsIds.forEach(E=>B.add(E))}),Object.keys(l.value).forEach(C=>{const E=parseInt(C);l.value[E]=B.has(E)}),c.value=k}),t.watch(()=>o.treeData,g=>{g&&g.length>0&&f()},{deep:!0}),t.watch(l,(g,B)=>{if(x.value)return;if(Object.keys(g).map(C=>parseInt(C)).filter(C=>g[C]!==(B==null?void 0:B[C])).length>0){let C=o.modelValue?[...o.modelValue]:[];const E={};Object.keys(g).forEach(_=>{const w=parseInt(_);if(g[w]){const b=d.value[w];console.log(`Permission ${w} belongs to Menu ${b}`),b!==void 0&&(E[b]||(E[b]=[]),E[b].push(w))}}),Object.keys(E).forEach(_=>{const w=parseInt(_),b=E[w],A=C.findIndex(D=>D.menuId===w);A!==-1?C[A]={menuId:w,actionsIds:b}:C.push({menuId:w,actionsIds:b})}),C=C.filter(_=>E[_.menuId]&&E[_.menuId].length>0),c.value=C.map(_=>_.menuId),console.log("Result:",JSON.stringify(C,null,2)),a("update:modelValue",C)}},{deep:!0}),t.onMounted(f),(g,B)=>(t.openBlock(),t.createElementBlock("div",QB,[e.label?(t.openBlock(),t.createElementBlock("label",ZB,[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",e_,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),s.value?(t.openBlock(),t.createElementBlock("div",t_,[t.createVNode(t.unref(oe.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),t.createElementVNode("span",n_,t.toDisplayString(t.unref(r)("common.loadingPermissions")),1)])):i.value.length===0?(t.openBlock(),t.createElementBlock("div",o_,[t.createElementVNode("p",a_,t.toDisplayString(t.unref(r)("common.noPermissions")),1)])):(t.openBlock(),t.createElementBlock("div",r_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,k=>(t.openBlock(),t.createElementBlock("div",{key:k.module,class:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700 shadow-sm hover:shadow-md transition-shadow"},[t.createElementVNode("div",s_,[t.createElementVNode("div",i_,[t.createVNode(Gt,{modelValue:m(k),indeterminate:p(k),"onUpdate:modelValue":C=>y(k,!!C),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),t.createElementVNode("div",null,[t.createElementVNode("div",l_,t.toDisplayString(k.label||k.module),1),t.createElementVNode("div",c_,t.toDisplayString(h(k))+" "+t.toDisplayString(t.unref(r)("common.from"))+" "+t.toDisplayString(k.permissions.length)+" "+t.toDisplayString(t.unref(r)("common.selected")),1)])]),t.createElementVNode("div",d_,[t.createElementVNode("div",u_,t.toDisplayString(h(k))+"/"+t.toDisplayString(k.permissions.length),1)])]),t.createElementVNode("div",f_,[t.createElementVNode("div",h_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.permissions,C=>(t.openBlock(),t.createElementBlock("div",{key:C.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[t.createVNode(Gt,{modelValue:l.value[typeof C.id=="string"?parseInt(C.id):C.id],"onUpdate:modelValue":E=>l.value[typeof C.id=="string"?parseInt(C.id):C.id]=E,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),t.createElementVNode("div",m_,[t.createElementVNode("label",{for:`perm-${C.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},t.toDisplayString(C.label||C.key),9,p_),C.description?(t.openBlock(),t.createElementBlock("p",g_,t.toDisplayString(C.description),1)):t.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(t.openBlock(),t.createElementBlock("p",b_,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}}),y_=(e,n="short",o="id-ID")=>{const a=typeof e=="string"?new Date(e):e,r=c=>String(c).padStart(2,"0"),s=c=>`${r(c.getHours())}:${r(c.getMinutes())}:${r(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(a):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(a)},x_=e=>new Promise((n,o)=>{const a=document.createElement("textarea");a.value=e,a.style.top="0",a.style.left="0",a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(r){o(r)}finally{document.body.removeChild(a)}}),k_=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e):x_(e),w_=t.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const o=e,a=n,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogRoot),t.normalizeProps(t.guardReactiveProps(t.unref(r))),{default:t.withCtx(()=>[t.renderSlot(s.$slots,"default")]),_:3},16))}}),C_=t.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const o=e,a=n,r=Re.reactiveOmit(o,"class","side"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogPortal),null,{default:t.withCtx(()=>[t.createVNode(t.unref(ue.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),t.createVNode(t.unref(ue.DialogContent),t.mergeProps({class:t.unref(Ee)(t.unref(V_)({side:e.side}),o.class)},{...t.unref(s),...i.$attrs}),{default:t.withCtx(()=>[t.renderSlot(i.$slots,"default"),t.createVNode(t.unref(ue.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),B_=t.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogDescription),t.mergeProps({class:t.unref(Ee)("text-sm text-muted-foreground",n.class)},t.unref(o)),{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),__=t.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),E_=t.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(Ee)("flex flex-col gap-y-2 text-center sm:text-left",n.class))},[t.renderSlot(o.$slots,"default")],2))}}),S_=t.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogTitle),t.mergeProps({class:t.unref(Ee)("text-lg font-medium text-foreground",n.class)},t.unref(o)),{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),A_=t.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.DialogTrigger),t.normalizeProps(t.guardReactiveProps(n)),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),V_=ao("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),D_={class:"flex-1 overflow-hidden"},M_=t.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(e){return(n,o)=>(t.openBlock(),t.createBlock(t.unref(w_),null,{default:t.withCtx(()=>[t.createVNode(t.unref(A_),{"as-child":""},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"trigger",{},()=>[t.createVNode(t.unref(mt),{variant:"outline",class:"gap-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.Search),{class:"w-4 h-4"}),o[0]||(o[0]=t.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),t.createVNode(t.unref(C_),{class:"flex flex-col h-full"},{default:t.withCtx(()=>[t.createVNode(t.unref(E_),{class:"flex-shrink-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(S_),{class:"text-xl font-bold"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1}),t.createVNode(t.unref(B_),{class:"text-sm font-medium text-neutral-600 dark:text-neutral-400"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.description),1)]),_:1})]),_:1}),t.createElementVNode("div",D_,[t.renderSlot(n.$slots,"default")]),t.createVNode(t.unref(__),{class:"flex-shrink-0"},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),N_={key:0},P_=["value","name"],_d=t.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:n}){const{locale:o}=Yt.useI18n(),a=e,r=n,s=t.ref(a.modelValue);t.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:Ta,DCodeAutoComplete:Wo,DCodeDatePicker:Va,DCodeTextarea:Gn,DCodeTextArea:Gn,DCodeCheckbox:Gt,DCodeSwitch:va,DCodeOtpInput:Na,DCodeImageField:Ma,DCodeSlider:Pa},l=t.computed(()=>{const u=a.field.component;return i[u]||null}),c=t.computed(()=>{const u=a.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(t.openBlock(),t.createElementBlock("div",N_,[t.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,P_)])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value),t.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),v_=t.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,r=Re.useVModel(o,"modelValue",a,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>t.isRef(r)?r.value=l:null),class:t.normalizeClass(t.unref(Ee)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[t.vModelText,t.unref(r)]])}}),T_=t.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(e,{emit:n}){const o=e,a=n,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationRoot),t.mergeProps({"data-slot":"pagination"},t.unref(s),{class:o.class}),{default:t.withCtx(c=>[t.renderSlot(i.$slots,"default",t.normalizeProps(t.guardReactiveProps(c)))]),_:3},16,["class"]))}}),O_=t.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationList),t.mergeProps({"data-slot":"pagination-content"},t.unref(o),{class:t.unref(Ee)("flex flex-row items-center gap-1",n.class)}),{default:t.withCtx(s=>[t.renderSlot(a.$slots,"default",t.normalizeProps(t.guardReactiveProps(s)))]),_:3},16,["class"]))}}),z_=t.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationEllipsis),t.mergeProps({"data-slot":"pagination-ellipsis"},t.unref(o),{class:t.unref(Ee)("flex size-9 items-center justify-center",n.class)}),{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},()=>[t.createVNode(t.unref(oe.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=t.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),F_=t.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationFirst),t.mergeProps({"data-slot":"pagination-first",class:t.unref(Ee)(t.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},t.unref(a)),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[t.createVNode(t.unref(oe.ChevronLeftIcon)),s[0]||(s[0]=t.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),R_=t.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const n=e,o=Re.reactiveOmit(n,"class","size","isActive");return(a,r)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationListItem),t.mergeProps({"data-slot":"pagination-item"},t.unref(o),{class:t.unref(Ee)(t.unref(Tn)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),I_=t.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationLast),t.mergeProps({"data-slot":"pagination-last",class:t.unref(Ee)(t.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},t.unref(a)),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=t.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),t.createVNode(t.unref(oe.ChevronRightIcon))])]),_:3},16,["class"]))}}),L_=t.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationNext),t.mergeProps({"data-slot":"pagination-next",class:t.unref(Ee)(t.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},t.unref(a)),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=t.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),t.createVNode(t.unref(oe.ChevronRightIcon))])]),_:3},16,["class"]))}}),$_=t.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class","size"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.PaginationPrev),t.mergeProps({"data-slot":"pagination-previous",class:t.unref(Ee)(t.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},t.unref(a)),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[t.createVNode(t.unref(oe.ChevronLeftIcon)),s[0]||(s[0]=t.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),W_=t.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(e,{emit:n}){const o=e,a=n,r=ue.useForwardPropsEmits(o,a);return(s,i)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectRoot),t.normalizeProps(t.guardReactiveProps(t.unref(r))),{default:t.withCtx(()=>[t.renderSlot(s.$slots,"default")]),_:3},16))}}),j_=t.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:n}){const o=e,a=n,r=Re.reactiveOmit(o,"class"),s=ue.useForwardPropsEmits(r,a);return(i,l)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectPortal),null,{default:t.withCtx(()=>[t.createVNode(t.unref(ue.SelectContent),t.mergeProps({...t.unref(s),...i.$attrs},{class:t.unref(Ee)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:t.withCtx(()=>[t.createVNode(t.unref(G_)),t.createVNode(t.unref(ue.SelectViewport),{class:t.normalizeClass(t.unref(Ee)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:t.withCtx(()=>[t.renderSlot(i.$slots,"default")]),_:3},8,["class"]),t.createVNode(t.unref(q_))]),_:3},16,["class"])]),_:3}))}}),U_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},H_=t.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectItem),t.mergeProps(t.unref(a),{class:t.unref(Ee)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:t.withCtx(()=>[t.createElementVNode("span",U_,[t.createVNode(t.unref(ue.SelectItemIndicator),null,{default:t.withCtx(()=>[t.createVNode(t.unref(oe.Check),{class:"h-4 w-4"})]),_:1})]),t.createVNode(t.unref(ue.SelectItemText),null,{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),q_=t.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectScrollDownButton),t.mergeProps(t.unref(a),{class:t.unref(Ee)("flex cursor-default items-center justify-center py-1",n.class)}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[t.createVNode(t.unref(oe.ChevronDown))])]),_:3},16,["class"]))}}),G_=t.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectScrollUpButton),t.mergeProps(t.unref(a),{class:t.unref(Ee)("flex cursor-default items-center justify-center py-1",n.class)}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[t.createVNode(t.unref(oe.ChevronUp))])]),_:3},16,["class"]))}}),X_=t.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const n=e,o=Re.reactiveOmit(n,"class"),a=ue.useForwardProps(o);return(r,s)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectTrigger),t.mergeProps(t.unref(a),{class:t.unref(Ee)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",n.class)}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default"),t.createVNode(t.unref(ue.SelectIcon),{"as-child":""},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),Y_=t.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const n=e;return(o,a)=>(t.openBlock(),t.createBlock(t.unref(ue.SelectValue),t.normalizeProps(t.guardReactiveProps(n)),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},16))}}),No={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Xn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},st={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},K_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},J_={dangerouslyHTMLString:!1,multiple:!0,position:No.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},Q_={rtl:!1,newestOnTop:!1,toastClassName:""},Ed={...J_,...Q_};st.DEFAULT;var Ve=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(Ve||{}),Es=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(Es||{});const Z_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},eE={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},tE={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},nE={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Sd="Toastify--animate Toastify__none-enter";function Ad(e,n=!1){var o;let a=Z_;if(!e||typeof e=="string")switch(e){case"flip":a=nE;break;case"zoom":a=tE;break;case"slide":a=eE;break}else a=e;if(n)a.enter=Sd;else if(a.enter===Sd){const r=(o=a.exit.split("__")[1])==null?void 0:o.split("-")[0];a.enter=`Toastify--animate Toastify__${r}-enter`}return a}function oE(e){return e.containerId||String(e.position)}const za="will-unmount";function aE(e=No.TOP_RIGHT){return!!document.querySelector(`.${Ve.CSS_NAMESPACE}__toast-container--${e}`)}function rE(e=No.TOP_RIGHT){return`${Ve.CSS_NAMESPACE}__toast-container--${e}`}function sE(e,n,o=!1){const a=[`${Ve.CSS_NAMESPACE}__toast-container`,`${Ve.CSS_NAMESPACE}__toast-container--${e}`,o?`${Ve.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Kn(n)?n({position:e,rtl:o,defaultClassName:a}):`${a} ${n||""}`}function iE(e){var n;const{position:o,containerClassName:a,rtl:r=!1,style:s={}}=e,i=Ve.CSS_NAMESPACE,l=rE(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(za)),f=c||document.createElement("div"),h=document.createElement("div");h.className=sE(o,a,r),h.dataset.testid=`${Ve.CSS_NAMESPACE}__toast-container--${o}`,h.id=oE(e);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const p=s[m];h.style[m]=p}return c||(f.className=Ve.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Ss(e){var n,o,a;const r=typeof e=="string"?e:((n=e.currentTarget)==null?void 0:n.id)||((o=e.target)==null?void 0:o.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Ss,!1);try{Po[r].unmount(),(a=document.getElementById(r))==null||a.remove(),delete Po[r],delete Qe[r]}catch{}}const Po=t.reactive({});function lE(e,n){const o=document.getElementById(String(n));o&&(Po[o.id]=e)}function As(e,n=!0){const o=String(e);if(!Po[o])return;const a=document.getElementById(o);a&&a.classList.add(za),n?(dE(e),a&&a.addEventListener("animationend",Ss,!1)):Ss(o),xt.items=xt.items.filter(r=>r.containerId!==e)}function cE(e){for(const n in Po)As(n,e);xt.items=[]}function Vd(e,n){const o=document.getElementById(e.toastId);if(o){let a=e;a={...a,...Ad(a.transition)};const r=a.appendPosition?`${a.exit}--${a.position}`:a.exit;o.className+=` ${r}`,n&&n(o)}}function dE(e){for(const n in Qe)if(n===e)for(const o of Qe[n]||[])Vd(o)}function uE(e){const n=Yn().find(o=>o.toastId===e);return n==null?void 0:n.containerId}function Vs(e){return document.getElementById(e)}function fE(e){const n=Vs(e.containerId);return n&&n.classList.contains(za)}function Dd(e){var n;const o=t.isVNode(e.content)?t.toRaw(e.content.props):null;return o??t.toRaw((n=e.data)!=null?n:{})}function hE(e){return e?xt.items.filter(n=>n.containerId===e).length>0:xt.items.length>0}function mE(){if(xt.items.length>0){const e=xt.items.shift();Fa(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const Qe=t.reactive({}),xt=t.reactive({items:[]});function Yn(){const e=t.toRaw(Qe);return Object.values(e).reduce((n,o)=>[...n,...o],[])}function pE(e){return Yn().find(n=>n.toastId===e)}function Fa(e,n={}){if(fE(n)){const o=Vs(n.containerId);o&&o.addEventListener("animationend",Ds.bind(null,e,n),!1)}else Ds(e,n)}function Ds(e,n={}){const o=Vs(n.containerId);o&&o.removeEventListener("animationend",Ds.bind(null,e,n),!1);const a=Qe[n.containerId]||[],r=a.length>0;if(!r&&!aE(n.position)){const s=iE(n),i=t.createApp(IE,n);n.useHandler&&n.useHandler(i),i.mount(s),lE(i,s.id)}r&&!n.updateId&&(n.position=a[0].position),t.nextTick(()=>{n.updateId?ht.update(n):ht.add(e,n)})}const ht={add(e,n){const{containerId:o=""}=n;o&&(Qe[o]=Qe[o]||[],Qe[o].find(a=>a.toastId===n.toastId)||setTimeout(()=>{var a,r;n.newestOnTop?(a=Qe[o])==null||a.unshift(n):(r=Qe[o])==null||r.push(n),n.onOpen&&n.onOpen(Dd(n))},n.delay||0))},remove(e){if(e){const n=uE(e);if(n){const o=Qe[n];let a=o.find(r=>r.toastId===e);Qe[n]=o.filter(r=>r.toastId!==e),!Qe[n].length&&!hE(n)&&As(n,!1),mE(),t.nextTick(()=>{a!=null&&a.onClose&&(a.onClose(Dd(a)),a=void 0)})}}},update(e={}){const{containerId:n=""}=e;if(n&&e.updateId){Qe[n]=Qe[n]||[];const o=Qe[n].find(s=>s.toastId===e.toastId),a=(o==null?void 0:o.position)!==e.position||(o==null?void 0:o.transition)!==e.transition,r={...e,disabledEnterTransition:!a,updateId:void 0};ht.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{ze(r.content,r)},e.delay||0)}},clear(e,n=!0){e?As(e,n):cE(n)},dismissCallback(e){var n;const o=(n=e.currentTarget)==null?void 0:n.id,a=document.getElementById(o);a&&(a.removeEventListener("animationend",ht.dismissCallback,!1),setTimeout(()=>{ht.remove(o)}))},dismiss(e){if(e){const n=Yn();for(const o of n)if(o.toastId===e){Vd(o,a=>{a.addEventListener("animationend",ht.dismissCallback,!1)});break}}},dismissForce(e){if(e){const n=Yn();for(const o of n)if(o.toastId===e){const a=document.getElementById(e);a&&(a.remove(),a.removeEventListener("animationend",ht.dismissCallback,!1),ht.remove(e));break}}}},gE=t.reactive({useHandler:void 0}),Md=t.reactive({}),Ra=t.reactive({});function Nd(){return Math.random().toString(36).substring(2,9)}function bE(e){return typeof e=="number"&&!isNaN(e)}function Ms(e){return typeof e=="string"}function Kn(e){return typeof e=="function"}function Ia(...e){return t.mergeProps(...e)}function La(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function yE(e={}){Md[`${Ve.CSS_NAMESPACE}-default-options`]=e}function Pd(){return Md[`${Ve.CSS_NAMESPACE}-default-options`]||Ed}function xE(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var $a=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))($a||{});const vd={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:No.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:Xn.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:st.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},kE={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:st.DEFAULT},theme:{type:String,required:!1,default:Xn.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},wE=t.defineComponent({name:"ProgressBar",props:kE,setup(e,{attrs:n}){const o=t.ref(),a=t.computed(()=>e.hide?"true":"false"),r=t.computed(()=>({...n.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=t.computed(()=>[`${Ve.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${Ve.CSS_NAMESPACE}__progress-bar--controlled`:`${Ve.CSS_NAMESPACE}__progress-bar--animated`,`${Ve.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=t.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=t.computed(()=>e.controlledProgress?null:c),u=t.computed(()=>e.controlledProgress?c:null);return t.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>t.createVNode("div",{ref:o,role:"progressbar","aria-hidden":a.value,"aria-label":"notification timer",class:i.value,style:r.value},null)}}),CE=t.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Xn.AUTO},type:{type:String,required:!1,default:Xn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>t.createVNode("button",{class:`${Ve.CSS_NAMESPACE}__close-button ${Ve.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:n=>{n.stopPropagation(),e.closeToast&&e.closeToast(n)},"aria-label":e.ariaLabel},[t.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[t.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),Wa=({theme:e,type:n,path:o,...a})=>t.createVNode("svg",t.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},a),[t.createVNode("path",{d:o},null)]);function BE(e){return t.createVNode(Wa,t.mergeProps(e,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function _E(e){return t.createVNode(Wa,t.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function EE(e){return t.createVNode(Wa,t.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function SE(e){return t.createVNode(Wa,t.mergeProps(e,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function AE(){return t.createVNode("div",{class:`${Ve.CSS_NAMESPACE}__spinner`},null)}const ja={info:_E,warning:BE,success:EE,error:SE,spinner:AE},VE=e=>e in ja;function DE({theme:e,type:n,isLoading:o,icon:a}){let r;const s=!!o||n==="loading",i={theme:e,type:n};if(s&&(a===void 0||typeof a=="boolean"))return ja.spinner();if(a!==!1){if(La(a))r=t.toRaw(a);else if(Kn(a)){const l=a;i.type=s?"loading":n,r=l(i),r=!r&&s?ja.spinner():r}else t.isVNode(a)?r=t.cloneVNode(a,i):Ms(a)||bE(a)?r=a:VE(n)&&(r=ja[n](i));return r}}const ME=()=>{};function NE(e,n,o=Ve.COLLAPSE_DURATION){const{scrollHeight:a,style:r}=e,s=o;requestAnimationFrame(()=>{r.minHeight="initial",r.height=a+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(n,s)})})}function PE(e){const n=t.ref(!1),o=t.ref(!1),a=t.ref(!1),r=t.ref($a.Enter),s=t.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||Ve.COLLAPSE_DURATION}),i=s.done||ME,l=t.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=t.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=t.computed(()=>e.pauseOnHover?{onMouseenter:y,onMouseleave:x}:{});function u(){const B=l.value.split(" ");h().addEventListener(Es.ENTRANCE_ANIMATION_END,x,{once:!0});const k=E=>{const _=h();E.target===_&&(_.dispatchEvent(new Event(Es.ENTRANCE_ANIMATION_END)),_.removeEventListener("animationend",k),_.removeEventListener("animationcancel",k),r.value===$a.Enter&&E.type!=="animationcancel"&&_.classList.remove(...B))},C=()=>{const E=h();E.classList.add(...B),E.addEventListener("animationend",k),E.addEventListener("animationcancel",k)};e.pauseOnFocusLoss&&m(),C()}function f(){if(!h())return;const B=()=>{const C=h();C.removeEventListener("animationend",B),s.collapse?NE(C,i,s.collapseDuration):i()},k=()=>{const C=h();r.value=$a.Exit,C&&(C.className+=` ${c.value}`,C.addEventListener("animationend",B))};o.value||(a.value?B():setTimeout(k))}function h(){return e.toastRef.value}function m(){document.hasFocus()||y(),window.addEventListener("focus",x),window.addEventListener("blur",y)}function p(){window.removeEventListener("focus",x),window.removeEventListener("blur",y)}function x(){(!e.loading.value||e.isLoading===void 0)&&(n.value=!0)}function y(){n.value=!1}function g(B){B&&(B.stopPropagation(),B.preventDefault()),o.value=!1}return t.watchEffect(f),t.watchEffect(()=>{const B=Yn();o.value=B.findIndex(k=>k.toastId===s.toastId)>-1}),t.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?y():x())}),t.onMounted(u),t.onUnmounted(()=>{e.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:n,hideToast:g,eventHandlers:d}}function vE(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const n=e;return["title","content"].some(o=>o in n)}const TE=t.defineComponent({name:"ToastItem",inheritAttrs:!1,props:vd,setup(e){const n=t.ref(),o=t.computed(()=>!!e.isLoading),a=t.computed(()=>e.progress!==void 0&&e.progress!==null),r=t.computed(()=>DE(e)),s=t.computed(()=>[`${Ve.CSS_NAMESPACE}__toast`,`${Ve.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=PE({toastRef:n,loading:o,done:()=>{ht.remove(e.toastId)},...Ad(e.transition,e.disabledEnterTransition),...e});function u(){const f=e.content;if(vE(f)){const h=[];return f.title!==void 0&&h.push(t.createVNode("div",{"data-testid":"toast-text-title",class:`${Ve.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(t.createVNode("div",{"data-testid":"toast-text-content",class:`${Ve.CSS_NAMESPACE}__toast-text-content`},[f.content])),t.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ve.CSS_NAMESPACE}__toast-text`},[h])}return La(f)?t.h(t.toRaw(f),{toastProps:t.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Kn(f)?f({toastProps:t.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?t.h("div",{innerHTML:f}):f}return()=>t.createVNode("div",t.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:n,"data-testid":`toast-item-${e.toastId}`,onClick:f=>{e.closeOnClick&&c(),e.onClick&&e.onClick(f)}},d.value),[t.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${Ve.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&t.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${Ve.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${Ve.CSS_NAMESPACE}--animate-icon ${Ve.CSS_NAMESPACE}__zoom-enter`].join(" ")},[La(r.value)?t.h(t.toRaw(r.value),{theme:e.theme,type:e.type}):Kn(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),t.createVNode("div",{"data-testid":"toast-content"},[u()])]),(e.closeButton===void 0||e.closeButton===!0)&&t.createVNode(CE,{theme:e.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),La(e.closeButton)?t.h(t.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Kn(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,t.createVNode(wE,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:i.value,autoClose:e.autoClose,controlledProgress:a.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),Ua="vue3-toastify:url-change";let Ha=0,vo;function OE(){if(!(typeof window>"u")&&Ra.lastUrl!==window.location.href){Ra.lastUrl=window.location.href;const e=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Pd().clearOnUrlChange!==!1,n=Object.values(Qe).reduce((o,a)=>(Array.isArray(a)&&o.push(...a),o),[]);for(const o of n)o.toastId&&e(o)&&ht.dismiss(o.toastId);xt.items=xt.items.filter(o=>!e(o.toastProps))}}function zE(){const{history:e}=window,n=e.pushState,o=e.replaceState;return e.pushState=function(...a){const r=n.apply(this,a);return window.dispatchEvent(new Event(Ua)),r},e.replaceState=function(...a){const r=o.apply(this,a);return window.dispatchEvent(new Event(Ua)),r},()=>{e.pushState=n,e.replaceState=o}}function FE(){if(typeof window>"u"||vo)return;const e=zE(),n=()=>OE();window.addEventListener(Ua,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),vo=()=>{e(),window.removeEventListener(Ua,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),vo=void 0}}function RE(){vo&&(vo(),Ra.lastUrl="")}const IE=t.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:vd,setup(e){const n=t.computed(()=>e.containerId),o=t.computed(()=>Qe[n.value]||[]),a=t.computed(()=>o.value.filter(r=>r.position===e.position));return t.onMounted(()=>{typeof window<"u"&&(Ha+=1,FE())}),t.onUnmounted(()=>{typeof window<"u"&&Ha>0&&(Ha-=1,Ha===0&&RE())}),()=>t.createVNode(t.Fragment,null,[a.value.map(r=>{const{toastId:s=""}=r;return t.createVNode(TE,t.mergeProps({key:s},r),null)})])}});let Ns=!1;const Td={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Od(){const e=[];return Yn().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(za)&&e.push(n)}),e}function LE(e){const n=Od().length,o=e??0;return o>0&&n+xt.items.length>=o}function $E(e){LE(e.limit)&&!e.updateId&&xt.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function dn(e,n,o={}){if(Ns)return;o=Ia(Pd(),{type:n},t.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Nd()),o={...o,...o.type==="loading"?Td:{},content:e,containerId:o.containerId||String(o.position)};const a=Number(o==null?void 0:o.progress);return!isNaN(a)&&a<0&&(o.progress=0),a>1&&(o.progress=1),o.theme==="auto"&&(o.theme=xE()),$E(o),Ra.lastUrl=window.location.href,o.multiple?xt.items.length?o.updateId&&Fa(e,o):Fa(e,o):(Ns=!0,ze.clearAll(void 0,!1),setTimeout(()=>{Fa(e,o)},0),setTimeout(()=>{Ns=!1},390)),o.toastId}const ze=(e,n)=>dn(e,st.DEFAULT,n);ze.info=(e,n)=>dn(e,st.DEFAULT,{...n,type:st.INFO}),ze.error=(e,n)=>dn(e,st.DEFAULT,{...n,type:st.ERROR}),ze.warning=(e,n)=>dn(e,st.DEFAULT,{...n,type:st.WARNING}),ze.warn=ze.warning,ze.success=(e,n)=>dn(e,st.DEFAULT,{...n,type:st.SUCCESS}),ze.loading=(e,n)=>dn(e,st.DEFAULT,Ia(n,Td)),ze.dark=(e,n)=>dn(e,st.DEFAULT,Ia(n,{theme:Xn.DARK})),ze.remove=e=>{e?ht.dismiss(e):ht.clear()},ze.clearAll=(e,n)=>{t.nextTick(()=>{ht.clear(e,n)})},ze.isActive=e=>{let n=!1;return n=Od().findIndex(o=>o.toastId===e)>-1,n},ze.update=(e,n={})=>{setTimeout(()=>{const o=pE(e);if(o){const a=t.toRaw(o),{content:r}=a,s={...a,...n,toastId:n.toastId||e,updateId:Nd()},i=s.render||r;delete s.render,dn(i,s.type,s)}},0)},ze.done=e=>{ze.update(e,{isLoading:!1,progress:1})},ze.promise=WE;function WE(e,{pending:n,error:o,success:a},r){var s,i,l;let c;const d={...r||{},autoClose:!1};n&&(c=Ms(n)?ze.loading(n,d):ze.loading(n.render,{...d,...n}));const u={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(i=r==null?void 0:r.closeOnClick)!=null?i:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,p,x)=>{if(p==null){ze.remove(c);return}const y={type:m,...u,...r,data:x},g=Ms(p)?{render:p}:p;return c?ze.update(c,{...y,...g,isLoading:!1}):ze(g.render,{...y,...g,isLoading:!1}),x},h=Kn(e)?e():e;return h.then(m=>{f("success",a,m)}).catch(m=>{f("error",o,m)}),h}ze.POSITION=No,ze.THEME=Xn,ze.TYPE=st,ze.TRANSITIONS=K_;const jE={install(e,n={}){gE.useHandler=n.useHandler||(()=>{}),UE(n)}};typeof window<"u"&&(window.Vue3Toastify=jE);function UE(e={}){const n=Ia(Ed,e);yE(n)}const HE={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},qE={class:"dcode-card animate-slide-up"},GE={class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 dark:border-primary-900/50 rounded-t-xl relative z-30"},XE={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},YE={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},KE={class:"relative w-full sm:w-64"},JE={key:0,class:"relative"},QE={class:"flex flex-col h-full"},ZE={key:0,class:"flex-1 overflow-y-auto py-4"},e2={class:"grid grid-cols-1 gap-4 px-1"},t2={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},n2={class:"flex justify-end gap-2 w-full"},o2={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},a2={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},r2={class:"dcode-table w-full"},s2={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},i2=["onClick"],l2={key:0,class:"flex items-center justify-center w-full"},c2={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},d2={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},u2={key:0,class:"px-3 py-0.5"},f2={key:1},h2=["colspan"],m2={class:"flex flex-col items-center gap-2"},p2={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},g2={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},b2={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},y2={key:0,class:"flex items-center justify-center"},x2={key:0,class:"px-3 py-0.5 !text-center"},k2={key:0,class:"flex items-center justify-center gap-1.5"},w2={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},C2=["colspan"],B2={key:0,class:"px-4 py-3 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-neutral-200 dark:border-neutral-700 flex flex-col sm:flex-row items-center justify-between gap-4 w-full"},_2={class:"flex items-center gap-4"},E2={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},S2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},A2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},V2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},D2={class:"flex-shrink-0"},M2={class:"space-y-4"},N2={class:"text-gray-600 dark:text-gray-400"},P2={class:"grid grid-cols-1 gap-4 py-4 px-1"},v2={class:"flex items-end gap-2"},Jn=t.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(e,{expose:n,emit:o}){var Xd,Yd,Kd,Jd,Qd,Zd;const a=e,r=o,s=t.getCurrentInstance(),{apiUrl:i}=qe(),{locale:l}=Yt.useI18n();let c={query:{},params:{},path:""};try{const S=Mn.useRoute();S?c=S:(Kd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.globalProperties)!=null&&Kd.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:S=>{console.warn("Router push() logic called from fallback:",S),typeof S=="string"&&S.startsWith("/")&&(window.location.href=S)}};try{const S=Mn.useRouter();S?d=S:(Zd=(Qd=(Jd=s==null?void 0:s.appContext)==null?void 0:Jd.config)==null?void 0:Qd.globalProperties)!=null&&Zd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=t.ref(""),f=t.ref(1),h=t.ref(a.perPage),m=t.ref({key:"",direction:"asc"}),p=t.ref([]),x=t.ref(!1),y=t.ref(0),g=t.ref({}),B=t.ref([]),k=t.ref(null),C=t.ref(!0),E=t.ref([]),_=t.ref([]),w=t.ref([]),b=t.ref(!1),A=t.ref(!1),D=t.ref({}),M=t.ref(null),V=t.ref(null),N=t.ref(null),T=t.ref([]),K=t.computed(()=>{if(G.value.length===0)return!1;const S=G.value.map(L=>{const Q=z.value.find(j=>j.type==="CHECKBOX"),F=(Q==null?void 0:Q.keyCheckbox)||"id";return L[F]}).filter(L=>L!=null);return S.length===0?!1:S.every(L=>T.value.includes(L))}),R=t.computed(()=>{if(G.value.length===0)return!1;const S=z.value.find(j=>j.type==="CHECKBOX"),L=(S==null?void 0:S.keyCheckbox)||"id",Q=G.value.map(j=>j[L]).filter(j=>j!=null),F=Q.filter(j=>T.value.includes(j)).length;return F>0&&F<Q.length}),I=S=>{const L=z.value.find(j=>j.type==="CHECKBOX"),Q=(L==null?void 0:L.keyCheckbox)||"id",F=S[Q];return F!==void 0&&T.value.includes(F)},q=S=>{const L=z.value.find(j=>j.type==="CHECKBOX"),Q=(L==null?void 0:L.keyCheckbox)||"id",F=G.value.map(j=>j[Q]).filter(j=>j!=null);if(S){const j=new Set([...T.value,...F]);T.value=Array.from(j)}else T.value=T.value.filter(j=>!F.includes(j))},ne=(S,L)=>{const Q=z.value.find(J=>J.type==="CHECKBOX"),F=(Q==null?void 0:Q.keyCheckbox)||"id",j=S[F];j!=null&&(L?T.value.includes(j)||T.value.push(j):T.value=T.value.filter(J=>J!==j))};t.watch(T,S=>{var Q;r("update:selection",S);const L=K.value||S.length>1;(Q=_.value)!=null&&Q.length&&_.value.forEach(F=>{var j;(j=F.fieldActionGlobal)!=null&&j.length&&F.fieldActionGlobal.forEach(J=>{var Ae,He;const ge=F.endpoint||((Ae=F.propsActionGlobal)==null?void 0:Ae.endpointPropAction)||F.propsActionGlobal,Me=(He=ge==null?void 0:ge.keyParam)==null?void 0:He[0];(Me&&J.model===Me||!Me&&/^(id|ids|idAuditTrail)/i.test(J.model))&&L&&J.model&&(D.value[J.model]=S)})})},{deep:!0});const W=S=>Array.from({length:S}).map((L,Q)=>{const F={id:Q+1,no:Q+1};return z.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?F[j.keyCheckbox||"id"]=Q+1:j.type==="BADGE"||j.type==="badge"||j.condition?F[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":F[j.key]=`Data ${j.label} ${Q+1}`)}),F}),U=S=>S&&typeof S=="string"&&S.trim()?S:void 0,ee=t.computed(()=>{var S,L,Q,F;return U((L=(S=k.value)==null?void 0:S.endpoint)==null?void 0:L.apiModule)||U((F=(Q=k.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiModule)||a.apiModule}),v=t.computed(()=>{var S,L,Q,F;return U((L=(S=k.value)==null?void 0:S.endpoint)==null?void 0:L.apiAction)||U((F=(Q=k.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiAction)||a.apiAction}),O=t.computed(()=>{var S,L,Q,F;return U((L=(S=k.value)==null?void 0:S.endpoint)==null?void 0:L.apiMethod)||U((F=(Q=k.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiMethod)||a.apiMethod||"POST"}),$=t.computed(()=>{var S,L,Q,F;return U((L=(S=k.value)==null?void 0:S.endpoint)==null?void 0:L.apiUrl)||U((F=(Q=k.value)==null?void 0:Q.endpointGlobal)==null?void 0:F.apiUrl)||a.apiUrl}),X=t.computed(()=>a.permissionBase||""),te=t.computed(()=>!w.value||w.value.length===0?[]:[...w.value].sort((S,L)=>(S.seq||0)-(L.seq||0))),ie=S=>{var J,ge,Me;const L=(S==null?void 0:S.column)||((J=S==null?void 0:S.props)==null?void 0:J.column)||((ge=S==null?void 0:S.propsFieldGlobal)==null?void 0:ge.column)||((Me=S==null?void 0:S.propsFieldCustom)==null?void 0:Me.column);if(!L)return"col-span-1";const Q=L.toLowerCase(),j={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[Q]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${L}, returned=${j}`),j},re=()=>{let S=null;if(a.tableConfig&&(S=a.tableConfig),S){k.value=S,S.headers&&(B.value=S.headers.map(F=>{var ge,Me,Ce,Ae,He,$e,Le,Ot,Dn,Za;if(F.key==="action"||((ge=F.custom)==null?void 0:ge.type)==="ACTION"||((Me=F.custom)==null?void 0:Me.type)==="action"){const un=((Ce=F.custom)==null?void 0:Ce.actionCustom)||((Ae=F.custom)==null?void 0:Ae.action);return un&&(E.value=un.map(Xt=>{const Je=Xt.propsActionCustom||Xt.props||{},er=Xt.propCustomMessage||{};return{permission:Xt.permission,label:l.value==="id"?Je.labelID:Je.labelEN,tooltip:l.value==="id"?Je.tooltipID||Je.labelID:Je.tooltipEN||Je.labelEN,icon:Je.icon,variant:Je.variant||"ghost",bgColor:Je.bgColor,action:Je.actionType||Je.key,route:Je.route,path:Je.path,endpoint:Je.endpointPropAction,requiredCondition:Xt.requiredCondition||!1,propCustomCondition:Xt.propCustomCondition||[],openDialog:Xt.openDialog||!1,fieldActionCustom:(Xt.fieldActionCustom||[]).map(tr=>{const zs=tr.propsFieldCustom||tr.propsFieldGlobal||tr.props||{};return{...tr,props:{...zs,endpoint:zs.endpointComponent||zs.endpoint}}}),requireConfirm:Xt.requireConfirm||Je.requireConfirm||!1,confirmTitle:l.value==="id"?er.titleID||Je.confirmTitleID||"Konfirmasi":er.titleEN||Je.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?er.messageID||Je.confirmMessageID||"Apakah Anda yakin?":er.messageEN||Je.confirmMessageEN||"Are you sure?"}})),null}let j;const J=((He=F.custom)==null?void 0:He.conditionBadge)||(($e=F.custom)==null?void 0:$e.condition);return(((Le=F.custom)==null?void 0:Le.type)==="BADGE"||((Ot=F.custom)==null?void 0:Ot.type)==="badge")&&J&&(j=J.map(un=>({value:un.value,label:l.value==="id"?un.labelID:un.labelEN,color:un.color,variant:un.variant}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Dn=F.custom)==null?void 0:Dn.type,condition:j,keyCheckbox:(Za=F.custom)==null?void 0:Za.keyCheckbox}}).filter(F=>F!==null));const L=S.filters||S.filter;L&&Array.isArray(L)&&(w.value=L.map(F=>({...F,props:F.propsFilters||F.props||{}})),w.value.forEach(F=>{g.value[F.model]=""}));const Q=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",Q),Q&&Array.isArray(Q)?(_.value=Q.map(F=>{const j=F.propsActionGlobal||F.props||{};return{key:j.key,permission:F.permission,label:l.value==="id"?j.labelID||"Action":j.labelEN||"Action",tooltip:l.value==="id"?j.tooltipID||j.labelID:j.tooltipEN||j.labelEN,icon:j.icon,variant:j.variant||"default",bgColor:j.bgColor,textColor:j.textColor,route:j.route,path:j.path,endpoint:j.endpointPropAction||F.endpoint,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(J=>{const ge=J.propsFieldGlobal||J.props||{};return{...J,props:{...ge,endpoint:ge.endpointComponent||ge.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",_.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(C.value=S.pagination)}};t.watch(()=>a.tableConfig,()=>{re()},{deep:!0,immediate:!0});const z=t.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?B.value:a.columns||[]),P=t.computed(()=>a.hasActions||E.value.length>0),H=t.computed(()=>a.dummyMode?!1:ee.value||$.value?x.value:a.loading),Y=t.computed(()=>!!ee.value||!!$.value),ae=t.computed(()=>[]),ye=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!a.permissionChecker,effectivePath:X.value}),a.menuPermissions&&a.menuPermissions.length>0){const L=c.path,Q=a.menuPermissions.find(F=>L.startsWith(F.path));if(Q&&Q.actions){const F=Q.actions.find(j=>j.code===S.toUpperCase());return F?F.checked:!1}return!1}if(a.permissionChecker){const L=a.permissionChecker(X.value,S);return console.log("[DEBUG] permissionChecker result:",L),L}return ae.value.some(L=>L.code===S)},xe=(S,L)=>{if(!S.visibilityCondition)return!0;const{field:Q,operator:F,value:j}=S.visibilityCondition,J=De(L,Q);switch(F){case"equals":return J===j;case"notEquals":return J!==j;case"in":return Array.isArray(j)&&j.includes(J);case"notIn":return Array.isArray(j)&&!j.includes(J);case"greaterThan":return J>j;case"lessThan":return J<j;case"contains":return String(J).includes(String(j));default:return!0}},pe=t.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:_.value,ignorePermissions:a.ignorePermissions}),_.value.length===0)return _.value;const S=_.value.filter(L=>{if(a.ignorePermissions)return!0;if(!L.permission)return console.log("[DEBUG] Action no permission, showing:",L.label),!0;if(a.checkPermission){const F=a.checkPermission(L.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(a.permissions){const F=a.permissions.includes(L.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const Q=ye(L.permission);return console.log("[DEBUG] Internal permission check:",{label:L.label,permission:L.permission,hasPerm:Q}),Q});return console.log("[DEBUG] Filtered header actions:",S.length),S}),ke=t.computed(()=>E.value.length===0?E.value:E.value.filter(S=>a.ignorePermissions||!S.permission?!0:a.checkPermission?a.checkPermission(S.permission):a.permissions?a.permissions.includes(S.permission):ye(S.permission))),Fe=S=>ke.value.filter(L=>xe(L,S)),Ze=(S,L)=>{var j,J;if(S.requiredCondition&&((j=S.propCustomCondition)==null?void 0:j.length)>0){const ge=De(L,"status"),Me=S.propCustomCondition.find(Ce=>Ce.value===ge);if(Me)return Me.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const Q=De(L,S.colorCondition.field),F=(J=S.colorCondition.conditions)==null?void 0:J.find(ge=>ge.value===Q);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},it=S=>{const L=(S||"left").toLowerCase();return L==="center"?"justify-center":L==="right"?"justify-end":"justify-start"},_t={ToggleLeft:oe.ToggleLeft,SquarePen:oe.SquarePen,Trash2:oe.Trash2,Eye:oe.Eye,CheckCircle:oe.CheckCircle,Plus:oe.Plus,Download:oe.Download,RefreshCw:oe.RefreshCw,Search:oe.Search,SlidersHorizontal:oe.SlidersHorizontal},et=S=>S?Et[S]?Et[S]:_t[S]||null:null,G=t.computed(()=>a.dummyMode?z.value.length>0?W(10):[]:Y.value?p.value.map((S,L)=>({...S,no:(f.value-1)*h.value+L+1})):ce.value),le=t.computed(()=>a.dummyMode?10:Y.value?y.value:Z.value.length),be=t.computed(()=>le.value===0?0:(f.value-1)*h.value+1),Oe=t.computed(()=>{const S=f.value*h.value;return S>le.value?le.value:S}),De=(S,L)=>{if(!(!S||!L))return L in S?S[L]:L.split(".").reduce((Q,F)=>Q&&Q[F],S)},Z=t.computed(()=>{if(Y.value)return[];if(!u.value)return a.data;const S=u.value.toLowerCase();return a.data.filter(L=>z.value.some(Q=>{const F=De(L,Q.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),se=t.computed(()=>Y.value?[]:m.value.key?[...Z.value].sort((L,Q)=>{const F=De(L,m.value.key),j=De(Q,m.value.key);if(F===j)return 0;let J=0;return typeof F=="number"&&typeof j=="number"?J=F-j:J=String(F).localeCompare(String(j)),m.value.direction==="asc"?J:-J}):Z.value),ce=t.computed(()=>{if(Y.value)return[];const S=(f.value-1)*h.value,L=S+h.value;return se.value.slice(S,L).map((Q,F)=>({...Q,no:S+F+1}))}),we=t.computed(()=>Y.value?Object.values(g.value).some(S=>!!S):!!u.value),je=[10,25,50,100],Tt=()=>{Y.value&&(g.value={...g.value,keyword:u.value},f.value=1,rt())};let Ga;const Id=()=>{a.enableQuickSearch&&(clearTimeout(Ga),Ga=setTimeout(()=>{Tt()},500))};let Xa;const Ld=()=>{clearTimeout(Xa),Xa=setTimeout(()=>{Y.value&&rt()},1e3)};t.watch(u,()=>{a.enableQuickSearch&&Y.value&&Id()});const rt=async()=>{if(!a.dummyMode&&Y.value&&!(!ee.value&&!$.value))try{x.value=!0;const S={page:f.value,perPage:h.value,...g.value,...a.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(Q=>{(S[Q]===""||S[Q]===null||S[Q]===void 0)&&delete S[Q]});let L;ee.value?L=await i(ee.value,v.value,S):$.value&&(L=await i($.value,O.value,S)),$d(L)}catch(S){console.error("DataTable fetch error",S),x.value=!1}},$d=S=>{console.log("DataTable handleResponseData:",S),S&&(a.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(B.value=S.columns.map(L=>({key:L.key||L.field||L.name,label:L.label||L.header||L.name,width:L.width,align:L.align||"LEFT",sortable:L.sortable!==!1,type:L.type,condition:L.condition,format:L.format}))),S.data&&Array.isArray(S.data)?(p.value=S.data,S.totalData?y.value=S.totalData:S.maxPage?y.value=S.maxPage*h.value:y.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(p.value=S,y.value=S.length):S.users?(p.value=S.users,y.value=S.users.length):S.items&&Array.isArray(S.items)?(p.value=S.items,y.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(p.value=S.list,y.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(p.value=S.rows,y.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(p.value=S.result,y.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),p.value=[],y.value=0)),x.value=!1};t.onUnmounted(()=>{clearTimeout(Ga),clearTimeout(Xa)});const Ya=()=>{Object.keys(g.value).forEach(S=>{g.value[S]=""}),u.value="",f.value=1,rt()},Wd=()=>{f.value=1,rt()},Ka=(S,L)=>{const Q=De(S,L.key);let F={variant:"secondary",class:"",label:Q};if(L.condition){const j=L.condition.find(J=>{const ge=(Me,Ce)=>typeof Me=="string"&&typeof Ce=="string"?Me.toLowerCase().trim()===Ce.toLowerCase().trim():Me==Ce;return typeof Q=="object"&&Q!==null?ge(J.value,Q.code)||ge(J.value,Q.id):ge(J.value,Q)});if(j){if(j.variant&&(F.variant=j.variant),F.label=j.label||(typeof Q=="object"?Q.name||Q.code:Q),j.color){const J=j.color.toLowerCase(),ge=F.variant==="outline",Me={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow"},Ce={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Ae={danger:"destructive",secondary:"secondary",primary:"default"};ge?Ce[J]&&(F.class=Ce[J]):Ae[J]?F.variant=Ae[J]:Me[J]&&(F.class=Me[J])}}else F.label=typeof Q=="object"?(Q==null?void 0:Q.name)||(Q==null?void 0:Q.code)||"-":Q}else F.label=typeof Q=="object"?(Q==null?void 0:Q.name)||(Q==null?void 0:Q.code)||"-":Q;return F},jd=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),r("update:sort",m.value)},Os=S=>{S!==f.value&&(f.value=S,Y.value&&rt(),r("update:page",S))},Ud=S=>{h.value=S,f.value=1,Y.value&&rt()},Hd=S=>{const L=Math.random()*15+75;if(S.width){const Q=parseInt(String(S.width));return Q<100?`${Math.floor(Q*(Math.random()*.2+.7))}px`:`${L}%`}return`${L}%`},Ja=()=>{u.value="",g.value={},f.value=1,rt()},ES=S=>{var L;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const Q=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${Q}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){V.value=S,N.value=null,D.value={};const Q=S.fieldActionGlobal||S.field||[];Q.length&&Q.forEach(F=>{var ge;const j=S.endpoint||((ge=S.propsActionGlobal)==null?void 0:ge.endpointPropAction)||S.propsActionGlobal,J=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;J&&F.model===J||!J&&/^(id|ids|idAuditTrail)/i.test(F.model)?D.value[F.model]=T.value:D.value[F.model]||(D.value[F.model]="")}),A.value=!0}else r("action",{action:((L=S.propsActionCustom)==null?void 0:L.key)||S.key||"create",row:null,selection:T.value})},SS=async(S,L)=>{var Q,F,j,J;if(S.requireConfirm){M.value={button:S,row:L},b.value=!0;return}if(S.openDialog){V.value=S,N.value=L,D.value={};const ge=z.value.find(Ae=>Ae.type==="CHECKBOX"),Me=(ge==null?void 0:ge.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Ae=>{/^(id|ids|idAuditTrail)/i.test(Ae.model)?D.value[Ae.model]=[L[Me]]:S.action==="showToken"&&Ae.model==="token"?D.value[Ae.model]=L.token!==void 0?L.token:"":L[Ae.model]!==void 0?D.value[Ae.model]=L[Ae.model]:D.value[Ae.model]=""});const Ce=S.endpoint||((Q=S.propsActionGlobal)==null?void 0:Q.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||((j=S.props)==null?void 0:j.endpointPropAction);if(((J=Ce==null?void 0:Ce.apiMethod)==null?void 0:J.toUpperCase())==="GET"&&Ce.apiUrl){x.value=!0;const{apiUrl:Ae}=qe(),He={};Ce.keyParam&&Array.isArray(Ce.keyParam)&&Ce.keyParam.forEach(($e,Le)=>{const Ot=Ce.model&&Le===0?Ce.model:$e;L[$e]!==void 0&&(He[Ot]=L[$e])}),Object.keys(He).length===0&&L.id&&(He.id=L.id),Ae(Ce.apiUrl,"GET",He).then($e=>{let Le=$e;if($e&&$e.data!==void 0?Le=$e.data:$e&&$e.result!==void 0&&(Le=$e.result),Le!=null){if(typeof Le=="string")D.value.hasOwnProperty("token")&&(D.value.token=Le);else if(typeof Le=="object"&&(Le.item&&(Le=Le.item),Array.isArray(Le)&&(Le=Le[0]||{}),Object.keys(Le).forEach(Ot=>{D.value[Ot]=Le[Ot]}),!D.value.token)){const Ot=Object.keys(Le).find(Dn=>Dn.toLowerCase().includes("token"));if(Ot)D.value.token=Le[Ot];else{const Dn=Object.values(Le).filter(Za=>typeof Za=="string");Dn.length===1&&(D.value.token=Dn[0])}}}A.value=!0}).catch($e=>{console.error("Fetch Data Failed",$e)}).finally(()=>{x.value=!1});return}A.value=!0;return}qd(S,L)},qd=(S,L)=>{if(S.route){if(S.path){const j=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${j}`,S.path)}let Q=S.route;Q.includes(":")?Q=Q.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,J)=>L[J]||L.id||J):L.id&&(Q=`${Q.replace(/\/$/,"")}/${L.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:Q,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){x.value=!0;const{apiUrl:Q}=qe(),F=S.endpoint.apiUrl,j=S.endpoint.apiMethod||"POST",J={};S.endpoint.keyParam&&Array.isArray(S.endpoint.keyParam)&&S.endpoint.keyParam.forEach((ge,Me)=>{const Ce=S.endpoint.model&&Me===0?S.endpoint.model:ge;L[ge]!==void 0&&(J[Ce]=L[ge])}),Object.keys(J).length===0&&L.id&&(J.id=L.id),Q(F,j,J).then(()=>{rt(),r("action",{action:S.action||"success",row:L})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{x.value=!1})}else r("action",{action:S.action,row:L})},AS=()=>{M.value&&(qd(M.value.button,M.value.row),Gd())},VS=()=>{var S,L,Q;if(V.value){const F=V.value,j=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let J=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!J){const Ae=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(He=>/^(id|ids|idAuditTrail)/i.test(He.model));J=Ae?Ae.model:"ids"}let ge=null,Me=!1;if(N.value){const Ce=z.value.find($e=>$e.type==="CHECKBOX"),Ae=(Ce==null?void 0:Ce.keyCheckbox)||"id",He=N.value[Ae];j!=null&&j.apiUrl&&(ge={...D.value},ge[J]||(ge[J]=[He]),Me=!0)}else j!=null&&j.apiUrl&&(ge={...D.value},ge[J]||(ge[J]=T.value||[]),Me=!0);if(Me&&ge&&(j!=null&&j.apiUrl)){if(((L=j==null?void 0:j.apiMethod)==null?void 0:L.toUpperCase())==="GET"){A.value=!1,N.value||(T.value=[]);return}const{apiUrl:Ce}=qe(),Ae=j.apiUrl,He=j.apiMethod||"POST";Ce(Ae,He,ge).then(()=>{A.value=!1,N.value||(T.value=[]),rt(),r("action",{action:"success",row:null})}).catch($e=>{console.error("Action Failed",$e)})}else if(N.value){const Ce=z.value.find(Le=>Le.type==="CHECKBOX"),Ae=(Ce==null?void 0:Ce.keyCheckbox)||"id",He=N.value[Ae],$e={...D.value};$e[J]||($e[J]=[He]),r("action",{action:V.value.action,row:$e}),A.value=!1}else{const Ce={...D.value};Ce[J]||(Ce[J]=T.value);const Ae={action:((Q=V.value.propsActionGlobal)==null?void 0:Q.key)||V.value.key,row:Ce,selection:T.value};r("action",Ae),A.value=!1}}},DS=S=>{const L=D.value[S];L&&k_(String(L)).then(()=>{ze.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Q=>{console.error("Failed to copy",Q)})},Gd=()=>{b.value=!1,M.value=null},MS=t.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),NS=t.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");n({fetchData:rt,filters:g,resetFilters:Ya,handleRefresh:Ja});const Qa=t.ref(""),PS=S=>{if(!S)return"";const L=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:L.apiUrl||S.apiUrl,module:L.apiModule||S.apiModule,action:L.apiAction||S.apiAction,method:L.apiMethod||S.apiMethod,params:S.apiParams,socket:L.socket||S.socketEndpoint,socketParams:S.socketParams})};return t.watch(()=>a.tableConfig,()=>{if(a.tableConfig){re();const S=PS(a.tableConfig);S!==Qa.value&&(!Qa.value&&Y.value?(Qa.value=S,rt()):(Qa.value=S,Y.value&&Ld()))}},{deep:!0,immediate:!0}),t.watch(()=>a.apiModule,()=>{Y.value&&rt()}),t.watch(()=>a.apiParams,()=>{Y.value&&rt()},{deep:!0}),t.watch(()=>_.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const L=pe.value;console.log("[DEBUG] visibleHeaderActions evaluated:",L.length,"items")},{deep:!0}),t.onMounted(()=>{re(),Y.value&&(a.tableConfig||(x.value=!0,rt()))}),(S,L)=>{var Q;return t.openBlock(),t.createElementBlock("div",qE,[t.createElementVNode("div",GE,[t.createElementVNode("div",XE,[e.nested?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",YE,[t.createElementVNode("div",KE,[t.createVNode(t.unref(oe.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),t.createVNode(t.unref(v_),{modelValue:u.value,"onUpdate:modelValue":L[0]||(L[0]=F=>u.value=F),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:t.withKeys(Tt,["enter"])},null,8,["modelValue"])]),w.value.length>0?(t.openBlock(),t.createElementBlock("div",JE,[t.createVNode(M_,null,{trigger:t.withCtx(()=>[t.createVNode(Ye,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:t.withCtx(()=>[t.createElementVNode("div",n2,[t.renderSlot(S.$slots,"filter-footer",{fetch:rt,reset:Ya})])]),default:t.withCtx(()=>[L[8]||(L[8]=t.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),t.createElementVNode("div",QE,[t.renderSlot(S.$slots,"filter-form",{filters:g.value},()=>[w.value.length>0?(t.openBlock(),t.createElementBlock("div",ZE,[t.createElementVNode("div",e2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(te.value,(F,j)=>(t.openBlock(),t.createElementBlock("div",{key:j,class:t.normalizeClass(ie(F))},[t.createVNode(_d,{field:F,modelValue:g.value[F.model],"onUpdate:modelValue":J=>g.value[F.model]=J},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):t.createCommentVNode("",!0)]),w.value.length>0?(t.openBlock(),t.createElementBlock("div",t2,[t.createVNode(Ye,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Ya,disabled:H.value},null,8,["disabled"]),t.createVNode(Ye,{onClick:Wd,disabled:H.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):t.createCommentVNode("",!0)])]),_:3})])):t.createCommentVNode("",!0)])),t.createElementVNode("div",{class:t.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":e.nested}])},[e.nested?(t.openBlock(),t.createElementBlock("span",o2)):t.createCommentVNode("",!0),e.nested?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Ye,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:Ja,disabled:H.value},{icon:t.withCtx(()=>[t.createVNode(t.unref(oe.RefreshCw),{class:t.normalizeClass(["w-3.5 h-3.5",{"animate-spin":H.value}])},null,8,["class"])]),_:1},8,["disabled"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(pe.value,(F,j)=>(t.openBlock(),t.createBlock(Ye,{key:j,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:J=>ES(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),t.renderSlot(S.$slots,"header-actions")],2)])]),t.createElementVNode("div",a2,[t.createElementVNode("table",r2,[t.createElementVNode("thead",s2,[t.createElementVNode("tr",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z.value,F=>(t.openBlock(),t.createElementBlock("th",{key:F.key,class:t.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"",F.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:t.normalizeStyle(F.width?{width:F.width}:{}),onClick:j=>F.sortable&&jd(F.key)},[F.type==="CHECKBOX"?(t.openBlock(),t.createElementBlock("div",l2,[t.createVNode(Gt,{"model-value":K.value,indeterminate:R.value,"onUpdate:modelValue":L[1]||(L[1]=j=>q(!!j)),onClick:L[2]||(L[2]=t.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["flex items-center gap-2 w-full",it(F.align)])},[t.createElementVNode("span",null,t.toDisplayString(F.label),1)],2))],14,i2))),128)),P.value?(t.openBlock(),t.createElementBlock("th",c2,[...L[9]||(L[9]=[t.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):t.createCommentVNode("",!0)])]),t.createElementVNode("tbody",d2,[H.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(h.value,F=>(t.openBlock(),t.createElementBlock("tr",{key:`skeleton-${F}`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z.value,j=>{var J,ge;return t.openBlock(),t.createElementBlock("td",{key:j.key,class:t.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[t.createElementVNode("div",{class:t.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(j.type??"")||j.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((J=j.align)==null?void 0:J.toLowerCase())==="center"?"mx-auto":"",((ge=j.align)==null?void 0:ge.toLowerCase())==="right"?"ml-auto":""]]),style:t.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:Hd(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),e.hasActions?(t.openBlock(),t.createElementBlock("td",u2,[...L[10]||(L[10]=[t.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[t.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),t.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),t.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):t.createCommentVNode("",!0)]))),128)):G.value.length===0?(t.openBlock(),t.createElementBlock("tr",f2,[t.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"text-center py-16"},[t.createElementVNode("div",m2,[t.createVNode(t.unref(ou.Vue3Lottie),{animationData:t.unref(HE),height:200,width:200},null,8,["animationData"]),t.createElementVNode("div",null,[t.createElementVNode("p",p2,t.toDisplayString(we.value?"No search results":"No data"),1),t.createElementVNode("p",g2,t.toDisplayString(we.value?"Try changing keywords":"No data added"),1)])])],8,h2)])):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:2},t.renderList(G.value,(F,j)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:j},[t.createElementVNode("tr",b2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z.value,J=>(t.openBlock(),t.createElementBlock("td",{key:J.key,class:t.normalizeClass([J.align?`text-${J.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[t.renderSlot(S.$slots,`cell-${J.key}`,{row:F,value:De(F,J.key)},()=>[J.type==="CHECKBOX"?(t.openBlock(),t.createElementBlock("div",y2,[t.createVNode(Gt,{"model-value":I(F),"onUpdate:modelValue":ge=>ne(F,!!ge),onClick:L[3]||(L[3]=t.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):J.type==="badge"||J.type==="BADGE"||J.condition?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[J.align?`justify-${J.align.toLowerCase()}`:"justify-start"]])},[t.createVNode(t.unref(Hn),{variant:Ka(F,J).variant,class:t.normalizeClass([Ka(F,J).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(Ka(F,J).label),1)]),_:2},1032,["variant","class"])],2)):J.key==="no"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString((f.value-1)*h.value+j+1),1)],64)):J.type==="date"||J.type==="DATE"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(De(F,J.key)?t.unref(y_)(De(F,J.key),"long"):"-"),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(J.format?J.format(De(F,J.key)):De(F,J.key)),1)],64))])],2))),128)),P.value?(t.openBlock(),t.createElementBlock("td",x2,[t.renderSlot(S.$slots,"actions",{row:F,buttons:Fe(F),getButtonColor:Ze,getIconComponent:et},()=>[Fe(F).length>0?(t.openBlock(),t.createElementBlock("div",k2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Fe(F),(J,ge)=>(t.openBlock(),t.createElementBlock("div",{key:ge,class:"group relative"},[t.createVNode(Ye,{tooltip:J.tooltip||J.label,icon:J.icon,size:"icon",rounded:J.rounded||"sm",borderStyle:J.borderStyle||"none",variant:J.variant||"ghost","bg-color":Ze(J,F),onClick:Me=>SS(J,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(t.openBlock(),t.createElementBlock("tr",w2,[t.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"px-0 py-0"},[t.renderSlot(S.$slots,"expanded-row",{row:F,index:j})],8,C2)])):t.createCommentVNode("",!0)],64))),128))])])]),!H.value&&G.value.length>0&&e.showPagination&&C.value?(t.openBlock(),t.createElementBlock("div",B2,[t.createElementVNode("div",_2,[t.createVNode(t.unref(W_),{"model-value":String(h.value),"onUpdate:modelValue":L[4]||(L[4]=F=>Ud(Number(F)))},{default:t.withCtx(()=>[t.createVNode(t.unref(X_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:t.withCtx(()=>[t.createVNode(t.unref(Y_),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),t.createVNode(t.unref(j_),null,{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(je,F=>t.createVNode(t.unref(H_),{key:F,value:String(F)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),L[15]||(L[15]=t.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),t.createElementVNode("span",E2,[L[11]||(L[11]=t.createTextVNode(" Showing ",-1)),t.createElementVNode("span",S2,t.toDisplayString(be.value),1),L[12]||(L[12]=t.createTextVNode(" to ",-1)),t.createElementVNode("span",A2,t.toDisplayString(Oe.value),1),L[13]||(L[13]=t.createTextVNode(" of ",-1)),t.createElementVNode("span",V2,t.toDisplayString(le.value),1),L[14]||(L[14]=t.createTextVNode(" items ",-1))])]),t.createElementVNode("div",D2,[t.createVNode(t.unref(T_),{total:le.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":Os,class:"scale-90 origin-right"},{default:t.withCtx(()=>[t.createVNode(t.unref(O_),{class:"flex items-center gap-1"},{default:t.withCtx(({items:F})=>[t.createVNode(t.unref(F_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref($_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F,(j,J)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[j.type==="page"?(t.openBlock(),t.createBlock(t.unref(R_),{key:J,value:j.value,"as-child":""},{default:t.withCtx(()=>[t.createVNode(t.unref(mt),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:ge=>Os(j.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(t.openBlock(),t.createBlock(t.unref(z_),{key:j.type,index:J},null,8,["index"]))],64))),256)),t.createVNode(t.unref(L_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.ChevronRight),{class:"h-4 w-4"})]),_:1}),t.createVNode(t.unref(I_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):t.createCommentVNode("",!0),t.createVNode(Mo,{modelValue:b.value,"onUpdate:modelValue":L[5]||(L[5]=F=>b.value=F),title:MS.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:t.withCtx(()=>[t.createVNode(Ye,{variant:"outline",onClick:Gd,text:"Cancel"}),t.createVNode(Ye,{variant:"default",onClick:AS,text:"Yes"})]),default:t.withCtx(()=>[t.createElementVNode("div",M2,[t.createElementVNode("p",N2,t.toDisplayString(NS.value),1)])]),_:1},8,["modelValue","title"]),t.createVNode(Mo,{modelValue:A.value,"onUpdate:modelValue":L[7]||(L[7]=F=>A.value=F),title:((Q=V.value)==null?void 0:Q.label)||"Action",icon:"AlertCircle","max-width":450},{actions:t.withCtx(()=>[t.createVNode(Ye,{variant:"outline",onClick:L[6]||(L[6]=F=>A.value=!1),text:"Cancel"}),t.createVNode(Ye,{variant:"default",onClick:VS,text:"Save"})]),default:t.withCtx(()=>{var F,j;return[t.createElementVNode("div",P2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((F=V.value)==null?void 0:F.fieldActionCustom)||((j=V.value)==null?void 0:j.fieldActionGlobal)||[],(J,ge)=>{var Me,Ce,Ae;return t.openBlock(),t.createElementBlock(t.Fragment,{key:ge},[J.isHidden?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(ie(J))},[t.createElementVNode("div",v2,[t.createVNode(_d,{class:"flex-1 w-full",field:J,modelValue:D.value[J.model],"onUpdate:modelValue":He=>D.value[J.model]=He},null,8,["field","modelValue","onUpdate:modelValue"]),J.isCopyable||(Me=J.props)!=null&&Me.isCopyable||((Ce=V.value)==null?void 0:Ce.action)==="showToken"||((Ae=V.value)==null?void 0:Ae.action)==="copyToken"?(t.openBlock(),t.createBlock(Ye,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:He=>DS(J.model)},null,8,["onClick"])):t.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function T2(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const O2={class:"flex flex-col gap-3 w-full"},z2={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-dashed border-slate-200 dark:border-slate-800 rounded-lg opacity-70 pointer-events-none animate-pulse"},F2={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-slate-400"},R2={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-800 rounded-lg opacity-70"},I2={class:"text-sm font-medium text-slate-500"},L2={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},$2={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},W2=["onClick"],j2=["for","onDrop"],U2={class:"text-xs text-slate-500 dark:text-slate-400"},H2={key:2,class:"text-xs text-slate-400"},q2=["id","disabled","accept","onChange"],G2=t.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,{t:r,locale:s}=Yt.useI18n(),i=t.computed(()=>{const g=o.endpoint;if(!(g!=null&&g.apiUrl))return null;let B=g.apiUrl;if(!B.startsWith("http")&&o.baseUrl){const k=o.baseUrl.replace(/\/$/,""),C=B.startsWith("/")?B:`/${B}`;B=`${k}${C}`}return B}),l=t.computed(()=>{const g=c.value.length;return g<=1?"grid-cols-1":g===2?"grid-cols-1 md:grid-cols-2":g===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":g===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=t.ref([]),d=t.ref([]),u=t.ref(new Set),f=t.ref(!0),h=async()=>{var g;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((g=o.endpointReference)!=null&&g.apiUrl)){f.value=!1;return}try{const{apiUrl:B}=qe(),k=await B(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let C=(k==null?void 0:k.data)||k;Array.isArray(C)||(C=[C]),c.value=C}catch(B){console.error("Failed to fetch dynamic document list",B)}finally{f.value=!1}};t.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=structuredClone(t.toRaw(o.modelValue))),h()}),t.watch(()=>o.modelValue,g=>{Array.isArray(g)&&JSON.stringify(g)!==JSON.stringify(d.value)&&(d.value=structuredClone(t.toRaw(g)))},{deep:!0}),t.watch(()=>{var g;return(g=o.endpointReference)==null?void 0:g.apiUrl},(g,B)=>{g!==B&&h()}),t.watch(()=>{var g;return(g=o.endpointReference)==null?void 0:g.apiMethod},(g,B)=>{g!==B&&h()}),t.watch(()=>o.items,g=>{c.value=g??[],f.value=!1},{deep:!0,immediate:!0});const m=g=>{const B=g[o.itemValue]||g.id||g.typeDocument;return d.value.find(k=>k.typeDocument===B||k.idDocumentType===B||k[o.itemValue]===B)||null},p=async(g,B,k)=>{var w,b;const C=k.target,E=(w=C.files)==null?void 0:w[0];if(!E)return;const _=g[o.itemValue]||g.id||g.typeDocument;if(g[o.itemTitle]||g.name||g.filename,!i.value){const A=[...d.value],D=A.findIndex(V=>V.typeDocument===_||V.idDocumentType===_),M={id:null,filename:E.name,document:E.name,typeDocument:_};D>-1?A[D]={...A[D],...M}:A.push(M),d.value=A,a("update:modelValue",A);return}u.value.add(B);try{const{apiUrl:A}=qe(),D=new FormData;D.append("doc",E),D.append("typeDocument",String(_));const M=await A(i.value,((b=o.endpoint)==null?void 0:b.apiMethod)||"POST",D),V=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,N=(V==null?void 0:V.url)||(V==null?void 0:V.document)||E.name,T=(V==null?void 0:V.id)||null,K=(V==null?void 0:V.filename)||(V==null?void 0:V.name)||E.name,R=[...d.value],I=R.findIndex(ne=>ne.typeDocument===_||ne.idDocumentType===_),q={id:T,filename:K,document:N,typeDocument:_};I>-1?R[I]={...R[I],...q}:R.push(q),d.value=R,a("update:modelValue",R)}catch(A){console.error("Upload failed",A)}finally{u.value.delete(B),C.value=""}},x=g=>{const B=g[o.itemValue]||g.id||g.typeDocument,k=d.value.filter(C=>C.typeDocument!==B&&C.idDocumentType!==B);d.value=k,a("update:modelValue",k)},y=(g,B,k)=>{var _,w;k.preventDefault();const C=(w=(_=k.dataTransfer)==null?void 0:_.files)==null?void 0:w[0];if(!C)return;p(g,B,{target:{files:[C],value:""}})};return(g,B)=>(t.openBlock(),t.createElementBlock("div",O2,[e.label||e.labelID||e.labelEN?(t.openBlock(),t.createBlock(qn,{key:0,text:e.label||(t.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(t.openBlock(),t.createElementBlock("div",z2,[t.createVNode(qn,{text:t.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),t.createElementVNode("div",F2,[t.createVNode(t.unref(oe.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(t.openBlock(),t.createElementBlock("div",R2,[t.createVNode(t.unref(oe.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),t.createElementVNode("span",I2,t.toDisplayString(t.unref(r)("dynamicUploadList.noDocsRequired")),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(k,C)=>{var E;return t.openBlock(),t.createElementBlock("div",{key:C,class:"flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg shadow-sm"},[t.createVNode(qn,{text:k[e.itemTitle]||k.name||k.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(k)?(t.openBlock(),t.createElementBlock("div",L2,[t.createVNode(t.unref(oe.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),t.createElementVNode("span",$2,t.toDisplayString(((E=m(k))==null?void 0:E.filename)||t.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:_=>x(k)},[t.createVNode(t.unref(oe.X),{class:"w-4 h-4"})],8,W2))])):(t.openBlock(),t.createElementBlock("label",{key:1,for:`dyn-upload-input-${C}`,class:t.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(C)?"pointer-events-none opacity-70":""]]),onDragover:B[0]||(B[0]=t.withModifiers(()=>{},["prevent"])),onDrop:_=>!e.disabled&&!u.value.has(C)&&y(k,C,_)},[u.value.has(C)?(t.openBlock(),t.createBlock(t.unref(oe.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(t.openBlock(),t.createBlock(t.unref(oe.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),t.createElementVNode("span",U2,t.toDisplayString(u.value.has(C)?t.unref(r)("dynamicUploadList.uploading"):t.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(t.openBlock(),t.createElementBlock("span",H2,t.toDisplayString(e.typeFile),1)):t.createCommentVNode("",!0),t.createElementVNode("input",{id:`dyn-upload-input-${C}`,type:"file",class:"sr-only",disabled:e.disabled||u.value.has(C),accept:e.typeFile,onChange:_=>p(k,C,_)},null,40,q2)],42,j2))])}),128))],2)]))}}),X2={key:0},Y2=["value","name"],K2={key:2,class:"text-xs text-neutral-400 italic"},Ps=t.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:n}){let o=t.ref("en");try{o=Yt.useI18n().locale}catch{}const a=e,r=n,s=t.ref(a.modelValue);t.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:Ta,DCodeAutoComplete:Wo,DCodeDatePicker:Va,DCodeTextarea:Gn,DCodeTextArea:Gn,DCodeCheckbox:Gt,DCodeSwitch:va,DCodeOtpInput:Na,DCodeImageField:Ma,DCodeSlider:Pa,DCodeRadio:ks,DCodeRadioCustom:ws,DCodeDynamicUploadList:G2,DCodeMultiSelect:xs,DCodeCurrencyField:ds,DCodePermissionMenu:Bs,DCodeTreePermissions:_s},l=t.computed(()=>{const u=a.field.component;return i[u]||null}),c=t.computed(()=>{const u=a.field.props||{},f={};if((u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),f.required=a.required!==void 0?a.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(p=>{a.formData&&a.formData[p]!=null&&(m[p]=a.formData[p])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),a.options&&a.options.length>0&&(f.options=a.options,f.items=a.options),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(t.openBlock(),t.createElementBlock("div",X2,[t.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,Y2)])):l.value?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value),t.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(t.openBlock(),t.createElementBlock("div",K2," Unknown field: "+t.toDisplayString(e.field.component),1))}}),J2={class:"w-full space-y-6"},Q2={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},Z2={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},eS={key:0,class:"px-4 py-3"},tS={class:"text-sm font-semibold text-white"},nS={class:"px-4 py-3"},oS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},aS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},rS={key:2,class:"w-full"},sS={class:"space-y-6 mt-4"},iS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},lS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},cS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},dS=t.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action"],setup(e,{emit:n}){const o=e,a=n;let r=t.ref("en"),s=v=>v;try{const v=Yt.useI18n();r=v.locale,s=v.t}catch{}const i=t.ref(!1),l=t.ref(null),c=t.computed(()=>o.schema||l.value),d=t.reactive({}),u=t.reactive({}),f=t.reactive({}),h=v=>{var O,$,X;return((O=v.propsForm)==null?void 0:O.key)||(($=v.propsTable)==null?void 0:$.key)||((X=v.propsWizard)==null?void 0:X.key)||v.id||"unknown-section"},m=v=>{var X;const O=((X=v.propsWizard)==null?void 0:X.propsSteps)||[],$=r.value==="en";return O.map((te,ie)=>{let re=[];if(Array.isArray(te.sectionsWizard))re=te.sectionsWizard;else if(te.sectionsWizard&&typeof te.sectionsWizard=="object"){const z=te.sectionsWizard;re=[{type:z.type||(z.fields?"FORM":z.isDataTable?"TABLE":"UNKNOWN"),...z}]}return{key:te.key||`step-${ie}`,title:$?te.titleEN:te.titleID,description:$?te.descriptionEN:te.descriptionID,icon:te.icon||void 0,sections:re}})},p=v=>v?[...v].sort((O,$)=>(O.seq||0)-($.seq||0)):[],x=(v,O)=>{d[v]=O},y=(v,O)=>{var z,P;if(O==null)return O;let $=null;if((P=(z=c.value)==null?void 0:z.sections)==null||P.forEach(H=>{var ye,xe,pe;const ae=(((ye=H.propsForm)==null?void 0:ye.fields)||H.fields||((xe=H.sectionsWizard)==null?void 0:xe.fields)||[]).find(ke=>ke.model===v);ae&&($=ae),H.type==="WIZARD"&&(((pe=H.propsWizard)==null?void 0:pe.propsSteps)||[]).forEach(Fe=>{(Array.isArray(Fe.sectionsWizard)?Fe.sectionsWizard:[Fe.sectionsWizard].filter(Boolean)).forEach(it=>{if(it.fields){const _t=it.fields.find(et=>et.model===v);_t&&($=_t)}})})}),!$)return O;const X=B[$.key];if(!X||!Array.isArray(X))return O;const te=$.props||{},ie=te.itemValue||te.model||"id",re=X.find(H=>String(H[ie])===String(O));return re&&re.code?re.code:re&&re.value?re.value:O},g=(v,O)=>{if(v==null)return!0;if(typeof v!="object")return v;if(Object.keys(v).length===0)return null;if("var"in v)return O[v.var]??null;if("=="in v){const $=(v["=="]||[])[0],X=(v["=="]||[])[1],te=g($,O),ie=g(X,O);if(String(te)===String(ie))return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie} ? true (direct)`),!0;if($&&typeof $=="object"&&$.var){const re=y($.var,te);if(String(re)===String(ie))return console.log(`[DynamicForm] evaluateLogic ==: ${te}(->${re}) == ${ie} ? true (resolved)`),!0}if(X&&typeof X=="object"&&X.var){const re=y(X.var,ie);if(String(te)===String(re))return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie}(->${re}) ? true (resolved)`),!0}return console.log(`[DynamicForm] evaluateLogic ==: ${te} == ${ie} ? false`),!1}if("!="in v)return!g({"==":v["!="]},O);if(">"in v){const[$,X]=(v[">"]||[]).map(te=>g(te,O));return Number($)>Number(X)}if(">="in v){const[$,X]=(v[">="]||[]).map(te=>g(te,O));return Number($)>=Number(X)}if("<"in v){const[$,X]=(v["<"]||[]).map(te=>g(te,O));return Number($)<Number(X)}if("<="in v){const[$,X]=(v["<="]||[]).map(te=>g(te,O));return Number($)<=Number(X)}if("and"in v)return v.and.every($=>g($,O));if("or"in v)return v.or.some($=>g($,O));if("!"in v)return!g(v["!"],O);if("length"in v){const $=g(v.length,O);return $==null?0:typeof $=="string"||Array.isArray($)?$.length:0}return!0},B=t.reactive({}),k=async v=>{const O=v.props||{},$=O.endpointReference||O.endpoint;if(!(!($!=null&&$.apiUrl)||B[v.key]))try{console.log(`[DynamicForm] Prefetching for ${v.key} from ${$.apiUrl}`);const{apiUrl:X}=qe(),te=await X($.apiUrl,$.apiMethod||"GET",{page:1,perPage:100});let ie=(te==null?void 0:te.data)||te;Array.isArray(ie)||(ie=ie?[ie]:[]),B[v.key]=ie,console.log(`[DynamicForm] Prefetched ${ie.length} items for ${v.key}`)}catch(X){console.error(`[DynamicForm] Failed prefetching for ${v.key}`,X),B[v.key]=[]}},C=v=>{var re,z;const O=v.props||{},$=B[v.key]||O.items||O.options||[];if(!((re=v.logic)!=null&&re.optionsFilterRule)||!Array.isArray(v.logic.optionsFilterRule))return $;console.log(`[DynamicForm] getFilteredItems check for ${v.key}`,{formData:JSON.parse(JSON.stringify(d)),hasRules:!!((z=v.logic)!=null&&z.optionsFilterRule)});const X=v.logic.optionsFilterRule.find(P=>P.condition?g(P.condition,d):!0);if(!X)return console.log(`[DynamicForm] getFilteredItems: No active rule found for ${v.key}`),$;const te=O.itemValue||O.model||"id",ie=$.filter(P=>typeof P!="object"?X.values.includes(String(P))||X.values.includes(P):[te,"code","id","value"].some(Y=>{const ae=P[Y];return ae==null?!1:X.values.includes(String(ae))||X.values.includes(ae)}));return console.log(`[DynamicForm] Filtering ${v.key}: ${$.length} -> ${ie.length} items (rule active)`,{ruleValues:X.values}),ie},E=v=>{if(!v||typeof v!="object")return[];if("var"in v)return[v.var];let O=[];return Object.values(v).forEach($=>{Array.isArray($)?$.forEach(X=>{O=O.concat(E(X))}):typeof $=="object"&&(O=O.concat(E($)))}),O};t.watch(()=>c.value,v=>{if(!(v!=null&&v.sections))return;const O=new Set,$=X=>{X&&["visibleRule","requiredRule","optionsFilterRule"].forEach(te=>{X[te]&&E(X[te]).forEach(ie=>O.add(ie))})};v.sections.forEach(X=>{var te,ie,re,z,P,H;if(((te=X.type)==null?void 0:te.toUpperCase())==="FORM"&&((ie=X.propsForm)!=null&&ie.fields)&&X.propsForm.fields.forEach(Y=>{var ae;$(Y.logic),(ae=Y.logic)!=null&&ae.optionsFilterRule&&k(Y)}),((re=X.type)==null?void 0:re.toUpperCase())==="TABLE"&&((z=X.propsTable)!=null&&z.modelDatatable)){const Y=X.propsTable.modelDatatable;(!d[Y]||!Array.isArray(d[Y]))&&(d[Y]=[])}else if(((P=X.type)==null?void 0:P.toUpperCase())==="WIZARD"){const Y=h(X);u[Y]===void 0&&(u[Y]=0),(((H=X.propsWizard)==null?void 0:H.propsSteps)||[]).forEach(ye=>{(Array.isArray(ye.sectionsWizard)?ye.sectionsWizard:[ye.sectionsWizard].filter(Boolean)).forEach(pe=>{pe.fields&&pe.fields.forEach(ke=>{var Fe;$(ke.logic),(Fe=ke.logic)!=null&&Fe.optionsFilterRule&&k(ke)})})})}}),v.sections.forEach(X=>{var ie,re;(((ie=X.propsForm)==null?void 0:ie.fields)||X.fields||[]).forEach(z=>{O.has(z.model)&&k(z)}),X.type==="WIZARD"&&(((re=X.propsWizard)==null?void 0:re.propsSteps)||[]).forEach(P=>{(Array.isArray(P.sectionsWizard)?P.sectionsWizard:[P.sectionsWizard].filter(Boolean)).forEach(Y=>{Y.fields&&Y.fields.forEach(ae=>{O.has(ae.model)&&k(ae)})})})})},{immediate:!0});const _=v=>{var $;const O=($=v.logic)==null?void 0:$.visibleRule;return!O||Object.keys(O).length===0?!0:!!g(O,d)},w=v=>{var X,te;const O=((X=v.props)==null?void 0:X.required)??!1,$=(te=v.logic)==null?void 0:te.requiredRule;return!$||Object.keys($).length===0?O:!!g($,d)},b=async v=>{const O=v.propsActionGlobal;if(!O)return;const $=O.fieldMapping;let X={};$&&typeof $=="object"&&Object.keys($).length>0?Object.keys($).forEach(te=>{const ie=$[te];d[te]!==void 0&&(X[ie]=d[te])}):X={...d},a("action",O.key||"",v,X)},A=async()=>{i.value=!0;try{a("submit",{...d})}finally{i.value=!1}},D=()=>{a("cancel")},M=v=>v.permission?o.isEditMode?v.permission!=="CREATE":v.permission!=="UPDATE":!0,V=v=>{const O=v.modelDatatable;if(!O)return[];const $=d[O];return Array.isArray($)?$:[]},N=t.ref(!1),T=t.ref(""),K=t.ref([]),R=t.reactive({}),I=t.ref(""),q=t.ref(null),ne=t.ref(null),W=(v,O)=>{var X,te;I.value=v.modelDatatable||"",ne.value=O,q.value=null;const $=O.fieldActionGlobal||[];K.value=$,T.value=((X=O.propsActionGlobal)==null?void 0:X.labelID)||((te=O.propsActionGlobal)==null?void 0:te.labelEN)||"Add Row",Object.keys(R).forEach(ie=>delete R[ie]),$.forEach(ie=>{R[ie.model]=null}),N.value=!0},U=(v,O)=>{var Y;const{action:$,row:X}=O;if(/delete|trash|remove/i.test($)){const ae=v.modelDatatable;if(ae&&Array.isArray(d[ae])){const ye=d[ae].indexOf(X);if(ye!==-1)d[ae].splice(ye,1);else{const xe=JSON.stringify(X),pe=d[ae].findIndex(ke=>JSON.stringify(ke)===xe);pe!==-1&&d[ae].splice(pe,1)}}return}const ie=v.modelDatatable||"";I.value=ie;const re=d[ie],z=Array.isArray(re)?re.indexOf(X):-1;q.value=z!==-1?z:null;const P=v.actionTableGlobal||[],H=((Y=P[0])==null?void 0:Y.fieldActionGlobal)||[];K.value=H,T.value="Edit Row",ne.value=P[0],Object.keys(R).forEach(ae=>delete R[ae]),H.forEach(ae=>{R[ae.model]=X[ae.model]??null}),N.value=!0},ee=()=>{const v=I.value;if(!v)return;Array.isArray(d[v])||(d[v]=[]);const O={...R};q.value!==null?d[v].splice(q.value,1,O):d[v].push(O),N.value=!1};return(v,O)=>{var $,X,te,ie,re;return t.openBlock(),t.createElementBlock("div",J2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(($=c.value)==null?void 0:$.sections,(z,P)=>{var H,Y,ae,ye,xe;return t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[((H=z.type)==null?void 0:H.toUpperCase())==="FORM"&&z.propsForm?(t.openBlock(),t.createElementBlock("div",Q2,[t.createElementVNode("div",Z2,[z.propsForm.titleID||z.propsForm.titleEN?(t.openBlock(),t.createElementBlock("div",eS,[t.createElementVNode("h3",tS,t.toDisplayString(t.unref(r)==="id"?z.propsForm.titleID:z.propsForm.titleEN),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",nS,[t.createVNode(Ye,{size:"sm",icon:"List",text:t.unref(s)("common.back"),variant:"outline",onClick:D},null,8,["text"])])]),t.createElementVNode("div",{class:t.normalizeClass(["p-4 grid gap-4",z.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p(z.propsForm.fields),pe=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:pe.key},[_(pe)?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([pe.column==="FULL"&&z.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[t.createVNode(Ps,{field:pe,"model-value":d[pe.model],"form-data":d,required:w(pe),options:C(pe),"onUpdate:modelValue":ke=>x(pe.model,ke)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):t.createCommentVNode("",!0)],64))),128))],2)])):((Y=z.type)==null?void 0:Y.toUpperCase())==="TABLE"&&z.propsTable?(t.openBlock(),t.createElementBlock("div",oS,[(ae=z.propsTable.actionTableGlobal)!=null&&ae.length?(t.openBlock(),t.createElementBlock("div",aS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z.propsTable.actionTableGlobal,(pe,ke)=>{var Fe,Ze;return t.openBlock(),t.createElementBlock(t.Fragment,{key:ke},[pe.propsActionGlobal?(t.openBlock(),t.createBlock(Ye,{key:0,icon:pe.propsActionGlobal.icon,"bg-color":((Fe=pe.propsActionGlobal.bgColor)==null?void 0:Fe.toLowerCase())||"primary",variant:((Ze=pe.propsActionGlobal.variant)==null?void 0:Ze.toLowerCase())||"default",size:"sm",onClick:it=>W(z.propsTable,pe)},null,8,["icon","bg-color","variant","onClick"])):t.createCommentVNode("",!0)],64)}),128))])):t.createCommentVNode("",!0),t.createVNode(Jn,{"table-config":z.propsTable,data:V(z.propsTable),nested:!0,"show-pagination":z.propsTable.pagination??!0,onAction:pe=>U(z.propsTable,pe)},null,8,["table-config","data","show-pagination","onAction"])])):((ye=z.type)==null?void 0:ye.toUpperCase())==="WIZARD"&&z.propsWizard?(t.openBlock(),t.createElementBlock("div",rS,[t.createVNode(Cs,{tabs:m(z),modelValue:u[h(z)],"onUpdate:modelValue":pe=>u[h(z)]=pe,"is-vertical":z.propsWizard.isVertical,"is-wizard":z.propsWizard.isWizard,"type-wizard":((xe=z.propsWizard.typeWizard)==null?void 0:xe.toLowerCase())||"icon",loading:i.value},t.createSlots({_:2},[t.renderList(m(z),pe=>({name:`tab-${pe.key}`,fn:t.withCtx(()=>[t.createElementVNode("div",sS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(pe.sections,(ke,Fe)=>{var Ze,it,_t;return t.openBlock(),t.createElementBlock(t.Fragment,{key:Fe},[((Ze=ke.type)==null?void 0:Ze.toUpperCase())==="FORM"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["grid gap-4",ke.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p(ke.fields),et=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:et.key},[_(et)?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([et.column==="FULL"&&ke.layoutColumns>1?"md:col-span-2":"col-span-1"])},[t.createVNode(Ps,{field:et,"model-value":d[et.model],"form-data":d,required:w(et),options:C(et),"onUpdate:modelValue":G=>x(et.model,G)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):t.createCommentVNode("",!0)],64))),128))],2)):((it=ke.type)==null?void 0:it.toUpperCase())==="TABLE"||ke.isDataTable?(t.openBlock(),t.createElementBlock("div",iS,[t.createVNode(Jn,{"table-config":ke.propsDataTableWizard||ke.propsTable,data:V(ke.propsDataTableWizard||ke.propsTable),nested:!0,"show-pagination":((_t=ke.propsDataTableWizard||ke.propsTable)==null?void 0:_t.pagination)??!0,onAction:et=>U(ke.propsDataTableWizard||ke.propsTable,et)},null,8,["table-config","data","show-pagination","onAction"])])):(t.openBlock(),t.createElementBlock("div",lS," Unknown section type: "+t.toDisplayString(ke.type),1))],64)}),128))])])}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):t.createCommentVNode("",!0)],64)}),128)),f!=null&&f.global?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(((te=(X=c.value)==null?void 0:X.ui)==null?void 0:te.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(re=(ie=c.value)==null?void 0:ie.actionGlobal)!=null&&re.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(c.value.actionGlobal,(z,P)=>{var H,Y;return t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[z.propsActionGlobal&&M(z)?(t.openBlock(),t.createBlock(Ye,{key:0,icon:z.propsActionGlobal.icon,text:t.unref(r)==="id"?z.propsActionGlobal.labelID:z.propsActionGlobal.labelEN,"bg-color":((H=z.propsActionGlobal.bgColor)==null?void 0:H.toLowerCase())||"primary",variant:((Y=z.propsActionGlobal.variant)==null?void 0:Y.toLowerCase())||"default",loading:i.value,onClick:ae=>b(z)},null,8,["icon","text","bg-color","variant","loading","onClick"])):t.createCommentVNode("",!0)],64)}),128)):(t.openBlock(),t.createBlock(Ye,{key:1,text:"Submit","bg-color":"primary",loading:i.value,onClick:A},null,8,["loading"]))],2)),t.createVNode(Mo,{modelValue:N.value,"onUpdate:modelValue":O[1]||(O[1]=z=>N.value=z),title:T.value,icon:"Plus","max-width":700},{actions:t.withCtx(()=>[t.createVNode(Ye,{variant:"outline",text:"Cancel",onClick:O[0]||(O[0]=z=>N.value=!1)}),t.createVNode(Ye,{text:"Save",onClick:ee})]),default:t.withCtx(()=>[K.value.length?(t.openBlock(),t.createElementBlock("div",cS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(K.value,z=>(t.openBlock(),t.createElementBlock("div",{key:z.key,class:t.normalizeClass(z.column==="FULL"?"md:col-span-2":"col-span-1")},[t.createVNode(Ps,{field:z,"model-value":R[z.model],"form-data":R,"onUpdate:modelValue":P=>R[z.model]=P},null,8,["field","model-value","form-data","onUpdate:modelValue"])],2))),128))])):t.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}}),uS={class:"w-full space-y-6 animate-pulse"},fS={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},hS=t.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",uS,[o[2]||(o[2]=t.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(2,a=>t.createElementVNode("div",{key:a,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=t.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[t.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),t.createElementVNode("div",fS,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(6,r=>t.createElementVNode("div",{key:r,class:t.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[t.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),t.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=t.createElementVNode("div",{class:"flex items-center gap-2"},[t.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),t.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),mS={class:"w-full"},pS={class:"relative mx-auto min-h-[37.5rem]"},gS={key:"content",class:"w-full"},bS={class:"mb-6"},yS={class:"text-neutral-500 dark:text-neutral-400"},xS={key:"skeleton",class:"w-full"},kS={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},vs=pt(t.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean}},emits:["submit-success","cancel","action-success"],setup(e,{emit:n}){var A,D,M,V,N,T,K,R;const o=e,a=n,r=(D=(A=t.getCurrentInstance())==null?void 0:A.appContext)==null?void 0:D.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const I=Mn.useRoute();if(I&&Object.keys(I).length>0)s=I;else{const q=t.getCurrentInstance();(N=(V=(M=q==null?void 0:q.appContext)==null?void 0:M.config)==null?void 0:V.globalProperties)!=null&&N.$route&&(s=q.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:I=>{typeof window<"u"&&(typeof I=="string"?window.location.href=I:I&&I.path&&(window.location.href=I.path))},__isFallback:!0};try{const I=Mn.useRouter();if(I)i=I;else{const q=t.getCurrentInstance();(R=(K=(T=q==null?void 0:q.appContext)==null?void 0:T.config)==null?void 0:K.globalProperties)!=null&&R.$router&&(i=q.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=qe();let d;try{d=Yt.useI18n().locale}catch{d=t.ref("en")}const{setPageTitle:u}=T2(),f=t.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);t.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=t.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const I=s.path.match(/\/edit\/([^\/]+)$/);return I?I[1]:null}),m=t.ref({}),p=t.ref(null),x=t.ref(!0),y=t.ref(!1),g="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",B="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",k=t.ref(o.layoutCode),C=t.computed(()=>{var ne;if(!p.value)return"";const I=((ne=d==null?void 0:d.value)==null?void 0:ne.toLowerCase())||"en";return(I==="en"||I.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});t.watch(C,I=>{I&&u(I)},{immediate:!0});const E=async()=>{var I,q,ne,W,U,ee;x.value=!0;try{let v=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(v=s.query.code||o.layoutCode);const O="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",$=O?{Authorization:`Bearer ${O}`}:{},X=`${g}${v}`;let te=await l(X,"GET",null,$);if(!te.status||!te.data||Array.isArray(te.data)&&te.data.length===0)try{const ie=`${B}${v}`,re=await l(ie,"GET",null,$);if(re.status){const z=Array.isArray(re.data)?re.data[0]:re.data;z&&z.code&&(v=z.code,k.value=v,te=await l(`${g}${v}`,"GET",null,$))}}catch(ie){console.warn("Failed to resolve layout code via datatable",ie)}if(te.status){p.value=Array.isArray(te.data)?te.data[0]:te.data;const ie={};if((I=p.value)!=null&&I.sections&&p.value.sections.forEach(re=>{((re.propsForm||re.props||{}).fields||re.fields||[]).forEach(H=>{var ae;const Y=H.model||((ae=H.props)==null?void 0:ae.model)||H.key;Y&&(ie[Y]=null)})}),m.value=ie,x.value=!1,f.value&&h.value){y.value=!0;try{const re=(W=(ne=(q=p.value.sections)==null?void 0:q[0])==null?void 0:ne.propsForm)==null?void 0:W.endpointForm,z=p.value.endpointForm,P=re||z;if(P!=null&&P.apiUrl){const H=P.apiUrl,Y=P.apiMethod||"GET",ae=P.keyParam||[],ye={};ae.length>0?ae.forEach(pe=>{ye[pe]=h.value}):ye.id=h.value;const xe=await c(H,Y,ye);if(xe.status){let pe=Array.isArray(xe.data)?xe.data[0]:xe.data;xe.payload&&(pe={...pe,...xe.payload}),m.value={...m.value,...pe}}}else if((U=p.value.endpointGlobal)!=null&&U.apiUrl){const H=p.value.endpointGlobal.apiUrl,Y=p.value.endpointGlobal.apiMethod||"GET",ae={id:h.value},ye=await c(H,Y,ae);if(ye.status){const xe=Array.isArray(ye.data)?ye.data[0]:ye.data;m.value={...m.value,...xe}}}else{const H=((ee=p.value.endpoint)==null?void 0:ee.detailUrl)||`/api/${k.value}/detail/${h.value}`,Y=await l(H,"GET");if(Y.status){let ae=Array.isArray(Y.data)?Y.data[0]:Y.data;if(Y.payload){const xe={...Y.payload};if(Object.keys(xe).forEach(pe=>{ae[pe]!==void 0&&ae[pe]!==null&&(xe[pe]=ae[pe])}),!("id"in xe)&&ae.id){const pe=Object.keys(xe).find(ke=>ke.startsWith("id")&&ke.length>2&&!xe[ke]);pe&&(xe[pe]=ae.id)}ae=xe}const ye={...ae};Object.keys(m.value).forEach(xe=>{if(ye[xe]===void 0||ye[xe]===null){if(xe.toLowerCase().startsWith("id")&&xe.length>2){const ke=xe.substring(2).toLowerCase(),Fe=Array.isArray(Y.data)?Y.data[0]:Y.data,Ze=Object.keys(Fe).find(it=>it.toLowerCase()===ke);Ze&&Fe[Ze]&&typeof Fe[Ze]=="object"&&"id"in Fe[Ze]&&(ye[xe]=Fe[Ze].id)}if(xe==="idSupervisor"){const ke=Array.isArray(Y.data)?Y.data[0]:Y.data;ke.supervisorId&&(ye[xe]=ke.supervisorId)}}}),m.value={...m.value,...ye}}}}catch(re){console.error("Failed to fetch record data:",re)}finally{y.value=!1}}}}catch(v){console.error("Failed to load form layout:",v),x.value=!1}},_=async I=>{var q,ne,W;try{const U=(W=(ne=(q=p.value.sections)==null?void 0:q[0])==null?void 0:ne.propsForm)==null?void 0:W.endpointForm,ee=p.value.endpointGlobal||p.value.endpoint,v=(U==null?void 0:U.submitUrl)||(ee==null?void 0:ee.submitUrl)||`/api/generic/${o.layoutCode}`,O=(U==null?void 0:U.submitMethod)||(ee==null?void 0:ee.submitMethod)||(f.value?"PUT":"POST"),$={...I};f.value&&h.value&&!$.id&&($.id=h.value),await l(v,O,$),a("submit-success",$),i.back()}catch(U){console.error("Submit failed:",U)}},w=async(I,q,ne)=>{if(I==="cancel"){b();return}const W=q.endpointPropAction||q.propsActionGlobal&&q.propsActionGlobal.endpointPropAction;if(W)try{x.value=!0;const U=ne?{...ne}:{...m.value};f.value&&q.model&&h.value&&(U[q.model]=h.value);const ee=W.apiUrl,v=W.apiMethod||"POST";(await c(ee,v,U)).status&&(a("action-success",I,q,U),i.back())}catch(U){console.error("Action failed:",U)}finally{x.value=!1}},b=()=>{a("cancel"),i.back()};return t.onMounted(()=>{E()}),t.onUnmounted(()=>{u("")}),(I,q)=>(t.openBlock(),t.createElementBlock("div",mS,[t.createElementVNode("div",pS,[t.createVNode(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[!x.value&&p.value?(t.openBlock(),t.createElementBlock("div",gS,[t.createElementVNode("div",bS,[t.createElementVNode("p",yS,t.toDisplayString(p.value.description),1)]),t.createVNode(dS,{schema:p.value,model:m.value,"is-edit-mode":f.value,loading:y.value,onSubmit:_,onCancel:b,onAction:w,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):x.value?(t.openBlock(),t.createElementBlock("div",xS,[t.createVNode(hS)])):(t.openBlock(),t.createElementBlock("div",kS," Failed to load form configuration for "+t.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-5ba0fa8c"]]),wS={class:"h-full flex flex-col"},CS={key:1,class:"flex-1 flex items-center justify-center"},BS={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ts=t.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(e,{emit:n}){var B,k,C,E,_,w;const o=e,a=n,r=t.getCurrentInstance(),{apiUrl:s}=qe();let i={query:{},params:{},path:""};try{const b=Mn.useRoute();b?i=b:(C=(k=(B=r==null?void 0:r.appContext)==null?void 0:B.config)==null?void 0:k.globalProperties)!=null&&C.$route&&(i=r.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:b=>{typeof window<"u"&&(typeof b=="string"?window.location.href=b:b&&b.path&&(window.location.href=b.path))}};try{const b=Mn.useRouter();b?l=b:(w=(_=(E=r==null?void 0:r.appContext)==null?void 0:E.config)==null?void 0:_.globalProperties)!=null&&w.$router&&(l=r.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=t.inject("hasActionAccess",()=>!1),d=t.inject("userPermissions",null),u=t.ref(null),f=t.ref(!0),h=t.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",p=t.computed(()=>`${m}${o.layoutCode}`),x=async()=>{var b;f.value=!0;try{const A="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=A?{Authorization:`Bearer ${A}`}:{},M=await s(p.value,"GET",null,D);M.status&&(u.value=Array.isArray(M.data)?M.data[0]:M.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),console.log("[DEBUG] actionGlobal in config:",(b=u.value)==null?void 0:b.actionGlobal))}catch(A){console.error("Gagal Menampilkan Datatable:",A)}finally{f.value=!1}},y=b=>{b.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",b.action,b)},g=b=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",b);let A=b.route;if(A||(A=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),A){const D=b.path?{code:b.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:A,query:D}),a("navigate",{route:A,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return t.onMounted(()=>{x()}),(b,A)=>(t.openBlock(),t.createElementBlock("div",wS,[!f.value&&u.value?(t.openBlock(),t.createBlock(Jn,{key:0,ref_key:"dtRef",ref:h,"api-url":p.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||t.unref(d),"permission-checker":t.unref(c),checkPermission:o.checkPermission,onAction:y,onNavigate:g},{"header-actions":t.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(t.openBlock(),t.createElementBlock("div",CS,[...A[1]||(A[1]=[t.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(t.openBlock(),t.createElementBlock("div",BS," Failed to load configuration for "+t.toDisplayString(o.layoutCode),1))]))}}),zd=t.defineCustomElement(vs),Fd=t.defineCustomElement(Ts);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",zd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Fd));const _S=[Wo,ii,Ye,Li,Kc,Gt,Jc,ds,Va,Mo,md,Da,pd,ps,gd,bs,Ma,ys,qn,xs,Na,bd,yd,ks,ws,Pa,va,Ta,Gn,Cd,Bd,Cs,Bs,_s,Jn,vs,Ts],Rd={install(e,n={}){n&&Object.keys(n).length>0&&Rs(n),_S.forEach(o=>{o.name&&e.component(o.name,o)})}};de.AutoLayoutDatatable=Ts,de.AutoLayoutForm=vs,de.DCodeAutoComplete=Wo,de.DCodeButton=Ye,de.DCodeCard=Li,de.DCodeCardCheckboxList=Jc,de.DCodeChart=Kc,de.DCodeCheckbox=Gt,de.DCodeCurrencyField=ds,de.DCodeDatePicker=Va,de.DCodeDialog=Mo,de.DCodeDialogCloseBtn=md,de.DCodeDropzone=Da,de.DCodeFileField=pd,de.DCodeFileResult=ps,de.DCodeIconDropdown=gd,de.DCodeImageCropperDialog=bs,de.DCodeImageField=Ma,de.DCodeImageResult=ys,de.DCodeInfiniteAutoComplete=ii,de.DCodeLabel=qn,de.DCodeMultiSelect=xs,de.DCodeOtpInput=Na,de.DCodePermissionMenu=Bs,de.DCodeProgress=bd,de.DCodeProgressBar=yd,de.DCodeRadio=ks,de.DCodeRadioCustom=ws,de.DCodeSlider=Pa,de.DCodeSwitch=va,de.DCodeTextField=Ta,de.DCodeTextarea=Gn,de.DCodeTimelineWithIcons=Cd,de.DCodeTreePermissions=_s,de.DCodeUploadFile=Bd,de.DCodeWizard=Cs,de.DataTable=Jn,de.DataTableComponent=Jn,de.DynamicUI=Rd,de.MicroDynamicDatatable=Fd,de.MicroDynamicForm=zd,de.cn=Ee,de.default=Rd,de.setApiConfig=Rs,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|