@gemafajarramadhan/dynamic-ui 1.2.44 → 1.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
- (function(he,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(he=typeof globalThis<"u"?globalThis:he||self,e(he.DynamicUI={},he.Vue,he.LucideIcons,he.rekaUi,he.core,he.VueI18n,he.VueDatePicker,he.Uppy,he.UppyDashboard,he.UppyImageEditor,he.VueRouter,he.Vue3Lottie))})(this,(function(he,e,ce,ke,Je,zt,iu,lu,Ks,cu,En,du){"use strict";var BA=Object.defineProperty;var _A=(he,e,ce)=>e in he?BA(he,e,{enumerable:!0,configurable:!0,writable:!0,value:ce}):he[e]=ce;var ye=(he,e,ce)=>_A(he,typeof e!="symbol"?e+"":e,ce);var aa;function uu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Nt=uu(ce);let Mt={};function Ys(t){Mt={...Mt,...t}}function fu(){return Mt}function hu(){return Mt.apiBaseUrl?Mt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function mu(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Mt.getAuthToken?n=Mt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Mt.getHeaders){const o=Mt.getHeaders();return{...t,...o}}return t}function pu(){Mt.onUnauthorized&&Mt.onUnauthorized()}async function Js(t,n,o,r){const a=fu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.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=hu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...mu(),...r||{}}};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 g=new URLSearchParams;Object.entries(o).forEach(([k,p])=>{p!=null&&g.append(k,String(p))});const y=g.toString();y&&(f=`${d}${d.includes("?")?"&":"?"}${y}`)}const h=await fetch(f,u);if(h.status===401&&pu(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function nt(){return{apiUrl:(o,r,a,s)=>Js(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),Js(i,l,c,s==null?void 0:s.headers)}}}const Wn=Math.min,xt=Math.max,qo=Math.round,Go=Math.floor,It=t=>({x:t,y:t}),gu={left:"right",right:"left",bottom:"top",top:"bottom"};function Qs(t,n,o){return xt(t,Wn(n,o))}function fo(t,n){return typeof t=="function"?t(n):t}function sn(t){return t.split("-")[0]}function ho(t){return t.split("-")[1]}function Zs(t){return t==="x"?"y":"x"}function ei(t){return t==="y"?"height":"width"}function Gt(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function ti(t){return Zs(Gt(t))}function bu(t,n,o){o===void 0&&(o=!1);const r=ho(t),a=ti(t),s=ei(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=Xo(i)),[i,Xo(i)]}function yu(t){const n=Xo(t);return[da(t),n,da(n)]}function da(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ni=["left","right"],oi=["right","left"],xu=["top","bottom"],ku=["bottom","top"];function wu(t,n,o){switch(t){case"top":case"bottom":return o?n?oi:ni:n?ni:oi;case"left":case"right":return n?xu:ku;default:return[]}}function Cu(t,n,o,r){const a=ho(t);let s=wu(sn(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(da)))),s}function Xo(t){const n=sn(t);return gu[n]+t.slice(n.length)}function Eu(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bu(t){return typeof t!="number"?Eu(t):{top:t,right:t,bottom:t,left:t}}function Ko(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function ri(t,n,o){let{reference:r,floating:a}=t;const s=Gt(n),i=ti(n),l=ei(i),c=sn(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(ho(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 _u(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=fo(n,t),g=Bu(m),k=l[h?f==="floating"?"reference":"floating":f],p=Ko(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(k)))==null||o?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},_=Ko(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:C,strategy:c}):E);return{top:(p.top-_.top+g.top)/w.y,bottom:(_.bottom-p.bottom+g.bottom)/w.y,left:(p.left-_.left+g.left)/w.x,right:(_.right-p.right+g.right)/w.x}}const Su=50,Au=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:_u},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=ri(d,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const k=s[y];if(!k)continue;const{name:p,fn:E}=k,{x:C,y:w,data:_,reset:B}=await E({x:u,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=C??u,f=w??f,g[p]={...g[p],..._},B&&m<Su&&(m++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:f}=ri(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:a,middlewareData:g}},Vu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...k}=fo(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=sn(a),E=Gt(l),C=sn(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=h||(C||!y?[Xo(l)]:yu(l)),B=g!=="none";!h&&B&&_.push(...Cu(l,y,g,w));const x=[l,..._],b=await c.detectOverflow(n,k),S=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&S.push(b[p]),f){const T=bu(a,i,w);S.push(b[T[0]],b[T[1]])}if(D=[...D,{placement:a,overflows:S}],!S.every(T=>T<=0)){var M,N;const T=(((M=s.flip)==null?void 0:M.index)||0)+1,K=x[T];if(K&&(!(f==="alignment"?E!==Gt(K):!1)||D.every(ee=>Gt(ee.placement)===E?ee.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:K}};let $=(N=D.filter(H=>H.overflows[0]<=0).sort((H,ee)=>H.overflows[1]-ee.overflows[1])[0])==null?void 0:N.placement;if(!$)switch(m){case"bestFit":{var P;const H=(P=D.filter(ee=>{if(B){const q=Gt(ee.placement);return q===E||q==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(q=>q>0).reduce((q,R)=>q+R,0)]).sort((ee,q)=>ee[1]-q[1])[0])==null?void 0:P[0];H&&($=H);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},Du=new Set(["left","top"]);async function Nu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=sn(o),l=ho(o),c=Gt(o)==="y",d=Du.has(i)?-1:1,u=s&&c?-1:1,f=fo(n,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Mu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await Nu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},vu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:E,y:C}=p;return{x:E,y:C}}},...d}=fo(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),h=Gt(sn(a)),m=Zs(h);let g=u[m],y=u[h];if(i){const p=m==="y"?"top":"left",E=m==="y"?"bottom":"right",C=g+f[p],w=g-f[E];g=Qs(C,g,w)}if(l){const p=h==="y"?"top":"left",E=h==="y"?"bottom":"right",C=y+f[p],w=y-f[E];y=Qs(C,y,w)}const k=c.fn({...n,[m]:g,[h]:y});return{...k,data:{x:k.x-o,y:k.y-r,enabled:{[m]:i,[h]:l}}}}}},Pu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=fo(t,n),u=await i.detectOverflow(n,d),f=sn(a),h=ho(a),m=Gt(a)==="y",{width:g,height:y}=s.floating;let k,p;f==="top"||f==="bottom"?(k=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,k=h==="end"?"top":"bottom");const E=y-u.top-u.bottom,C=g-u.left-u.right,w=Wn(y-u[k],E),_=Wn(g-u[p],C),B=!n.middlewareData.shift;let x=w,b=_;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=C),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(x=E),B&&!h){const D=xt(u.left,0),M=xt(u.right,0),N=xt(u.top,0),P=xt(u.bottom,0);m?b=g-2*(D!==0||M!==0?D+M:xt(u.left,u.right)):x=y-2*(N!==0||P!==0?N+P:xt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:x});const S=await i.getDimensions(l.floating);return g!==S.width||y!==S.height?{reset:{rects:!0}}:{}}}};function Yo(){return typeof window<"u"}function Bn(t){return ua(t)?(t.nodeName||"").toLowerCase():"#document"}function kt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Rt(t){var n;return(n=(ua(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function ua(t){return Yo()?t instanceof Node||t instanceof kt(t).Node:!1}function vt(t){return Yo()?t instanceof Element||t instanceof kt(t).Element:!1}function Xt(t){return Yo()?t instanceof HTMLElement||t instanceof kt(t).HTMLElement:!1}function ai(t){return!Yo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof kt(t).ShadowRoot}function mo(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Pt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Tu(t){return/^(table|td|th)$/.test(Bn(t))}function Jo(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Ou=/transform|translate|scale|rotate|perspective|filter/,Fu=/paint|layout|strict|content/,_n=t=>!!t&&t!=="none";let fa;function ha(t){const n=vt(t)?Pt(t):t;return _n(n.transform)||_n(n.translate)||_n(n.scale)||_n(n.rotate)||_n(n.perspective)||!ma()&&(_n(n.backdropFilter)||_n(n.filter))||Ou.test(n.willChange||"")||Fu.test(n.contain||"")}function zu(t){let n=ln(t);for(;Xt(n)&&!Un(n);){if(ha(n))return n;if(Jo(n))return null;n=ln(n)}return null}function ma(){return fa==null&&(fa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fa}function Un(t){return/^(html|body|#document)$/.test(Bn(t))}function Pt(t){return kt(t).getComputedStyle(t)}function Qo(t){return vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ln(t){if(Bn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||ai(t)&&t.host||Rt(t);return ai(n)?n.host:n}function si(t){const n=ln(t);return Un(n)?t.ownerDocument?t.ownerDocument.body:t.body:Xt(n)&&mo(n)?n:si(n)}function po(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=si(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=kt(a);if(s){const l=pa(i);return n.concat(i,i.visualViewport||[],mo(a)?a:[],l&&o?po(l):[])}else return n.concat(a,po(a,[],o))}function pa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ii(t){const n=Pt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Xt(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=qo(o)!==s||qo(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function ga(t){return vt(t)?t:t.contextElement}function Hn(t){const n=ga(t);if(!Xt(n))return It(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=ii(n);let i=(s?qo(o.width):o.width)/r,l=(s?qo(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Iu=It(0);function li(t){const n=kt(t);return!ma()||!n.visualViewport?Iu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ru(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==kt(t)?!1:n}function Sn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=ga(t);let i=It(1);n&&(r?vt(r)&&(i=Hn(r)):i=Hn(t));const l=Ru(s,o,r)?li(s):It(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const h=kt(s),m=r&&vt(r)?kt(r):r;let g=h,y=pa(g);for(;y&&r&&m!==g;){const k=Hn(y),p=y.getBoundingClientRect(),E=Pt(y),C=p.left+(y.clientLeft+parseFloat(E.paddingLeft))*k.x,w=p.top+(y.clientTop+parseFloat(E.paddingTop))*k.y;c*=k.x,d*=k.y,u*=k.x,f*=k.y,c+=C,d+=w,g=kt(y),y=pa(g)}}return Ko({width:u,height:f,x:c,y:d})}function Zo(t,n){const o=Qo(t).scrollLeft;return n?n.left+o:Sn(Rt(t)).left+o}function ci(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-Zo(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Lu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Rt(r),l=n?Jo(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=It(1);const u=It(0),f=Xt(r);if((f||!f&&!s)&&((Bn(r)!=="body"||mo(i))&&(c=Qo(r)),f)){const m=Sn(r);d=Hn(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const h=i&&!f&&!s?ci(i,c):It(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 $u(t){return Array.from(t.getClientRects())}function ju(t){const n=Rt(t),o=Qo(t),r=t.ownerDocument.body,a=xt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=xt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+Zo(t);const l=-o.scrollTop;return Pt(r).direction==="rtl"&&(i+=xt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const di=25;function Wu(t,n){const o=kt(t),r=Rt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=ma();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Zo(r);if(d<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=di&&(s-=g)}else d<=di&&(s+=d);return{width:s,height:i,x:l,y:c}}function Uu(t,n){const o=Sn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=Xt(t)?Hn(t):It(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function ui(t,n,o){let r;if(n==="viewport")r=Wu(t,o);else if(n==="document")r=ju(Rt(t));else if(vt(n))r=Uu(n,o);else{const a=li(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Ko(r)}function fi(t,n){const o=ln(t);return o===n||!vt(o)||Un(o)?!1:Pt(o).position==="fixed"||fi(o,n)}function Hu(t,n){const o=n.get(t);if(o)return o;let r=po(t,[],!1).filter(l=>vt(l)&&Bn(l)!=="body"),a=null;const s=Pt(t).position==="fixed";let i=s?ln(t):t;for(;vt(i)&&!Un(i);){const l=Pt(i),c=ha(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||mo(i)&&!c&&fi(t,i))?r=r.filter(u=>u!==i):a=l,i=ln(i)}return n.set(t,r),r}function qu(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?Jo(n)?[]:Hu(n,this._c):[].concat(o),r],l=ui(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=ui(n,i[h],a);c=xt(m.top,c),d=Wn(m.right,d),u=Wn(m.bottom,u),f=xt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Gu(t){const{width:n,height:o}=ii(t);return{width:n,height:o}}function Xu(t,n,o){const r=Xt(n),a=Rt(n),s=o==="fixed",i=Sn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=It(0);function d(){c.x=Zo(a)}if(r||!r&&!s)if((Bn(n)!=="body"||mo(a))&&(l=Qo(n)),r){const m=Sn(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?ci(a,l):It(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 ba(t){return Pt(t).position==="static"}function hi(t,n){if(!Xt(t)||Pt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Rt(t)===o&&(o=o.ownerDocument.body),o}function mi(t,n){const o=kt(t);if(Jo(t))return o;if(!Xt(t)){let a=ln(t);for(;a&&!Un(a);){if(vt(a)&&!ba(a))return a;a=ln(a)}return o}let r=hi(t,n);for(;r&&Tu(r)&&ba(r);)r=hi(r,n);return r&&Un(r)&&ba(r)&&!ha(r)?o:r||zu(t)||o}const Ku=async function(t){const n=this.getOffsetParent||mi,o=this.getDimensions,r=await o(t.floating);return{reference:Xu(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yu(t){return Pt(t).direction==="rtl"}const Ju={convertOffsetParentRelativeRectToViewportRelativeRect:Lu,getDocumentElement:Rt,getClippingRect:qu,getOffsetParent:mi,getElementRects:Ku,getClientRects:$u,getDimensions:Gu,getScale:Hn,isElement:vt,isRTL:Yu};function pi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Qu(t,n){let o=null,r;const a=Rt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||n(),!h||!m)return;const g=Go(f),y=Go(a.clientWidth-(u+h)),k=Go(a.clientHeight-(f+m)),p=Go(u),C={rootMargin:-g+"px "+-y+"px "+-k+"px "+-p+"px",threshold:xt(0,Wn(1,c))||1};let w=!0;function _(B){const x=B[0].intersectionRatio;if(x!==c){if(!w)return i();x?i(!1,x):r=setTimeout(()=>{i(!1,1e-7)},1e3)}x===1&&!pi(d,t.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(_,{...C,root:a.ownerDocument})}catch{o=new IntersectionObserver(_,C)}o.observe(t)}return i(!0),s}function ya(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=ga(t),u=a||s?[...d?po(d):[],...n?po(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?Qu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[E]=p;E&&E.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,y=c?Sn(t):null;c&&k();function k(){const p=Sn(t);y&&!pi(y,p)&&o(),y=p,g=requestAnimationFrame(k)}return o(),()=>{var p;u.forEach(E=>{a&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const xa=Mu,ka=vu,wa=Vu,Ca=Pu,Zu=(t,n,o)=>{const r=new Map,a={platform:Ju,...o},s={...a.platform,_c:r};return Au(t,n,{...a,platform:s})};function ef(t){return t!=null&&typeof t=="object"&&"$el"in t}function gi(t){if(ef(t)){const n=t.$el;return ua(n)&&Bn(n)==="#comment"?null:n}return t}function go(t){return typeof t=="function"?t():e.unref(t)}function bi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function yi(t,n){const o=bi(t);return Math.round(n*o)/o}function Ea(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var x;return(x=go(o.open))!=null?x:!0}),s=e.computed(()=>go(o.middleware)),i=e.computed(()=>{var x;return(x=go(o.placement))!=null?x:"bottom"}),l=e.computed(()=>{var x;return(x=go(o.strategy))!=null?x:"absolute"}),c=e.computed(()=>{var x;return(x=go(o.transform))!=null?x:!0}),d=e.computed(()=>gi(t.value)),u=e.computed(()=>gi(n.value)),f=e.ref(0),h=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),y=e.shallowRef({}),k=e.ref(!1),p=e.computed(()=>{const x={position:m.value,left:"0",top:"0"};if(!u.value)return x;const b=yi(u.value,f.value),S=yi(u.value,h.value);return c.value?{...x,transform:"translate("+b+"px, "+S+"px)",...bi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:S+"px"}});let E;function C(){if(d.value==null||u.value==null)return;const x=a.value;Zu(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,g.value=b.placement,y.value=b.middlewareData,k.value=x!==!1})}function w(){typeof E=="function"&&(E(),E=void 0)}function _(){if(w(),r===void 0){C();return}if(d.value!=null&&u.value!=null){E=r(d.value,u.value,C);return}}function B(){a.value||(k.value=!1)}return e.watch([s,i,l,a],C,{flush:"sync"}),e.watch([d,u],_,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(w),{x:e.shallowReadonly(f),y:e.shallowReadonly(h),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(y),isPositioned:e.shallowReadonly(k),floatingStyles:p,update:C}}const tf=["aria-busy"],nf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},of=["for"],rf={key:0,class:"ml-1 text-destructive"},af={class:"relative"},sf={key:0,class:"flex items-center text-gray-500 gap-2"},lf=["id","placeholder","disabled","readonly","value"],cf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},df=["disabled"],uf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},ff=["onMouseenter","onClick"],hf={key:0},mf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},pf={key:0},gf={key:1},bf={key:2},yf={key:1,class:"mt-1 text-xs text-red-600"},er=e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=A=>{const F=a[A];return F===""||F===!0||F==="true"||F===1||F==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),h=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>f.value||i("aria-required")),y=e.computed(()=>o.error||o.errorMessage||a["error-message"]),k=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const A=a.minChars??a["min-chars"];if(A==null||A==="")return 0;const F=typeof A=="number"?A:Number.parseInt(String(A),10);return Number.isFinite(F)&&F>0?F:0}),E=e.computed(()=>{const A=a.rules;return Array.isArray(A)?A:[]}),C=e.computed(()=>{const A=a.id||a.label;return A?`app-autocomplete-${A}-${Math.random().toString(36).slice(2,7)}`:void 0}),w=e.ref(o.modelValue),_=e.ref([]),B=e.ref(!1),x=e.ref(!1),b=e.computed(()=>a.items),S=e.computed(()=>{const A=T.value;return A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems?_.value:b.value??[]}),D=e.computed(()=>!!a.loading),M=e.computed(()=>D.value||B.value),N=e.computed(()=>{const{label:A,items:F,loading:G,rules:se,"item-title":ie,"item-value":v,itemTitle:Y,itemValue:te,minChars:de,"min-chars":fe,clearable:Se,required:Pe,"aria-required":et,disabled:xe,readonly:rt,visible:Ue,"return-object":Ve,returnObject:gt,class:Bt,"fetch-items":_t,fetchItems:Ft,error:Qe,errorMessage:wn,"error-message":Ho,...$n}=a||{};return $n}),P=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=e.computed(()=>{const A=o.endpoint||{};return{apiModule:o.apiModule||A.apiModule,apiAction:o.apiAction||A.apiAction,apiUrl:A.apiUrl,apiMethod:A.apiMethod||"GET"}}),K=e.ref(null),$=e.ref(null),H=e.ref(null),{floatingStyles:ee}=Ea($,H,{placement:"bottom-start",whileElementsMounted:ya,middleware:[xa(4),wa(),ka(),Ca({apply({rects:A,elements:F,availableHeight:G}){Object.assign(F.floating.style,{width:`${A.reference.width}px`,maxHeight:`${G}px`})}})]}),q=e.ref(!1),R=e.ref(""),j=e.ref(-1),ae=e.ref(null),Z=e.computed(()=>!p.value||(R.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),J=A=>{if(A==null)return"";if(typeof A=="string"||typeof A=="number")return String(A);const F=c.value;return typeof F=="function"?F(A):(A==null?void 0:A[F])??(A==null?void 0:A.name)??(A==null?void 0:A.nama)??(A==null?void 0:A.label)??(A==null?void 0:A.title)??"-"},le=A=>{if(A==null)return null;if(typeof A=="string"||typeof A=="number")return A;const F=d.value;return typeof F=="function"?F(A):(A==null?void 0:A[F])??(A==null?void 0:A.id)??(A==null?void 0:A.value)??(A==null?void 0:A.code)??null},ue=e.computed(()=>{const A=w.value;if(A==null||A==="")return"";if(Array.isArray(A))return A.length?A.map(se=>{if(m.value&&typeof se=="object"||typeof se=="object")return J(se);const ie=S.value.find(v=>le(v)==se);return ie?J(ie):String(se)}).join(", "):"";if(typeof A=="object")return J(A);const F=S.value.find(G=>le(G)==A);return F?J(F):String(A)}),Ce=e.computed(()=>{const A=S.value||[],F=(R.value||"").trim().toLowerCase(),G=(ue.value||"").toLowerCase(),se=!F||F===G;let ie=A;if(se||(ie=A.filter(v=>J(v).toLowerCase().includes(F))),ie.length>0){const v=Y=>{const te=le(Y);return Array.isArray(w.value)?w.value.some(de=>de==te):w.value==te};ie=[...ie].sort((Y,te)=>{const de=v(Y),fe=v(te);return de&&!fe?-1:!de&&fe?1:0})}return ie}),Be=A=>Array.isArray(A)?A.length===0:A==null||A==="",me=A=>{if(ae.value=null,f.value&&Be(A)&&!E.value.length)return ae.value="This field is required",!1;for(const F of E.value){const G=F(A);if(G===!1)return ae.value="Invalid value",!1;if(typeof G=="string")return ae.value=G,!1}return!0},Q=async()=>{if(u.value||h.value)return;q.value=!0,j.value=Ce.value.length?0:-1,R.value=ue.value||"";const A=T.value,F=A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems;o.autoFetchOnOpen&&F&&!x.value&&(await Re(),j.value=Ce.value.length?0:-1)},O=()=>{q.value=!1,j.value=-1,R.value=ue.value||""},X=A=>{const F=m.value?A:le(A);let G=F;Array.isArray(w.value)&&(G=[F]),w.value=G,r("update:modelValue",G),ae.value=null,me(G),R.value=J(A),O()},re=()=>{_.value=[],x.value=!1,w.value=Array.isArray(w.value)?[]:null,r("update:modelValue",w.value),R.value="",ae.value=null},be=()=>{l.value=!0,re(),O(),setTimeout(()=>{l.value=!1},0)},Ee=A=>{if(u.value||h.value)return;const F=A.target.value;R.value=F,ae.value&&(ae.value=null),q.value||(q.value=!0),j.value=Ce.value.length?0:-1;const G=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&G&&!M.value&&!x.value&&Re()},Fe=A=>{var G;if(u.value||h.value)return;const F={ArrowDown:()=>{if(A.preventDefault(),!q.value){Q();return}Ce.value.length&&(j.value=Math.min(j.value+1,Ce.value.length-1))},ArrowUp:()=>{!q.value||!Ce.value.length||(A.preventDefault(),j.value=Math.max(j.value-1,0))},Enter:()=>{if(!q.value)return;A.preventDefault();const se=Ce.value[j.value];se&&X(se)},Escape:()=>{A.preventDefault(),O()},Tab:()=>{O()}};(G=F[A.key])==null||G.call(F)},Re=async()=>{const A=T.value;if(A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems){B.value=!0;try{let G;if(o.fetchItems){const se=P()||{},ie={page:1,perPage:100,search:(R.value||"").trim(),...se,...o.apiParams},v=await o.fetchItems(ie),Y=(v==null?void 0:v.data)??v;G=(Y==null?void 0:Y.data)??Y}else{const ie=nt().DCodeApi;if(typeof ie!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const Y={page:1,perPage:100,...P()||{},...o.apiParams};let te;A.apiUrl?te=await ie("","",Y,{_url:A.apiUrl,_method:A.apiMethod||"POST"}):te=await ie(A.apiModule,A.apiAction,Y);const de=(te==null?void 0:te.data)??te;G=(de==null?void 0:de.data)??de}_.value=Array.isArray(G)?G:[],x.value=!0}catch(G){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",G),ae.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(G==null?void 0:G.message)||(G==null?void 0:G.toString())||"Failed to load options"}`,_.value=[],x.value=!0}finally{B.value=!1}}},Ye=A=>{const F=le(A);return m.value?w.value?Array.isArray(w.value)?w.value.some(G=>le(G)==F):le(w.value)==F:!1:Array.isArray(w.value)?w.value.some(G=>G==F):w.value==F};e.watch(()=>[P(),T.value,o.apiParams],([A,F,G],[se,ie,v])=>{const Y=T.value;if(!(Y.apiModule&&Y.apiAction||Y.apiUrl||o.fetchItems)){re();return}const de=JSON.stringify(A??null)===JSON.stringify(se??null),fe=JSON.stringify(G??null)===JSON.stringify(v??null);de&&fe||(re(),fe||Re())},{deep:!0}),e.watch(()=>o.modelValue,(A,F)=>{w.value=A,!l.value&&(A==null||A==="")&&F!=null&&o.apiModule&&o.apiAction&&(_.value=[],x.value=!1),R.value=ue.value||""},{immediate:!0});const Ne=T.value;(Ne.apiModule&&Ne.apiAction||Ne.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!Be(o.modelValue))&&Re();const dt=A=>{const F=K.value,G=H.value,se=A.target;F&&F.contains(se)||G&&G.contains(se)||q.value&&O()},I=e.computed(()=>{const A=o.modelValue;return A==null?!1:typeof A=="string"?A.trim().length>0:Array.isArray(A)?A.length>0:typeof A=="object"?Object.keys(A).length>0:!0}),U=e.computed(()=>!!o.clearable&&I.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",dt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",dt)}),(A,F)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:K,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",nf)):e.createCommentVNode("",!0),F[6]||(F[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:C.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",rf,"*")):e.createCommentVNode("",!0)],8,of)):e.createCommentVNode("",!0),e.createElementVNode("div",af,[e.createElementVNode("div",{ref_key:"reference",ref:$,class:e.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":"",ae.value||y.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||A.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",sf,[e.renderSlot(A.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(N.value,{id:C.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:k.value,disabled:u.value,readonly:h.value,value:q.value?R.value:ue.value||R.value,onFocus:F[0]||(F[0]=()=>{q.value||Q()}),onClick:F[1]||(F[1]=()=>{q.value||Q()}),onInput:Ee,onKeydown:Fe,onBlur:F[2]||(F[2]=()=>me(w.value))}),null,16,lf),M.value?(e.openBlock(),e.createElementBlock("svg",cf,[...F[7]||(F[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):U.value?(e.openBlock(),e.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:F[3]||(F[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(be,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.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:F[4]||(F[4]=G=>q.value?O():Q()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":q.value}])},null,8,["class"])],8,df))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:H,style:e.normalizeStyle(e.unref(ee)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[e.createElementVNode("div",uf,[Ce.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ce.value,(G,se)=>(e.openBlock(),e.createElementBlock("button",{key:le(G)??se,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",se===j.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ie=>j.value=se,onMousedown:F[5]||(F[5]=e.withModifiers(()=>{},["prevent"])),onClick:ie=>X(G)},[e.createTextVNode(e.toDisplayString(J(G))+" ",1),Ye(G)?(e.openBlock(),e.createElementBlock("span",hf," ✓ ")):e.createCommentVNode("",!0)],42,ff))),128)):e.renderSlot(A.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",mf,[M.value?(e.openBlock(),e.createElementBlock("span",pf,"Loading data…")):Z.value?(e.openBlock(),e.createElementBlock("span",gf,e.toDisplayString(Z.value),1)):(e.openBlock(),e.createElementBlock("span",bf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),ae.value||y.value?(e.openBlock(),e.createElementBlock("p",yf,e.toDisplayString(ae.value||y.value),1)):e.createCommentVNode("",!0)],64))],10,tf)),[[e.vShow,t.visible]])}}),xf=["aria-busy"],kf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},wf=["for"],Cf={key:0,class:"ml-1 text-destructive"},Ef={class:"relative"},Bf={key:0,class:"flex items-center text-gray-500 gap-2"},_f=["id","placeholder","disabled","value"],Sf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Af=["disabled"],Vf={key:0,class:"p-3 space-y-2"},Df=["onMouseenter","onClick"],Nf={class:"flex items-center space-x-3"},Mf={class:"flex-1"},vf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Pf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Tf={key:0},Of={key:2,class:"p-3 text-center"},Ff={class:"inline-flex items-center space-x-2"},zf={class:"text-sm text-gray-500"},If={key:3,class:"p-3 text-center"},Rf={class:"text-xs text-gray-400"},Lf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},$f={key:1,class:"mt-1 text-xs text-red-600"},jf={key:2,class:"mt-1 text-xs text-gray-500"},xi=e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const j=o.label||o.placeholder;return j?`app-infinite-autocomplete-${j}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),h=e.ref([]),m=e.ref(!1),g=e.ref(!1),y=e.ref(-1),k=e.ref(1),p=e.ref(!0),E=e.ref(0),C=e.ref(),{floatingStyles:w}=Ea(c,d,{placement:"bottom-start",whileElementsMounted:ya,middleware:[xa(4),wa(),ka(),Ca({apply({rects:j,elements:ae}){Object.assign(ae.floating.style,{width:`${j.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const _=e.computed(()=>f.value?h.value.filter(j=>S(j).toLowerCase().includes(f.value.toLowerCase())):h.value),B=e.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return S(o.modelValue);{const j=h.value.find(ae=>D(ae)===o.modelValue);return j?S(j):String(o.modelValue)}}return""}),x=()=>{g.value=!0},b=()=>{g.value=!1},S=j=>typeof o.itemTitle=="function"?o.itemTitle(j):j[o.itemTitle]||"",D=j=>typeof o.itemValue=="function"?o.itemValue(j):j[o.itemValue]||j,M=j=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(j):j[o.itemSubtitle]||"":"",N=j=>o.modelValue?o.returnObject?D(j)===D(o.modelValue):D(j)===o.modelValue:!1,P=j=>{var Z;const ae=o.returnObject?j:D(j);r("update:modelValue",ae),r("select",j),g.value=!1,f.value="",(Z=s.value)==null||Z.blur()},T=()=>{var j;r("update:modelValue",null),f.value="",(j=s.value)==null||j.focus()},K=j=>{g.value=!0,r("focus",j),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&R(!0)},$=j=>{setTimeout(()=>{g.value=!1,r("blur",j)},200)},H=j=>{const ae=j.target;f.value=ae.value,C.value&&clearTimeout(C.value),C.value=setTimeout(()=>{r("search",f.value),k.value=1,p.value=!0,R(!0)},o.debounceMs)},ee=j=>{if(g.value)switch(j.key){case"ArrowDown":j.preventDefault(),y.value=Math.min(y.value+1,_.value.length-1);break;case"ArrowUp":j.preventDefault(),y.value=Math.max(y.value-1,0);break;case"Enter":j.preventDefault(),y.value>=0&&_.value[y.value]&&P(_.value[y.value]);break;case"Escape":g.value=!1;break}},q=j=>{if(!p.value||m.value)return;const ae=j.target,{scrollTop:Z,scrollHeight:J,clientHeight:le}=ae;Z+le>=J-o.threshold&&R()},R=async(j=!1)=>{var ae,Z;if(!m.value){m.value=!0;try{let J=[];if(o.fetchItems)J=await o.fetchItems();else{const le=nt(),ue=((ae=o.endpoint)==null?void 0:ae.apiModule)||o.apiModule,Ce=((Z=o.endpoint)==null?void 0:Z.apiAction)||o.apiAction;if(!ue||!Ce)throw new Error("API module and action are required");const Be={page:j?1:k.value,pageSize:o.pageSize,search:f.value,...o.apiParams},me=await le.apiUrl(`/${ue}/${Ce}`,"GET",Be);J=me.data||me.items||me||[],E.value=me.total||me.totalItems||J.length}j?(h.value=J,k.value=1):(h.value.push(...J),k.value++),p.value=J.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:J,page:k.value,hasMore:p.value,total:E.value})}catch(J){console.error("Error fetching items:",J),r("error",J)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&R()}),e.onUnmounted(()=>{C.value&&clearTimeout(C.value)}),e.watch(()=>o.modelValue,j=>{j||(f.value="")}),(j,ae)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",kf)):e.createCommentVNode("",!0),ae[3]||(ae[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Cf,"*")):e.createCommentVNode("",!0)],8,wf)):e.createCommentVNode("",!0),e.createElementVNode("div",Ef,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.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",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Bf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},j.$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",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:B.value,onFocus:K,onBlur:$,onInput:H,onKeydown:ee}),null,16,_f),m.value?(e.openBlock(),e.createElementBlock("svg",Sf,[...ae[4]||(ae[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.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:ae[0]||(ae[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.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:t.disabled,onClick:ae[1]||(ae[1]=Z=>g.value?b():x()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,Af))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(w)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:q},[m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Vf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Z=>e.createElementVNode("div",{key:Z,class:"flex items-center space-x-3"},[...ae[5]||(ae[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):_.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,(Z,J)=>(e.openBlock(),e.createElementBlock("button",{key:D(Z)??J,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",J===y.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:le=>y.value=J,onMousedown:ae[2]||(ae[2]=e.withModifiers(()=>{},["prevent"])),onClick:le=>P(Z)},[e.renderSlot(j.$slots,"item",{item:Z,index:J},()=>[e.createElementVNode("div",Nf,[e.createElementVNode("div",Mf,[e.createElementVNode("div",vf,e.toDisplayString(S(Z)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Pf,e.toDisplayString(M(Z)),1)):e.createCommentVNode("",!0)])])]),N(Z)?(e.openBlock(),e.createElementBlock("span",Tf," ✓ ")):e.createCommentVNode("",!0)],42,Df))),128)):e.createCommentVNode("",!0),m.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",Of,[e.createElementVNode("div",Ff,[ae[6]||(ae[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",zf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",If,[e.createElementVNode("div",Rf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Lf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",$f,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",jf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,xf)),[[e.vShow,t.visible]])}});function ki(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=ki(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function wi(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=ki(t))&&(r&&(r+=" "),r+=n);return r}const Wf=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},Uf=(t,n)=>({classGroupId:t,validator:n}),Ci=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),tr="-",Ei=[],Hf="arbitrary..",qf=t=>{const n=Xf(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Gf(i);const l=i.split(tr),c=l[0]===""&&l.length>1?1:0;return Bi(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?Wf(d,c):c:d||Ei}return o[i]||Ei}}},Bi=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=Bi(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(tr):t.slice(n).join(tr),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Gf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?Hf+r:void 0})(),Xf=t=>{const{theme:n,classGroups:o}=t;return Kf(o,n)},Kf=(t,n)=>{const o=Ci();for(const r in t){const a=t[r];Ba(a,o,r,n)}return o},Ba=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];Yf(i,n,o,r)}},Yf=(t,n,o,r)=>{if(typeof t=="string"){Jf(t,n,o);return}if(typeof t=="function"){Qf(t,n,o,r);return}Zf(t,n,o,r)},Jf=(t,n,o)=>{const r=t===""?n:_i(n,t);r.classGroupId=o},Qf=(t,n,o,r)=>{if(eh(t)){Ba(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Uf(o,t))},Zf=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];Ba(c,_i(n,l),o,r)}},_i=(t,n)=>{let o=t;const r=n.split(tr),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Ci(),o.nextPart.set(i,l)),o=l}return o},eh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,th=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},_a="!",Si=":",nh=[],Ai=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),oh=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let y=0;y<u;y++){const k=a[y];if(i===0&&l===0){if(k===Si){s.push(a.slice(c,y)),c=y+1;continue}if(k==="/"){d=y;continue}}k==="["?i++:k==="]"?i--:k==="("?l++:k===")"&&l--}const f=s.length===0?a:a.slice(c);let h=f,m=!1;f.endsWith(_a)?(h=f.slice(0,-1),m=!0):f.startsWith(_a)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Ai(s,m,h,g)};if(n){const a=n+Si,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Ai(nh,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},rh=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},ah=t=>({cache:th(t.cacheSize),parseClassName:oh(t),sortModifiers:rh(t),...qf(t)}),sh=/\s+/,ih=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(sh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let k=!!y,p=r(k?g.substring(0,y):g);if(!p){if(!k){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}k=!1}const E=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=m?E+_a:E,w=C+p;if(i.indexOf(w)>-1)continue;i.push(w);const _=a(p,k);for(let B=0;B<_.length;++B){const x=_[B];i.push(C+x)}c=u+(c.length>0?" "+c:c)}return c},lh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=Vi(o))&&(a&&(a+=" "),a+=r);return a},Vi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=Vi(t[r]))&&(o&&(o+=" "),o+=n);return o},ch=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=ah(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=ih(c,o);return a(c,u),u};return s=i,(...c)=>s(lh(...c))},dh=[],at=t=>{const n=o=>o[t]||dh;return n.isThemeGetter=!0,n},Di=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ni=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hh=/\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$/,mh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ph=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cn=t=>uh.test(t),De=t=>!!t&&!Number.isNaN(Number(t)),dn=t=>!!t&&Number.isInteger(Number(t)),Sa=t=>t.endsWith("%")&&De(t.slice(0,-1)),Kt=t=>fh.test(t),Mi=()=>!0,bh=t=>hh.test(t)&&!mh.test(t),Aa=()=>!1,yh=t=>ph.test(t),xh=t=>gh.test(t),kh=t=>!pe(t)&&!ge(t),wh=t=>un(t,zi,Aa),pe=t=>Di.test(t),An=t=>un(t,Ii,bh),vi=t=>un(t,Dh,De),Ch=t=>un(t,Li,Mi),Eh=t=>un(t,Ri,Aa),Pi=t=>un(t,Oi,Aa),Bh=t=>un(t,Fi,xh),nr=t=>un(t,$i,yh),ge=t=>Ni.test(t),bo=t=>Vn(t,Ii),_h=t=>Vn(t,Ri),Ti=t=>Vn(t,Oi),Sh=t=>Vn(t,zi),Ah=t=>Vn(t,Fi),or=t=>Vn(t,$i,!0),Vh=t=>Vn(t,Li,!0),un=(t,n,o)=>{const r=Di.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},Vn=(t,n,o=!1)=>{const r=Ni.exec(t);return r?r[1]?n(r[1]):o:!1},Oi=t=>t==="position"||t==="percentage",Fi=t=>t==="image"||t==="url",zi=t=>t==="length"||t==="size"||t==="bg-size",Ii=t=>t==="length",Dh=t=>t==="number",Ri=t=>t==="family-name",Li=t=>t==="number"||t==="weight",$i=t=>t==="shadow",Nh=ch(()=>{const t=at("color"),n=at("font"),o=at("text"),r=at("font-weight"),a=at("tracking"),s=at("leading"),i=at("breakpoint"),l=at("container"),c=at("spacing"),d=at("radius"),u=at("shadow"),f=at("inset-shadow"),h=at("text-shadow"),m=at("drop-shadow"),g=at("blur"),y=at("perspective"),k=at("aspect"),p=at("ease"),E=at("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...w(),ge,pe],B=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],b=()=>[ge,pe,c],S=()=>[cn,"full","auto",...b()],D=()=>[dn,"none","subgrid",ge,pe],M=()=>["auto",{span:["full",dn,ge,pe]},dn,ge,pe],N=()=>[dn,"auto",ge,pe],P=()=>["auto","min","max","fr",ge,pe],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...b()],H=()=>[cn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],ee=()=>[cn,"screen","full","dvw","lvw","svw","min","max","fit",...b()],q=()=>[cn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],R=()=>[t,ge,pe],j=()=>[...w(),Ti,Pi,{position:[ge,pe]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Sh,wh,{size:[ge,pe]}],J=()=>[Sa,bo,An],le=()=>["","none","full",d,ge,pe],ue=()=>["",De,bo,An],Ce=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[De,Sa,Ti,Pi],Q=()=>["","none",g,ge,pe],O=()=>["none",De,ge,pe],X=()=>["none",De,ge,pe],re=()=>[De,ge,pe],be=()=>[cn,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kt],breakpoint:[Kt],color:[Mi],container:[Kt],"drop-shadow":[Kt],ease:["in","out","in-out"],font:[kh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kt],shadow:[Kt],spacing:["px",De],text:[Kt],"text-shadow":[Kt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cn,pe,ge,k]}],container:["container"],columns:[{columns:[De,pe,ge,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:_()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{"inset-s":S(),start:S()}],end:[{"inset-e":S(),end:S()}],"inset-bs":[{"inset-bs":S()}],"inset-be":[{"inset-be":S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[dn,"auto",ge,pe]}],basis:[{basis:[cn,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,cn,"auto","initial","none",pe]}],grow:[{grow:["",De,ge,pe]}],shrink:[{shrink:["",De,ge,pe]}],order:[{order:[dn,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],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:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[l,"screen",...H()]}],"min-w":[{"min-w":[l,"screen","none",...H()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",o,bo,An]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Vh,Ch]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sa,pe]}],"font-family":[{font:[_h,Eh,n]}],"font-features":[{"font-features":[pe]}],"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:[a,ge,pe]}],"line-clamp":[{"line-clamp":[De,"none",ge,vi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ge,An]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[De,"auto",ge,pe]}],"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",ge,pe]}],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",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dn,ge,pe],radial:["",ge,pe],conic:[dn,ge,pe]},Ah,Bh]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ge,pe]}],"outline-w":[{outline:["",De,bo,An]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,or,nr]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",f,or,nr]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[De,An]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",h,or,nr]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[De,ge,pe]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:Q()}],brightness:[{brightness:[De,ge,pe]}],contrast:[{contrast:[De,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",m,or,nr]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",De,ge,pe]}],"hue-rotate":[{"hue-rotate":[De,ge,pe]}],invert:[{invert:["",De,ge,pe]}],saturate:[{saturate:[De,ge,pe]}],sepia:[{sepia:["",De,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[De,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[De,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",De,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[De,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[De,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ge,pe]}],"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",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ge,pe]}],ease:[{ease:["linear","initial",p,ge,pe]}],delay:[{delay:[De,ge,pe]}],animate:[{animate:["none",E,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,ge,pe]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",ge,pe]}],"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",ge,pe]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[De,bo,An,vi]}],stroke:[{stroke:["none",...R()]}],"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 ve(...t){return Nh(wi(t))}function ji(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Va={},Da={},rr={exports:{}},Wi;function Mh(){if(Wi)return rr.exports;Wi=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return rr.exports=n(),rr.exports.createColors=n,rr.exports}var Ui;function vh(){return Ui||(Ui=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(Mh());function a(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 r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(Da)),Da}var Hi;function Ph(){return Hi||(Hi=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(vh());function o(s){return s&&s.__esModule?s:{default:s}}function r({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 a={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 r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Va)),Va}var Na,qi;function Th(){if(qi)return Na;qi=1;let t=Ph();return Na=(t.__esModule?t:{default:t}).default,Na}var Oh=Th();const Fh=ji(Oh),Gi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Xi=wi,Ma=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return Xi(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Gi(u)||Gi(f);return a[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||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[y,k]=g;return Array.isArray(k)?k.includes({...s,...l}[y]):{...s,...l}[y]===k})?[...d,f,h]:d},[]);return Xi(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Tt=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(ve)(e.unref(qn)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),qn=Ma("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"}}),Ki=e.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(t,{emit:n}){const o=t,r=n,a=ke.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(ke.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Yi=e.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(t,{emit:n}){const o=t,r=n,a=Je.reactiveOmit(o,"class"),s=ke.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(ke.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ke.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("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:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Ji=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Qi=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),zh={class:"relative z-10"},Ih="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",Rh=e.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(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Nt[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Z=String(o.variant||"default").toLowerCase();return Z==="tonal"?"secondary":Z==="elevated"?"default":Z}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Z,...J}=n;return J}),u=e.computed(()=>ve(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=e.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}`:""),y=e.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"),k=e.computed(()=>ve("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=e.computed(()=>{const J=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),E=e.computed(()=>{const J=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),C=e.computed(()=>!!p.value),w=e.computed(()=>/\bborder-/.test(u.value??"")),_=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const Z=u.value??"";return i.value!=="outline"?Z:Z.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),x=e.ref(null),b=Z=>{const J=Z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return J?{r:Number(J[1]),g:Number(J[2]),b:Number(J[3]),a:J[4]?Number(J[4]):1}:null},S=(Z,J)=>{const le=b(Z);if(!le)return Z;const ue=Ce=>Math.max(0,Math.min(255,Math.round(Ce)));return`rgba(${ue(le.r*(1-J))}, ${ue(le.g*(1-J))}, ${ue(le.b*(1-J))}, ${le.a})`},D=Z=>{if(globalThis.window===void 0)return null;const J=document.createElement("div");J.className=Z,J.style.position="absolute",J.style.visibility="hidden",J.style.pointerEvents="none",J.style.width="1px",J.style.height="1px",document.body.appendChild(J);const le=globalThis.getComputedStyle(J).backgroundColor;return J.remove(),!le||le==="transparent"||le==="rgba(0, 0, 0, 0)"?null:le},M=[50,100,200,300,400,500,600,700,800,900,950],N=Z=>{const J=M.indexOf(Z);return J===-1?Z:M[Math.min(M.length-1,J+2)]},P=(Z,J)=>{const le=Fh[Z];if(!le)return null;if(typeof le=="string")return le;if(!J)return null;const ue=le[J];return typeof ue=="string"?ue:null},T=(Z,J=!1)=>{if(!Z)return null;const le=J?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ue=Z.match(le);return ue?{colorName:ue[1],shade:ue[2]?Number.parseInt(ue[2],10):null}:null},K=()=>{const Z=p.value;if(!Z){x.value=null;return}const J=T(Z),le=J==null?void 0:J.colorName,ue=(J==null?void 0:J.shade)??null,Ce=(le?P(le,ue):null)??D(Z);if(!Ce){x.value=null;return}let Be;const me=T(E.value,!0),Q=me?P(me.colorName,me.shade??null):null;if(Q)Be=Q;else if(le&&ue){const O=N(ue);Be=P(le,O)??S(Ce,.2)}else Be=S(Ce,.2);x.value={"--btn-color":Ce,"--btn-color-hover":Be}};e.onMounted(()=>{K()}),e.watch([p,E],async()=>{await e.nextTick(),K()});const $=e.computed(()=>{const Z=/\bdark:bg-/.test(u.value??"");return!C.value||i.value==="outline"||Z?"":x.value?"dcode-btn--fill dcode-btn--fill-hover":_.value?"":"hover:brightness-90"}),H=e.computed(()=>{if(!C.value||i.value!=="outline")return"";const Z=["dcode-btn--outline","dcode-btn--outline-hover"];return w.value||Z.push("border"),!x.value&&!_.value&&Z.push("hover:brightness-90"),Z.join(" ")}),ee=e.computed(()=>x.value??void 0),q={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"}},R={"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"}},j=e.computed(()=>{const Z=[],J=l.value,le=String(o.borderColor||"").toLowerCase(),ue=J?q[J]:null,Ce=J?R[J]:null,Be=le?q[le]:null;return J&&(ue?Be&&le!==J?(Z.push(ue.bg,Be.hoverBg),o.textColor||Z.push(ue.text,Be.hoverText)):(Z.push(ue.bg,ue.hoverBg),o.textColor||Z.push(ue.text,ue.hoverText)):Ce?(Z.push(Ce.bg,Ce.hover),o.textColor||Z.push(Ce.text)):J==="transparent"?Be?(Z.push("bg-transparent",Be.hoverBg),o.textColor||Z.push("text-inherit",Be.hoverText)):Z.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Z.push(J)),le?Be?Z.push(Be.border,Be.hoverBorder):Z.push(le):ue&&i.value!=="ghost"&&i.value!=="link"&&Z.push(ue.border,ue.hoverBorder),o.textColor&&Z.push(o.textColor),Z.join(" ")}),ae=e.computed(()=>ve(Ih,g.value,y.value,B.value,$.value,H.value,j.value));return(Z,J)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(Ji),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(Ki),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Qi),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Tt),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:ee.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(Yi),{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:e.withCtx(()=>[e.createElementVNode("span",zh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Tt),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:ee.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Z.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),wt=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},He=wt(Rh,[["__scopeId","data-v-d4cd902d"]]),Lh={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"},$h={class:"flex flex-col gap-1"},jh={key:0,class:"text-sm font-semibold text-white leading-tight"},Wh={key:1,class:"text-xs text-primary-100 dark:text-primary-200"},Uh={key:0,class:"flex items-center gap-2"},Hh={name:"DCodeCard"},Zi=e.defineComponent({...Hh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.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(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200 dark:border-neutral-800":t.border&&t.level===1},{"border-neutral-300 dark:border-neutral-700":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Lh,[e.createElementVNode("div",$h,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",jh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Wh,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Uh,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),qh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Gh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Xh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Kh={class:"flex items-center justify-between"},Yh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Jh={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},Qh={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},Zh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},em={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},tm={class:"flex items-center justify-between"},nm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},om={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},rm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},va=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=zt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",qh,[e.createElementVNode("div",Gh,[e.createElementVNode("div",Xh,[e.createElementVNode("div",Kh,[e.createElementVNode("h3",Yh,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",Jh,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",Qh,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",Zh,[e.createElementVNode("div",em,[e.createElementVNode("div",tm,[e.createElementVNode("h3",nm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",om,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",rm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),am=["aria-busy"],sm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},im={key:1,class:"flex justify-end"},lm=["for"],cm={key:0,class:"ml-1 text-destructive"},dm={class:"relative w-full group"},um={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},fm={key:1},hm=["id","value","placeholder"],mm={key:1,class:"absolute inset-y-0 right-4 flex items-center"},pm={key:2,class:"absolute inset-y-0 right-4 flex items-center"},gm={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"},bm={key:1,class:"text-xs text-destructive"},Gn=e.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(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var O;return((O=l.valueType)==null?void 0:O.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const O=o.required,X=o["aria-required"];return O===""||O===!0||O==="true"||(X==="true"||X===!0)}),h=e.computed(()=>{const{label:O,class:X,id:re,required:be,"aria-required":Ee,...Fe}=o;return Fe}),m=e.computed(()=>{var X,re;const O={...h.value};return((X=l.valueType)==null?void 0:X.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((re=l.valueType)==null?void 0:re.toLowerCase())==="email"&&(O.type="email",O.inputmode="email"),r.value&&(O.type=a.value?"text":"password"),l.disabled&&(O.disabled=!0),l.maxLength&&(O.maxlength=l.maxLength),l.minLength&&(O.minlength=l.minLength),l.maxValue&&(O.max=l.maxValue),l.minValue&&(O.min=l.minValue),O}),g=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),y=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),k=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,O=>{const X=String(O??"");X!==p.value&&(p.value=X)});const E=e.ref(!1),C=e.ref(!1),w=O=>O.split(/(\s+)/).map(X=>{if(X.trim()==="")return X;const re=X.toLowerCase();return re.charAt(0).toUpperCase()+re.slice(1)}).join(""),_=O=>{const X=O.toLowerCase(),re=X.search(new RegExp("\\p{L}","u"));return re<0?X:X.slice(0,re)+X.charAt(re).toUpperCase()+X.slice(re+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return w(O);case"sentencecase":return _(O);case"none":default:return O}},x=O=>{if(!O)return null;const X=Array.isArray(O)?O.join(""):O;return X?new Set(X):null},b=e.computed(()=>x(l.allowChars)),S=(O,X)=>(O.lastIndex=0,O.test(X)),D=O=>{var Re;const X=(Re=l.valueType)==null?void 0:Re.toLowerCase();if(X==="free"||X==="email"||X==="password")return!0;const re=O===" ",be=/\d/.test(O),Ee=new RegExp("\\p{L}","u").test(O),Fe=new RegExp("\\p{N}","u").test(O);return X==="number"?be:X==="letter"?Ee||l.allowSpaces&&re:X==="letternumber"?Ee||Fe||l.allowSpaces&&re:!0},M=O=>{let X="";for(const re of O){const be=!!b.value&&b.value.has(re);l.pattern&&!be&&!S(l.pattern,re)||!be&&!D(re)||(X+=re)}return X},N=e.computed(()=>{const O=l.maxLength??o.maxlength??o.maxLength;let X=Number.NaN;return typeof O=="number"?X=O:typeof O=="string"&&(X=Number.parseInt(O,10)),Number.isFinite(X)&&X>0?X:-1}),P=e.computed(()=>p.value.length),T=e.computed(()=>l.showCharCount?N.value>0:!1),K=O=>N.value>0?O.slice(0,N.value):O,$=O=>{const X=M(O),re=l.applyTextCaseToValue?B(X):X;return K(re)};let H=null;const ee=O=>{var X;if(O==="")return null;if(((X=l.valueType)==null?void 0:X.toLowerCase())==="number"&&l.returnNumber){const re=Number(O);return Number.isFinite(re)?re:null}return O},q=O=>{p.value=O,i("update:modelValue",ee(O))},R=(O,X)=>{const re=K(X);C.value=!0,O.value=re,q(re),queueMicrotask(()=>C.value=!1)},j=(O,X)=>{const re=O.selectionStart??O.value.length,be=O.selectionEnd??O.value.length;if(N.value>0){const Ee=O.value.length-(be-re),Fe=N.value-Ee;if(Fe<=0)return;X=X.slice(0,Fe)}O.setRangeText(X,re,be,"end"),R(O,$(O.value))},ae=O=>{var be;if(!H||E.value||C.value||!((be=O.inputType)!=null&&be.startsWith("insert")))return;const X=O.data;if(X==null)return;const re=$(X);re!==X&&(O.preventDefault(),re.length>0&&j(H,re))},Z=O=>{var be;if(!H||E.value||C.value)return;const X=((be=O.clipboardData)==null?void 0:be.getData("text"))??"",re=$(X);re!==X&&(O.preventDefault(),re.length>0&&j(H,re))},J=O=>{if(!H||E.value||C.value)return;const X=O.target,re=X.value??"",be=$(re);be===re?q(be):R(X,be)},le=()=>E.value=!0,ue=()=>{if(E.value=!1,!H)return;const O=H.value??"",X=$(O);X===O?q(X):R(H,X)};e.onMounted(()=>{if(H=document.getElementById(u.value),!H)return;H.addEventListener("beforeinput",ae),H.addEventListener("paste",Z),H.addEventListener("input",J),H.addEventListener("compositionstart",le),H.addEventListener("compositionend",ue);const O=H.value??"",X=$(O);X===O?q(X):R(H,X)}),e.onBeforeUnmount(()=>{H&&(H.removeEventListener("beforeinput",ae),H.removeEventListener("paste",Z),H.removeEventListener("input",J),H.removeEventListener("compositionstart",le),H.removeEventListener("compositionend",ue),H=null)});const Ce=()=>{p.value="",H&&(H.value=""),i("update:modelValue",null),i("clear")},Be=e.computed(()=>T.value&&P.value>0),me=e.computed(()=>`${P.value} / ${N.value}`),Q=e.computed(()=>!!l.error);return(O,X)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",sm)):e.createCommentVNode("",!0),X[1]||(X[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(e.openBlock(),e.createElementBlock("div",im,[...X[0]||(X[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",cm,"*")):e.createCommentVNode("",!0)],8,lm)):e.createCommentVNode("",!0),e.createElementVNode("div",dm,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",um,[e.renderSlot(O.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",fm,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${k.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${y.value||r.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",Q.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,hm),r.value?(e.openBlock(),e.createElementBlock("div",mm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(ce.Eye):e.unref(ce.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),y.value&&!r.value?(e.openBlock(),e.createElementBlock("div",pm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:Ce}," ✕ ")])):e.createCommentVNode("",!0),Be.value&&!Q.value?(e.openBlock(),e.createElementBlock("p",gm,e.toDisplayString(me.value),1)):e.createCommentVNode("",!0)]),Q.value?(e.openBlock(),e.createElementBlock("p",bm,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,am)),[[e.vShow,t.visible]])}}),ym={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},xm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-xl overflow-hidden"},km={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30"},wm={class:"flex items-center justify-between"},Cm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Em={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"},Bm={class:"p-6 flex-1"},_m={class:"flex flex-col gap-4"},Sm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Am={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-xl overflow-hidden"},Vm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30"},Dm={class:"flex items-center justify-between"},Nm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Mm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"},vm={class:"p-6 flex-1"},Pm={class:"flex flex-col gap-4"},Tm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Pa=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=zt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",xm,[e.createElementVNode("div",km,[e.createElementVNode("div",wm,[e.createElementVNode("h3",Cm,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",Em,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Bm,[e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(Gn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",Sm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Am,[e.createElementVNode("div",Vm,[e.createElementVNode("div",Dm,[e.createElementVNode("h3",Nm,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",Mm,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",vm,[e.createElementVNode("div",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(Gn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Tm,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
1
+ (function(ue,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(ue=typeof globalThis<"u"?globalThis:ue||self,e(ue.DynamicUI={},ue.Vue,ue.LucideIcons,ue.rekaUi,ue.core,ue.VueI18n,ue.VueDatePicker,ue.Uppy,ue.UppyDashboard,ue.UppyImageEditor,ue.VueRouter,ue.Vue3Lottie))})(this,(function(ue,e,le,we,et,vt,hu,mu,ti,pu,Vn,gu){"use strict";var SA=Object.defineProperty;var AA=(ue,e,le)=>e in ue?SA(ue,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):ue[e]=le;var be=(ue,e,le)=>AA(ue,typeof e!="symbol"?e+"":e,le);var ca;function bu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const It=bu(le);let Rt={};function ni(t){Rt={...Rt,...t}}function yu(){return Rt}function xu(){return Rt.apiBaseUrl?Rt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function ku(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Rt.getAuthToken?n=Rt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Rt.getHeaders){const o=Rt.getHeaders();return{...t,...o}}return t}function wu(){Rt.onUnauthorized&&Rt.onUnauthorized()}async function oi(t,n,o,r){const a=yu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.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=xu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...ku(),...r||{}}};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 g=new URLSearchParams;Object.entries(o).forEach(([x,p])=>{p!=null&&g.append(x,String(p))});const b=g.toString();b&&(f=`${d}${d.includes("?")?"&":"?"}${b}`)}const h=await fetch(f,u);if(h.status===401&&wu(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function st(){return{apiUrl:(o,r,a,s)=>oi(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),oi(i,l,c,s==null?void 0:s.headers)}}}const Gn=Math.min,wt=Math.max,Yo=Math.round,Jo=Math.floor,Ht=t=>({x:t,y:t}),Cu={left:"right",right:"left",bottom:"top",top:"bottom"};function ri(t,n,o){return wt(t,Gn(n,o))}function go(t,n){return typeof t=="function"?t(n):t}function mn(t){return t.split("-")[0]}function bo(t){return t.split("-")[1]}function ai(t){return t==="x"?"y":"x"}function si(t){return t==="y"?"height":"width"}function tn(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function ii(t){return ai(tn(t))}function Eu(t,n,o){o===void 0&&(o=!1);const r=bo(t),a=ii(t),s=si(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=Qo(i)),[i,Qo(i)]}function Bu(t){const n=Qo(t);return[pa(t),n,pa(n)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const li=["left","right"],ci=["right","left"],_u=["top","bottom"],Su=["bottom","top"];function Au(t,n,o){switch(t){case"top":case"bottom":return o?n?ci:li:n?li:ci;case"left":case"right":return n?_u:Su;default:return[]}}function Vu(t,n,o,r){const a=bo(t);let s=Au(mn(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(pa)))),s}function Qo(t){const n=mn(t);return Cu[n]+t.slice(n.length)}function Du(t){return{top:0,right:0,bottom:0,left:0,...t}}function Nu(t){return typeof t!="number"?Du(t):{top:t,right:t,bottom:t,left:t}}function Zo(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function di(t,n,o){let{reference:r,floating:a}=t;const s=tn(n),i=ii(n),l=si(i),c=mn(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(bo(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 Mu(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=go(n,t),g=Nu(m),x=l[h?f==="floating"?"reference":"floating":f],p=Zo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(x)))==null||o?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:a,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},_=Zo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:w,strategy:c}):E);return{top:(p.top-_.top+g.top)/C.y,bottom:(_.bottom-p.bottom+g.bottom)/C.y,left:(p.left-_.left+g.left)/C.x,right:(_.right-p.right+g.right)/C.x}}const vu=50,Pu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:Mu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=di(d,r,c),h=r,m=0;const g={};for(let b=0;b<s.length;b++){const x=s[b];if(!x)continue;const{name:p,fn:E}=x,{x:w,y:C,data:_,reset:B}=await E({x:u,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=w??u,f=C??f,g[p]={...g[p],..._},B&&m<vu&&(m++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:f}=di(d,h,c)),b=-1)}return{x:u,y:f,placement:h,strategy:a,middlewareData:g}},Tu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...x}=go(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=mn(a),E=tn(l),w=mn(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=h||(w||!b?[Qo(l)]:Bu(l)),B=g!=="none";!h&&B&&_.push(...Vu(l,b,g,C));const k=[l,..._],y=await c.detectOverflow(n,x),A=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(y[p]),f){const P=Eu(a,i,C);A.push(y[P[0]],y[P[1]])}if(V=[...V,{placement:a,overflows:A}],!A.every(P=>P<=0)){var M,D;const P=(((M=s.flip)==null?void 0:M.index)||0)+1,K=k[P];if(K&&(!(f==="alignment"?E!==tn(K):!1)||V.every(Q=>tn(Q.placement)===E?Q.overflows[0]>0:!0)))return{data:{index:P,overflows:V},reset:{placement:K}};let L=(D=V.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:D.placement;if(!L)switch(m){case"bestFit":{var T;const G=(T=V.filter(Q=>{if(B){const X=tn(Q.placement);return X===E||X==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(X=>X>0).reduce((X,R)=>X+R,0)]).sort((Q,X)=>Q[1]-X[1])[0])==null?void 0:T[0];G&&(L=G);break}case"initialPlacement":L=l;break}if(a!==L)return{reset:{placement:L}}}return{}}}},Ou=new Set(["left","top"]);async function Fu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=mn(o),l=bo(o),c=tn(o)==="y",d=Ou.has(i)?-1:1,u=s&&c?-1:1,f=go(n,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const zu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await Fu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Iu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:E,y:w}=p;return{x:E,y:w}}},...d}=go(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),h=tn(mn(a)),m=ai(h);let g=u[m],b=u[h];if(i){const p=m==="y"?"top":"left",E=m==="y"?"bottom":"right",w=g+f[p],C=g-f[E];g=ri(w,g,C)}if(l){const p=h==="y"?"top":"left",E=h==="y"?"bottom":"right",w=b+f[p],C=b-f[E];b=ri(w,b,C)}const x=c.fn({...n,[m]:g,[h]:b});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[m]:i,[h]:l}}}}}},Ru=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=go(t,n),u=await i.detectOverflow(n,d),f=mn(a),h=bo(a),m=tn(a)==="y",{width:g,height:b}=s.floating;let x,p;f==="top"||f==="bottom"?(x=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,x=h==="end"?"top":"bottom");const E=b-u.top-u.bottom,w=g-u.left-u.right,C=Gn(b-u[x],E),_=Gn(g-u[p],w),B=!n.middlewareData.shift;let k=C,y=_;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(y=w),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(k=E),B&&!h){const V=wt(u.left,0),M=wt(u.right,0),D=wt(u.top,0),T=wt(u.bottom,0);m?y=g-2*(V!==0||M!==0?V+M:wt(u.left,u.right)):k=b-2*(D!==0||T!==0?D+T:wt(u.top,u.bottom))}await c({...n,availableWidth:y,availableHeight:k});const A=await i.getDimensions(l.floating);return g!==A.width||b!==A.height?{reset:{rects:!0}}:{}}}};function er(){return typeof window<"u"}function Dn(t){return ga(t)?(t.nodeName||"").toLowerCase():"#document"}function Ct(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function qt(t){var n;return(n=(ga(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function ga(t){return er()?t instanceof Node||t instanceof Ct(t).Node:!1}function Lt(t){return er()?t instanceof Element||t instanceof Ct(t).Element:!1}function nn(t){return er()?t instanceof HTMLElement||t instanceof Ct(t).HTMLElement:!1}function ui(t){return!er()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ct(t).ShadowRoot}function yo(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=$t(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Lu(t){return/^(table|td|th)$/.test(Dn(t))}function tr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const $u=/transform|translate|scale|rotate|perspective|filter/,ju=/paint|layout|strict|content/,Nn=t=>!!t&&t!=="none";let ba;function ya(t){const n=Lt(t)?$t(t):t;return Nn(n.transform)||Nn(n.translate)||Nn(n.scale)||Nn(n.rotate)||Nn(n.perspective)||!xa()&&(Nn(n.backdropFilter)||Nn(n.filter))||$u.test(n.willChange||"")||ju.test(n.contain||"")}function Wu(t){let n=pn(t);for(;nn(n)&&!Xn(n);){if(ya(n))return n;if(tr(n))return null;n=pn(n)}return null}function xa(){return ba==null&&(ba=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ba}function Xn(t){return/^(html|body|#document)$/.test(Dn(t))}function $t(t){return Ct(t).getComputedStyle(t)}function nr(t){return Lt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function pn(t){if(Dn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||ui(t)&&t.host||qt(t);return ui(n)?n.host:n}function fi(t){const n=pn(t);return Xn(n)?t.ownerDocument?t.ownerDocument.body:t.body:nn(n)&&yo(n)?n:fi(n)}function xo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=fi(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=Ct(a);if(s){const l=ka(i);return n.concat(i,i.visualViewport||[],yo(a)?a:[],l&&o?xo(l):[])}else return n.concat(a,xo(a,[],o))}function ka(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hi(t){const n=$t(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=nn(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=Yo(o)!==s||Yo(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function wa(t){return Lt(t)?t:t.contextElement}function Kn(t){const n=wa(t);if(!nn(n))return Ht(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=hi(n);let i=(s?Yo(o.width):o.width)/r,l=(s?Yo(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Uu=Ht(0);function mi(t){const n=Ct(t);return!xa()||!n.visualViewport?Uu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Hu(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==Ct(t)?!1:n}function Mn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=wa(t);let i=Ht(1);n&&(r?Lt(r)&&(i=Kn(r)):i=Kn(t));const l=Hu(s,o,r)?mi(s):Ht(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const h=Ct(s),m=r&&Lt(r)?Ct(r):r;let g=h,b=ka(g);for(;b&&r&&m!==g;){const x=Kn(b),p=b.getBoundingClientRect(),E=$t(b),w=p.left+(b.clientLeft+parseFloat(E.paddingLeft))*x.x,C=p.top+(b.clientTop+parseFloat(E.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,f*=x.y,c+=w,d+=C,g=Ct(b),b=ka(g)}}return Zo({width:u,height:f,x:c,y:d})}function or(t,n){const o=nr(t).scrollLeft;return n?n.left+o:Mn(qt(t)).left+o}function pi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-or(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function qu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=qt(r),l=n?tr(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Ht(1);const u=Ht(0),f=nn(r);if((f||!f&&!s)&&((Dn(r)!=="body"||yo(i))&&(c=nr(r)),f)){const m=Mn(r);d=Kn(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const h=i&&!f&&!s?pi(i,c):Ht(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 Gu(t){return Array.from(t.getClientRects())}function Xu(t){const n=qt(t),o=nr(t),r=t.ownerDocument.body,a=wt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=wt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+or(t);const l=-o.scrollTop;return $t(r).direction==="rtl"&&(i+=wt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const gi=25;function Ku(t,n){const o=Ct(t),r=qt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=xa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=or(r);if(d<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=gi&&(s-=g)}else d<=gi&&(s+=d);return{width:s,height:i,x:l,y:c}}function Yu(t,n){const o=Mn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=nn(t)?Kn(t):Ht(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function bi(t,n,o){let r;if(n==="viewport")r=Ku(t,o);else if(n==="document")r=Xu(qt(t));else if(Lt(n))r=Yu(n,o);else{const a=mi(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Zo(r)}function yi(t,n){const o=pn(t);return o===n||!Lt(o)||Xn(o)?!1:$t(o).position==="fixed"||yi(o,n)}function Ju(t,n){const o=n.get(t);if(o)return o;let r=xo(t,[],!1).filter(l=>Lt(l)&&Dn(l)!=="body"),a=null;const s=$t(t).position==="fixed";let i=s?pn(t):t;for(;Lt(i)&&!Xn(i);){const l=$t(i),c=ya(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||yo(i)&&!c&&yi(t,i))?r=r.filter(u=>u!==i):a=l,i=pn(i)}return n.set(t,r),r}function Qu(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?tr(n)?[]:Ju(n,this._c):[].concat(o),r],l=bi(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=bi(n,i[h],a);c=wt(m.top,c),d=Gn(m.right,d),u=Gn(m.bottom,u),f=wt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Zu(t){const{width:n,height:o}=hi(t);return{width:n,height:o}}function ef(t,n,o){const r=nn(n),a=qt(n),s=o==="fixed",i=Mn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Ht(0);function d(){c.x=or(a)}if(r||!r&&!s)if((Dn(n)!=="body"||yo(a))&&(l=nr(n)),r){const m=Mn(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?pi(a,l):Ht(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 Ca(t){return $t(t).position==="static"}function xi(t,n){if(!nn(t)||$t(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return qt(t)===o&&(o=o.ownerDocument.body),o}function ki(t,n){const o=Ct(t);if(tr(t))return o;if(!nn(t)){let a=pn(t);for(;a&&!Xn(a);){if(Lt(a)&&!Ca(a))return a;a=pn(a)}return o}let r=xi(t,n);for(;r&&Lu(r)&&Ca(r);)r=xi(r,n);return r&&Xn(r)&&Ca(r)&&!ya(r)?o:r||Wu(t)||o}const tf=async function(t){const n=this.getOffsetParent||ki,o=this.getDimensions,r=await o(t.floating);return{reference:ef(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nf(t){return $t(t).direction==="rtl"}const of={convertOffsetParentRelativeRectToViewportRelativeRect:qu,getDocumentElement:qt,getClippingRect:Qu,getOffsetParent:ki,getElementRects:tf,getClientRects:Gu,getDimensions:Zu,getScale:Kn,isElement:Lt,isRTL:nf};function wi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function rf(t,n){let o=null,r;const a=qt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||n(),!h||!m)return;const g=Jo(f),b=Jo(a.clientWidth-(u+h)),x=Jo(a.clientHeight-(f+m)),p=Jo(u),w={rootMargin:-g+"px "+-b+"px "+-x+"px "+-p+"px",threshold:wt(0,Gn(1,c))||1};let C=!0;function _(B){const k=B[0].intersectionRatio;if(k!==c){if(!C)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!wi(d,t.getBoundingClientRect())&&i(),C=!1}try{o=new IntersectionObserver(_,{...w,root:a.ownerDocument})}catch{o=new IntersectionObserver(_,w)}o.observe(t)}return i(!0),s}function Ea(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=wa(t),u=a||s?[...d?xo(d):[],...n?xo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?rf(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[E]=p;E&&E.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,b=c?Mn(t):null;c&&x();function x(){const p=Mn(t);b&&!wi(b,p)&&o(),b=p,g=requestAnimationFrame(x)}return o(),()=>{var p;u.forEach(E=>{a&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Ba=zu,_a=Iu,Sa=Tu,Aa=Ru,af=(t,n,o)=>{const r=new Map,a={platform:of,...o},s={...a.platform,_c:r};return Pu(t,n,{...a,platform:s})};function sf(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ci(t){if(sf(t)){const n=t.$el;return ga(n)&&Dn(n)==="#comment"?null:n}return t}function ko(t){return typeof t=="function"?t():e.unref(t)}function Ei(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bi(t,n){const o=Ei(t);return Math.round(n*o)/o}function Va(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var k;return(k=ko(o.open))!=null?k:!0}),s=e.computed(()=>ko(o.middleware)),i=e.computed(()=>{var k;return(k=ko(o.placement))!=null?k:"bottom"}),l=e.computed(()=>{var k;return(k=ko(o.strategy))!=null?k:"absolute"}),c=e.computed(()=>{var k;return(k=ko(o.transform))!=null?k:!0}),d=e.computed(()=>Ci(t.value)),u=e.computed(()=>Ci(n.value)),f=e.ref(0),h=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),b=e.shallowRef({}),x=e.ref(!1),p=e.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const y=Bi(u.value,f.value),A=Bi(u.value,h.value);return c.value?{...k,transform:"translate("+y+"px, "+A+"px)",...Ei(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:y+"px",top:A+"px"}});let E;function w(){if(d.value==null||u.value==null)return;const k=a.value;af(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(y=>{f.value=y.x,h.value=y.y,m.value=y.strategy,g.value=y.placement,b.value=y.middlewareData,x.value=k!==!1})}function C(){typeof E=="function"&&(E(),E=void 0)}function _(){if(C(),r===void 0){w();return}if(d.value!=null&&u.value!=null){E=r(d.value,u.value,w);return}}function B(){a.value||(x.value=!1)}return e.watch([s,i,l,a],w,{flush:"sync"}),e.watch([d,u],_,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(C),{x:e.shallowReadonly(f),y:e.shallowReadonly(h),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(b),isPositioned:e.shallowReadonly(x),floatingStyles:p,update:w}}const lf=["aria-busy"],cf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},df=["for"],uf={key:0,class:"ml-1 text-destructive"},ff={class:"relative"},hf={key:0,class:"flex items-center text-gray-500 gap-2"},mf=["id","placeholder","disabled","readonly","value"],pf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},gf=["disabled"],bf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},yf=["onMouseenter","onClick"],xf={key:0},kf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},wf={key:0},Cf={key:1},Ef={key:2},Bf={key:1,class:"mt-1 text-xs text-red-600"},rr=e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=q=>{const ce=a[q];return ce===""||ce===!0||ce==="true"||ce===1||ce==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),h=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>f.value||i("aria-required")),b=e.computed(()=>o.error||o.errorMessage||a["error-message"]),x=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const q=a.minChars??a["min-chars"];if(q==null||q==="")return 0;const ce=typeof q=="number"?q:Number.parseInt(String(q),10);return Number.isFinite(ce)&&ce>0?ce:0}),E=e.computed(()=>{const q=a.rules;return Array.isArray(q)?q:[]}),w=e.computed(()=>{const q=a.id||a.label;return q?`app-autocomplete-${q}-${Math.random().toString(36).slice(2,7)}`:void 0}),C=e.ref(o.modelValue),_=e.ref([]),B=e.ref(!1),k=e.ref(!1),y=e.computed(()=>a.items),A=e.computed(()=>{const q=P.value;return q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems?_.value:y.value??[]}),V=e.computed(()=>!!a.loading),M=e.computed(()=>V.value||B.value),D=e.computed(()=>{const{label:q,items:ce,loading:v,rules:U,"item-title":$,"item-value":N,itemTitle:I,itemValue:W,minChars:ne,"min-chars":ee,clearable:fe,required:Be,"aria-required":_e,disabled:pe,readonly:Le,visible:Ce,"return-object":Qe,returnObject:he,class:tt,"fetch-items":xt,fetchItems:ve,error:kt,errorMessage:Vt,"error-message":Ut,...Dt}=a||{};return Dt}),T=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},P=e.computed(()=>{const q=o.endpoint||{};return{apiModule:o.apiModule||q.apiModule,apiAction:o.apiAction||q.apiAction,apiUrl:q.apiUrl,apiMethod:q.apiMethod||"GET"}}),K=e.ref(null),L=e.ref(null),G=e.ref(null),{floatingStyles:Q}=Va(L,G,{placement:"bottom-start",whileElementsMounted:Ea,middleware:[Ba(4),Sa(),_a(),Aa({apply({rects:q,elements:ce,availableHeight:v}){Object.assign(ce.floating.style,{width:`${q.reference.width}px`,maxHeight:`${v}px`})}})]}),X=e.ref(!1),R=e.ref(""),H=e.ref(-1),ae=e.ref(null),Z=e.computed(()=>!p.value||(R.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),J=q=>{if(q==null)return"";if(typeof q=="string"||typeof q=="number")return String(q);const ce=c.value;return typeof ce=="function"?ce(q):(q==null?void 0:q[ce])??(q==null?void 0:q.name)??(q==null?void 0:q.nama)??(q==null?void 0:q.label)??(q==null?void 0:q.title)??"-"},ie=q=>{if(q==null)return null;if(typeof q=="string"||typeof q=="number")return q;const ce=d.value;return typeof ce=="function"?ce(q):(q==null?void 0:q[ce])??(q==null?void 0:q.id)??(q==null?void 0:q.value)??(q==null?void 0:q.code)??null},de=e.computed(()=>{const q=C.value;if(q==null||q==="")return"";if(Array.isArray(q))return q.length?q.map(U=>{if(m.value&&typeof U=="object"||typeof U=="object")return J(U);const $=A.value.find(N=>ie(N)==U);return $?J($):String(U)}).join(", "):"";if(typeof q=="object")return J(q);const ce=A.value.find(v=>ie(v)==q);return ce?J(ce):String(q)}),Ee=e.computed(()=>{const q=A.value||[],ce=(R.value||"").trim().toLowerCase(),v=(de.value||"").toLowerCase(),U=!ce||ce===v;let $=q;if(U||($=q.filter(N=>J(N).toLowerCase().includes(ce))),$.length>0){const N=I=>{const W=ie(I);return Array.isArray(C.value)?C.value.some(ne=>ne==W):C.value==W};$=[...$].sort((I,W)=>{const ne=N(I),ee=N(W);return ne&&!ee?-1:!ne&&ee?1:0})}return $}),Ne=q=>Array.isArray(q)?q.length===0:q==null||q==="",ye=q=>{if(ae.value=null,f.value&&Ne(q)&&!E.value.length)return ae.value="This field is required",!1;for(const ce of E.value){const v=ce(q);if(v===!1)return ae.value="Invalid value",!1;if(typeof v=="string")return ae.value=v,!1}return!0},te=async()=>{if(u.value||h.value)return;X.value=!0,H.value=Ee.value.length?0:-1,R.value=de.value||"";const q=P.value,ce=q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ce&&!k.value&&(await Ve(),H.value=Ee.value.length?0:-1)},O=()=>{X.value=!1,H.value=-1,R.value=de.value||""},Y=q=>{const ce=m.value?q:ie(q);let v=ce;Array.isArray(C.value)&&(v=[ce]),C.value=v,r("update:modelValue",v),ae.value=null,ye(v),R.value=J(q),O()},se=()=>{_.value=[],k.value=!1,C.value=Array.isArray(C.value)?[]:null,r("update:modelValue",C.value),R.value="",ae.value=null},xe=()=>{l.value=!0,se(),O(),setTimeout(()=>{l.value=!1},0)},Ae=q=>{if(u.value||h.value)return;const ce=q.target.value;R.value=ce,ae.value&&(ae.value=null),X.value||(X.value=!0),H.value=Ee.value.length?0:-1;const v=P.value.apiModule&&P.value.apiAction||P.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&v&&!M.value&&!k.value&&Ve()},Re=q=>{var v;if(u.value||h.value)return;const ce={ArrowDown:()=>{if(q.preventDefault(),!X.value){te();return}Ee.value.length&&(H.value=Math.min(H.value+1,Ee.value.length-1))},ArrowUp:()=>{!X.value||!Ee.value.length||(q.preventDefault(),H.value=Math.max(H.value-1,0))},Enter:()=>{if(!X.value)return;q.preventDefault();const U=Ee.value[H.value];U&&Y(U)},Escape:()=>{q.preventDefault(),O()},Tab:()=>{O()}};(v=ce[q.key])==null||v.call(ce)},Ve=async()=>{const q=P.value;if(q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems){B.value=!0;try{let v;if(o.fetchItems){const U=T()||{},$={page:1,perPage:100,search:(R.value||"").trim(),...U,...o.apiParams},N=await o.fetchItems($),I=(N==null?void 0:N.data)??N;v=(I==null?void 0:I.data)??I}else{const $=st().DCodeApi;if(typeof $!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const I={page:1,perPage:100,...T()||{},...o.apiParams};let W;q.apiUrl?W=await $("","",I,{_url:q.apiUrl,_method:q.apiMethod||"POST"}):W=await $(q.apiModule,q.apiAction,I);const ne=(W==null?void 0:W.data)??W;v=(ne==null?void 0:ne.data)??ne}_.value=Array.isArray(v)?v:[],k.value=!0}catch(v){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",v),ae.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(v==null?void 0:v.message)||(v==null?void 0:v.toString())||"Failed to load options"}`,_.value=[],k.value=!0}finally{B.value=!1}}},je=q=>{const ce=ie(q);return m.value?C.value?Array.isArray(C.value)?C.value.some(v=>ie(v)==ce):ie(C.value)==ce:!1:Array.isArray(C.value)?C.value.some(v=>v==ce):C.value==ce};e.watch(()=>[T(),P.value,o.apiParams],([q,ce,v],[U,$,N])=>{const I=P.value;if(!(I.apiModule&&I.apiAction||I.apiUrl||o.fetchItems)){se();return}const ne=JSON.stringify(q??null)===JSON.stringify(U??null),ee=JSON.stringify(v??null)===JSON.stringify(N??null);ne&&ee||(se(),ee||Ve())},{deep:!0}),e.watch(()=>o.modelValue,(q,ce)=>{C.value=q,!l.value&&(q==null||q==="")&&ce!=null&&o.apiModule&&o.apiAction&&(_.value=[],k.value=!1),R.value=de.value||""},{immediate:!0});const Oe=P.value;(Oe.apiModule&&Oe.apiAction||Oe.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!Ne(o.modelValue))&&Ve();const ut=q=>{const ce=K.value,v=G.value,U=q.target;ce&&ce.contains(U)||v&&v.contains(U)||X.value&&O()},St=e.computed(()=>{const q=o.modelValue;return q==null?!1:typeof q=="string"?q.trim().length>0:Array.isArray(q)?q.length>0:typeof q=="object"?Object.keys(q).length>0:!0}),At=e.computed(()=>!!o.clearable&&St.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",ut)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ut)}),(q,ce)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:K,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",cf)):e.createCommentVNode("",!0),ce[6]||(ce[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:w.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",uf,"*")):e.createCommentVNode("",!0)],8,df)):e.createCommentVNode("",!0),e.createElementVNode("div",ff,[e.createElementVNode("div",{ref_key:"reference",ref:L,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 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":"",ae.value||b.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||q.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",hf,[e.renderSlot(q.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(D.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:x.value,disabled:u.value,readonly:h.value,value:X.value?R.value:de.value||R.value,onFocus:ce[0]||(ce[0]=()=>{X.value||te()}),onClick:ce[1]||(ce[1]=()=>{X.value||te()}),onInput:Ae,onKeydown:Re,onBlur:ce[2]||(ce[2]=()=>ye(C.value))}),null,16,mf),M.value?(e.openBlock(),e.createElementBlock("svg",pf,[...ce[7]||(ce[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):At.value?(e.openBlock(),e.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:ce[3]||(ce[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(xe,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.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:ce[4]||(ce[4]=v=>X.value?O():te()),"aria-label":"Toggle"},[e.createVNode(e.unref(le.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":X.value}])},null,8,["class"])],8,gf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:G,style:e.normalizeStyle(e.unref(Q)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",bf,[Ee.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ee.value,(v,U)=>(e.openBlock(),e.createElementBlock("button",{key:ie(v)??U,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",U===H.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:$=>H.value=U,onMousedown:ce[5]||(ce[5]=e.withModifiers(()=>{},["prevent"])),onClick:$=>Y(v)},[e.createTextVNode(e.toDisplayString(J(v))+" ",1),je(v)?(e.openBlock(),e.createElementBlock("span",xf," ✓ ")):e.createCommentVNode("",!0)],42,yf))),128)):e.renderSlot(q.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",kf,[M.value?(e.openBlock(),e.createElementBlock("span",wf,"Loading data…")):Z.value?(e.openBlock(),e.createElementBlock("span",Cf,e.toDisplayString(Z.value),1)):(e.openBlock(),e.createElementBlock("span",Ef,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),ae.value||b.value?(e.openBlock(),e.createElementBlock("p",Bf,e.toDisplayString(ae.value||b.value),1)):e.createCommentVNode("",!0)],64))],10,lf)),[[e.vShow,t.visible]])}}),_f=["aria-busy"],Sf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Af=["for"],Vf={key:0,class:"ml-1 text-destructive"},Df={class:"relative"},Nf={key:0,class:"flex items-center text-gray-500 gap-2"},Mf=["id","placeholder","disabled","value"],vf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Pf=["disabled"],Tf={key:0,class:"p-3 space-y-2"},Of=["onMouseenter","onClick"],Ff={class:"flex items-center space-x-3"},zf={class:"flex-1"},If={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Rf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Lf={key:0},$f={key:2,class:"p-3 text-center"},jf={class:"inline-flex items-center space-x-2"},Wf={class:"text-sm text-gray-500"},Uf={key:3,class:"p-3 text-center"},Hf={class:"text-xs text-gray-400"},qf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Gf={key:1,class:"mt-1 text-xs text-red-600"},Xf={key:2,class:"mt-1 text-xs text-gray-500"},_i=e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const H=o.label||o.placeholder;return H?`app-infinite-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),h=e.ref([]),m=e.ref(!1),g=e.ref(!1),b=e.ref(-1),x=e.ref(1),p=e.ref(!0),E=e.ref(0),w=e.ref(),{floatingStyles:C}=Va(c,d,{placement:"bottom-start",whileElementsMounted:Ea,middleware:[Ba(4),Sa(),_a(),Aa({apply({rects:H,elements:ae}){Object.assign(ae.floating.style,{width:`${H.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const _=e.computed(()=>f.value?h.value.filter(H=>A(H).toLowerCase().includes(f.value.toLowerCase())):h.value),B=e.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const H=h.value.find(ae=>V(ae)===o.modelValue);return H?A(H):String(o.modelValue)}}return""}),k=()=>{g.value=!0},y=()=>{g.value=!1},A=H=>typeof o.itemTitle=="function"?o.itemTitle(H):H[o.itemTitle]||"",V=H=>typeof o.itemValue=="function"?o.itemValue(H):H[o.itemValue]||H,M=H=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(H):H[o.itemSubtitle]||"":"",D=H=>o.modelValue?o.returnObject?V(H)===V(o.modelValue):V(H)===o.modelValue:!1,T=H=>{var Z;const ae=o.returnObject?H:V(H);r("update:modelValue",ae),r("select",H),g.value=!1,f.value="",(Z=s.value)==null||Z.blur()},P=()=>{var H;r("update:modelValue",null),f.value="",(H=s.value)==null||H.focus()},K=H=>{g.value=!0,r("focus",H),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&R(!0)},L=H=>{setTimeout(()=>{g.value=!1,r("blur",H)},200)},G=H=>{const ae=H.target;f.value=ae.value,w.value&&clearTimeout(w.value),w.value=setTimeout(()=>{r("search",f.value),x.value=1,p.value=!0,R(!0)},o.debounceMs)},Q=H=>{if(g.value)switch(H.key){case"ArrowDown":H.preventDefault(),b.value=Math.min(b.value+1,_.value.length-1);break;case"ArrowUp":H.preventDefault(),b.value=Math.max(b.value-1,0);break;case"Enter":H.preventDefault(),b.value>=0&&_.value[b.value]&&T(_.value[b.value]);break;case"Escape":g.value=!1;break}},X=H=>{if(!p.value||m.value)return;const ae=H.target,{scrollTop:Z,scrollHeight:J,clientHeight:ie}=ae;Z+ie>=J-o.threshold&&R()},R=async(H=!1)=>{var ae,Z;if(!m.value){m.value=!0;try{let J=[];if(o.fetchItems)J=await o.fetchItems();else{const ie=st(),de=((ae=o.endpoint)==null?void 0:ae.apiModule)||o.apiModule,Ee=((Z=o.endpoint)==null?void 0:Z.apiAction)||o.apiAction;if(!de||!Ee)throw new Error("API module and action are required");const Ne={page:H?1:x.value,pageSize:o.pageSize,search:f.value,...o.apiParams},ye=await ie.apiUrl(`/${de}/${Ee}`,"GET",Ne);J=ye.data||ye.items||ye||[],E.value=ye.total||ye.totalItems||J.length}H?(h.value=J,x.value=1):(h.value.push(...J),x.value++),p.value=J.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:J,page:x.value,hasMore:p.value,total:E.value})}catch(J){console.error("Error fetching items:",J),r("error",J)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&R()}),e.onUnmounted(()=>{w.value&&clearTimeout(w.value)}),e.watch(()=>o.modelValue,H=>{H||(f.value="")}),(H,ae)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Sf)):e.createCommentVNode("",!0),ae[3]||(ae[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Vf,"*")):e.createCommentVNode("",!0)],8,Af)):e.createCommentVNode("",!0),e.createElementVNode("div",Df,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Nf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},H.$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",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:B.value,onFocus:K,onBlur:L,onInput:G,onKeydown:Q}),null,16,Mf),m.value?(e.openBlock(),e.createElementBlock("svg",vf,[...ae[4]||(ae[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.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:ae[0]||(ae[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(P,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.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:t.disabled,onClick:ae[1]||(ae[1]=Z=>g.value?y():k()),"aria-label":"Toggle"},[e.createVNode(e.unref(le.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,Pf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(C)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:X},[m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Tf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Z=>e.createElementVNode("div",{key:Z,class:"flex items-center space-x-3"},[...ae[5]||(ae[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):_.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,(Z,J)=>(e.openBlock(),e.createElementBlock("button",{key:V(Z)??J,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",J===b.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ie=>b.value=J,onMousedown:ae[2]||(ae[2]=e.withModifiers(()=>{},["prevent"])),onClick:ie=>T(Z)},[e.renderSlot(H.$slots,"item",{item:Z,index:J},()=>[e.createElementVNode("div",Ff,[e.createElementVNode("div",zf,[e.createElementVNode("div",If,e.toDisplayString(A(Z)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Rf,e.toDisplayString(M(Z)),1)):e.createCommentVNode("",!0)])])]),D(Z)?(e.openBlock(),e.createElementBlock("span",Lf," ✓ ")):e.createCommentVNode("",!0)],42,Of))),128)):e.createCommentVNode("",!0),m.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",$f,[e.createElementVNode("div",jf,[ae[6]||(ae[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Wf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",Uf,[e.createElementVNode("div",Hf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",qf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Gf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Xf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,_f)),[[e.vShow,t.visible]])}});function Si(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=Si(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Ai(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Si(t))&&(r&&(r+=" "),r+=n);return r}const Kf=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},Yf=(t,n)=>({classGroupId:t,validator:n}),Vi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),ar="-",Di=[],Jf="arbitrary..",Qf=t=>{const n=eh(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Zf(i);const l=i.split(ar),c=l[0]===""&&l.length>1?1:0;return Ni(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?Kf(d,c):c:d||Di}return o[i]||Di}}},Ni=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=Ni(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(ar):t.slice(n).join(ar),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Zf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?Jf+r:void 0})(),eh=t=>{const{theme:n,classGroups:o}=t;return th(o,n)},th=(t,n)=>{const o=Vi();for(const r in t){const a=t[r];Da(a,o,r,n)}return o},Da=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];nh(i,n,o,r)}},nh=(t,n,o,r)=>{if(typeof t=="string"){oh(t,n,o);return}if(typeof t=="function"){rh(t,n,o,r);return}ah(t,n,o,r)},oh=(t,n,o)=>{const r=t===""?n:Mi(n,t);r.classGroupId=o},rh=(t,n,o,r)=>{if(sh(t)){Da(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Yf(o,t))},ah=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];Da(c,Mi(n,l),o,r)}},Mi=(t,n)=>{let o=t;const r=n.split(ar),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Vi(),o.nextPart.set(i,l)),o=l}return o},sh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,ih=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},Na="!",vi=":",lh=[],Pi=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),ch=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let b=0;b<u;b++){const x=a[b];if(i===0&&l===0){if(x===vi){s.push(a.slice(c,b)),c=b+1;continue}if(x==="/"){d=b;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const f=s.length===0?a:a.slice(c);let h=f,m=!1;f.endsWith(Na)?(h=f.slice(0,-1),m=!0):f.startsWith(Na)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Pi(s,m,h,g)};if(n){const a=n+vi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Pi(lh,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},dh=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},uh=t=>({cache:ih(t.cacheSize),parseClassName:ch(t),sortModifiers:dh(t),...Qf(t)}),fh=/\s+/,hh=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(fh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let x=!!b,p=r(x?g.substring(0,b):g);if(!p){if(!x){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}x=!1}const E=h.length===0?"":h.length===1?h[0]:s(h).join(":"),w=m?E+Na:E,C=w+p;if(i.indexOf(C)>-1)continue;i.push(C);const _=a(p,x);for(let B=0;B<_.length;++B){const k=_[B];i.push(w+k)}c=u+(c.length>0?" "+c:c)}return c},mh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=Ti(o))&&(a&&(a+=" "),a+=r);return a},Ti=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=Ti(t[r]))&&(o&&(o+=" "),o+=n);return o},ph=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=uh(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=hh(c,o);return a(c,u),u};return s=i,(...c)=>s(mh(...c))},gh=[],lt=t=>{const n=o=>o[t]||gh;return n.isThemeGetter=!0,n},Oi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xh=/\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$/,kh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gn=t=>bh.test(t),Te=t=>!!t&&!Number.isNaN(Number(t)),bn=t=>!!t&&Number.isInteger(Number(t)),Ma=t=>t.endsWith("%")&&Te(t.slice(0,-1)),on=t=>yh.test(t),zi=()=>!0,Eh=t=>xh.test(t)&&!kh.test(t),va=()=>!1,Bh=t=>wh.test(t),_h=t=>Ch.test(t),Sh=t=>!me(t)&&!ge(t),Ah=t=>yn(t,Wi,va),me=t=>Oi.test(t),vn=t=>yn(t,Ui,Eh),Ii=t=>yn(t,Oh,Te),Vh=t=>yn(t,qi,zi),Dh=t=>yn(t,Hi,va),Ri=t=>yn(t,$i,va),Nh=t=>yn(t,ji,_h),sr=t=>yn(t,Gi,Bh),ge=t=>Fi.test(t),wo=t=>Pn(t,Ui),Mh=t=>Pn(t,Hi),Li=t=>Pn(t,$i),vh=t=>Pn(t,Wi),Ph=t=>Pn(t,ji),ir=t=>Pn(t,Gi,!0),Th=t=>Pn(t,qi,!0),yn=(t,n,o)=>{const r=Oi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},Pn=(t,n,o=!1)=>{const r=Fi.exec(t);return r?r[1]?n(r[1]):o:!1},$i=t=>t==="position"||t==="percentage",ji=t=>t==="image"||t==="url",Wi=t=>t==="length"||t==="size"||t==="bg-size",Ui=t=>t==="length",Oh=t=>t==="number",Hi=t=>t==="family-name",qi=t=>t==="number"||t==="weight",Gi=t=>t==="shadow",Fh=ph(()=>{const t=lt("color"),n=lt("font"),o=lt("text"),r=lt("font-weight"),a=lt("tracking"),s=lt("leading"),i=lt("breakpoint"),l=lt("container"),c=lt("spacing"),d=lt("radius"),u=lt("shadow"),f=lt("inset-shadow"),h=lt("text-shadow"),m=lt("drop-shadow"),g=lt("blur"),b=lt("perspective"),x=lt("aspect"),p=lt("ease"),E=lt("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"],_=()=>[...C(),ge,me],B=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],y=()=>[ge,me,c],A=()=>[gn,"full","auto",...y()],V=()=>[bn,"none","subgrid",ge,me],M=()=>["auto",{span:["full",bn,ge,me]},bn,ge,me],D=()=>[bn,"auto",ge,me],T=()=>["auto","min","max","fr",ge,me],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...y()],G=()=>[gn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],Q=()=>[gn,"screen","full","dvw","lvw","svw","min","max","fit",...y()],X=()=>[gn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...y()],R=()=>[t,ge,me],H=()=>[...C(),Li,Ri,{position:[ge,me]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",vh,Ah,{size:[ge,me]}],J=()=>[Ma,wo,vn],ie=()=>["","none","full",d,ge,me],de=()=>["",Te,wo,vn],Ee=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Te,Ma,Li,Ri],te=()=>["","none",g,ge,me],O=()=>["none",Te,ge,me],Y=()=>["none",Te,ge,me],se=()=>[Te,ge,me],xe=()=>[gn,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[on],breakpoint:[on],color:[zi],container:[on],"drop-shadow":[on],ease:["in","out","in-out"],font:[Sh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[on],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[on],shadow:[on],spacing:["px",Te],text:[on],"text-shadow":[on],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gn,me,ge,x]}],container:["container"],columns:[{columns:[Te,me,ge,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:_()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],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:[bn,"auto",ge,me]}],basis:[{basis:[gn,"full","auto",l,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,gn,"auto","initial","none",me]}],grow:[{grow:["",Te,ge,me]}],shrink:[{shrink:["",Te,ge,me]}],order:[{order:[bn,"first","last","none",ge,me]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pbs:[{pbs:y()}],pbe:[{pbe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",o,wo,vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Th,Vh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ma,me]}],"font-family":[{font:[Mh,Dh,n]}],"font-features":[{"font-features":[me]}],"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:[a,ge,me]}],"line-clamp":[{"line-clamp":[Te,"none",ge,Ii]}],leading:[{leading:[s,...y()]}],"list-image":[{"list-image":["none",ge,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ge,vn]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Te,"auto",ge,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,me]}],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",ge,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bn,ge,me],radial:["",ge,me],conic:[bn,ge,me]},Ph,Nh]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ee(),"hidden","none"]}],"divide-style":[{divide:[...Ee(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ge,me]}],"outline-w":[{outline:["",Te,wo,vn]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,ir,sr]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",f,ir,sr]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Te,vn]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",h,ir,sr]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Te,ge,me]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ge,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,me]}],filter:[{filter:["","none",ge,me]}],blur:[{blur:te()}],brightness:[{brightness:[Te,ge,me]}],contrast:[{contrast:[Te,ge,me]}],"drop-shadow":[{"drop-shadow":["","none",m,ir,sr]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Te,ge,me]}],"hue-rotate":[{"hue-rotate":[Te,ge,me]}],invert:[{invert:["",Te,ge,me]}],saturate:[{saturate:[Te,ge,me]}],sepia:[{sepia:["",Te,ge,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,me]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ge,me]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ge,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ge,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ge,me]}],"backdrop-invert":[{"backdrop-invert":["",Te,ge,me]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ge,me]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ge,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ge,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ge,me]}],ease:[{ease:["linear","initial",p,ge,me]}],delay:[{delay:[Te,ge,me]}],animate:[{animate:["none",E,ge,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ge,me]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[ge,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",ge,me]}],"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":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mbs":[{"scroll-mbs":y()}],"scroll-mbe":[{"scroll-mbe":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pbs":[{"scroll-pbs":y()}],"scroll-pbe":[{"scroll-pbe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"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",ge,me]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Te,wo,vn,Ii]}],stroke:[{stroke:["none",...R()]}],"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 Fe(...t){return Fh(Ai(t))}function Xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pa={},Ta={},lr={exports:{}},Ki;function zh(){if(Ki)return lr.exports;Ki=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return lr.exports=n(),lr.exports.createColors=n,lr.exports}var Yi;function Ih(){return Yi||(Yi=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(zh());function a(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 r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(Ta)),Ta}var Ji;function Rh(){return Ji||(Ji=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Ih());function o(s){return s&&s.__esModule?s:{default:s}}function r({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 a={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 r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Pa)),Pa}var Oa,Qi;function Lh(){if(Qi)return Oa;Qi=1;let t=Rh();return Oa=(t.__esModule?t:{default:t}).default,Oa}var $h=Lh();const jh=Xi($h),Zi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,el=Ai,cr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return el(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Zi(u)||Zi(f);return a[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||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,f,h]:d},[]);return el(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},jt=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(Fe)(e.unref(Yn)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Yn=cr("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"}}),tl=e.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(t,{emit:n}){const o=t,r=n,a=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),nl=e.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(t,{emit:n}){const o=t,r=n,a=et.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Fe)("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:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),ol=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),rl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Wh={class:"relative z-10"},Uh="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] 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",Hh=e.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(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&It[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Z=String(o.variant||"default").toLowerCase();return Z==="tonal"?"secondary":Z==="elevated"?"default":Z}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Z,...J}=n;return J}),u=e.computed(()=>Fe(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=e.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=e.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"),x=e.computed(()=>Fe("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=e.computed(()=>{const J=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),E=e.computed(()=>{const J=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),w=e.computed(()=>!!p.value),C=e.computed(()=>/\bborder-/.test(u.value??"")),_=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const Z=u.value??"";return i.value!=="outline"?Z:Z.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=e.ref(null),y=Z=>{const J=Z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return J?{r:Number(J[1]),g:Number(J[2]),b:Number(J[3]),a:J[4]?Number(J[4]):1}:null},A=(Z,J)=>{const ie=y(Z);if(!ie)return Z;const de=Ee=>Math.max(0,Math.min(255,Math.round(Ee)));return`rgba(${de(ie.r*(1-J))}, ${de(ie.g*(1-J))}, ${de(ie.b*(1-J))}, ${ie.a})`},V=Z=>{if(globalThis.window===void 0)return null;const J=document.createElement("div");J.className=Z,J.style.position="absolute",J.style.visibility="hidden",J.style.pointerEvents="none",J.style.width="1px",J.style.height="1px",document.body.appendChild(J);const ie=globalThis.getComputedStyle(J).backgroundColor;return J.remove(),!ie||ie==="transparent"||ie==="rgba(0, 0, 0, 0)"?null:ie},M=[50,100,200,300,400,500,600,700,800,900,950],D=Z=>{const J=M.indexOf(Z);return J===-1?Z:M[Math.min(M.length-1,J+2)]},T=(Z,J)=>{const ie=jh[Z];if(!ie)return null;if(typeof ie=="string")return ie;if(!J)return null;const de=ie[J];return typeof de=="string"?de:null},P=(Z,J=!1)=>{if(!Z)return null;const ie=J?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,de=Z.match(ie);return de?{colorName:de[1],shade:de[2]?Number.parseInt(de[2],10):null}:null},K=()=>{const Z=p.value;if(!Z){k.value=null;return}const J=P(Z),ie=J==null?void 0:J.colorName,de=(J==null?void 0:J.shade)??null,Ee=(ie?T(ie,de):null)??V(Z);if(!Ee){k.value=null;return}let Ne;const ye=P(E.value,!0),te=ye?T(ye.colorName,ye.shade??null):null;if(te)Ne=te;else if(ie&&de){const O=D(de);Ne=T(ie,O)??A(Ee,.2)}else Ne=A(Ee,.2);k.value={"--btn-color":Ee,"--btn-color-hover":Ne}};e.onMounted(()=>{K()}),e.watch([p,E],async()=>{await e.nextTick(),K()});const L=e.computed(()=>{const Z=/\bdark:bg-/.test(u.value??"");return!w.value||i.value==="outline"||Z?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":_.value?"":"hover:brightness-90"}),G=e.computed(()=>{if(!w.value||i.value!=="outline")return"";const Z=["dcode-btn--outline","dcode-btn--outline-hover"];return C.value||Z.push("border"),!k.value&&!_.value&&Z.push("hover:brightness-90"),Z.join(" ")}),Q=e.computed(()=>k.value??void 0),X={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"}},R={"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"}},H=e.computed(()=>{const Z=[],J=l.value,ie=String(o.borderColor||"").toLowerCase(),de=J?X[J]:null,Ee=J?R[J]:null,Ne=ie?X[ie]:null;return J&&(de?Ne&&ie!==J?(Z.push(de.bg,Ne.hoverBg),o.textColor||Z.push(de.text,Ne.hoverText)):(Z.push(de.bg,de.hoverBg),o.textColor||Z.push(de.text,de.hoverText)):Ee?(Z.push(Ee.bg,Ee.hover),o.textColor||Z.push(Ee.text)):J==="transparent"?Ne?(Z.push("bg-transparent",Ne.hoverBg),o.textColor||Z.push("text-inherit",Ne.hoverText)):Z.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Z.push(J)),ie?Ne?Z.push(Ne.border,Ne.hoverBorder):Z.push(ie):de&&i.value!=="ghost"&&i.value!=="link"&&Z.push(de.border,de.hoverBorder),o.textColor&&Z.push(o.textColor),Z.join(" ")}),ae=e.computed(()=>Fe(Uh,g.value,b.value,B.value,L.value,G.value,H.value));return(Z,J)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(ol),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(tl),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(rl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(jt),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:Q.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(nl),{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:e.withCtx(()=>[e.createElementVNode("span",Wh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(jt),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:Q.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Z.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),Et=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Ye=Et(Hh,[["__scopeId","data-v-fed1b675"]]),qh={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Gh={class:"flex flex-col gap-1"},Xh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},Kh={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},Yh={key:0,class:"flex items-center gap-2"},Jh={name:"DCodeCard"},al=e.defineComponent({...Jh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",qh,[e.createElementVNode("div",Gh,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Xh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Kh,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Yh,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),Qh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Zh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},em={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},tm={class:"flex items-center justify-between"},nm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},om={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},rm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},am={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},sm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},im={class:"flex items-center justify-between"},lm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},cm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},dm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Fa=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=vt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",Qh,[e.createElementVNode("div",Zh,[e.createElementVNode("div",em,[e.createElementVNode("div",tm,[e.createElementVNode("h3",nm,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",om,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",rm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",am,[e.createElementVNode("div",sm,[e.createElementVNode("div",im,[e.createElementVNode("h3",lm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",cm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",dm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),um=["aria-busy"],fm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},hm={key:1,class:"flex justify-end"},mm=["for"],pm={key:0,class:"ml-1 text-destructive"},gm={class:"relative w-full group"},bm={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},ym={key:1},xm=["id","value","placeholder"],km={key:1,class:"absolute inset-y-0 right-4 flex items-center"},wm={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Cm={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"},Em={key:1,class:"text-xs text-destructive"},Jn=e.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(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var O;return((O=l.valueType)==null?void 0:O.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const O=o.required,Y=o["aria-required"];return O===""||O===!0||O==="true"||(Y==="true"||Y===!0)}),h=e.computed(()=>{const{label:O,class:Y,id:se,required:xe,"aria-required":Ae,...Re}=o;return Re}),m=e.computed(()=>{var Y,se;const O={...h.value};return((Y=l.valueType)==null?void 0:Y.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((se=l.valueType)==null?void 0:se.toLowerCase())==="email"&&(O.type="email",O.inputmode="email"),r.value&&(O.type=a.value?"text":"password"),l.disabled&&(O.disabled=!0),l.maxLength&&(O.maxlength=l.maxLength),l.minLength&&(O.minlength=l.minLength),l.maxValue&&(O.max=l.maxValue),l.minValue&&(O.min=l.minValue),O}),g=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),b=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),x=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,O=>{const Y=String(O??"");Y!==p.value&&(p.value=Y)});const E=e.ref(!1),w=e.ref(!1),C=O=>O.split(/(\s+)/).map(Y=>{if(Y.trim()==="")return Y;const se=Y.toLowerCase();return se.charAt(0).toUpperCase()+se.slice(1)}).join(""),_=O=>{const Y=O.toLowerCase(),se=Y.search(new RegExp("\\p{L}","u"));return se<0?Y:Y.slice(0,se)+Y.charAt(se).toUpperCase()+Y.slice(se+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return C(O);case"sentencecase":return _(O);case"none":default:return O}},k=O=>{if(!O)return null;const Y=Array.isArray(O)?O.join(""):O;return Y?new Set(Y):null},y=e.computed(()=>k(l.allowChars)),A=(O,Y)=>(O.lastIndex=0,O.test(Y)),V=O=>{var je;const Y=(je=l.valueType)==null?void 0:je.toLowerCase();if(Y==="free"||Y==="email"||Y==="password")return!0;const se=O===" ",xe=/\d/.test(O),Ae=new RegExp("\\p{L}","u").test(O),Re=new RegExp("\\p{N}","u").test(O),Ve=/[\/\-_.,]/.test(O);return Y==="number"?xe:Y==="letter"?Ae||Ve||l.allowSpaces&&se:Y==="letternumber"?Ae||Re||Ve||l.allowSpaces&&se:!0},M=O=>{let Y="";for(const se of O){const xe=!!y.value&&y.value.has(se);l.pattern&&!xe&&!A(l.pattern,se)||!xe&&!V(se)||(Y+=se)}return Y},D=e.computed(()=>{const O=l.maxLength??o.maxlength??o.maxLength;let Y=Number.NaN;return typeof O=="number"?Y=O:typeof O=="string"&&(Y=Number.parseInt(O,10)),Number.isFinite(Y)&&Y>0?Y:-1}),T=e.computed(()=>p.value.length),P=e.computed(()=>l.showCharCount?D.value>0:!1),K=O=>D.value>0?O.slice(0,D.value):O,L=O=>{const Y=M(O),se=l.applyTextCaseToValue?B(Y):Y;return K(se)};let G=null;const Q=O=>{var Y;if(O==="")return null;if(((Y=l.valueType)==null?void 0:Y.toLowerCase())==="number"&&l.returnNumber){const se=Number(O);return Number.isFinite(se)?se:null}return O},X=O=>{p.value=O,i("update:modelValue",Q(O))},R=(O,Y)=>{const se=K(Y);w.value=!0,O.value=se,X(se),queueMicrotask(()=>w.value=!1)},H=(O,Y)=>{const se=O.selectionStart??O.value.length,xe=O.selectionEnd??O.value.length;if(D.value>0){const Ae=O.value.length-(xe-se),Re=D.value-Ae;if(Re<=0)return;Y=Y.slice(0,Re)}O.setRangeText(Y,se,xe,"end"),R(O,L(O.value))},ae=O=>{var xe;if(!G||E.value||w.value||!((xe=O.inputType)!=null&&xe.startsWith("insert")))return;const Y=O.data;if(Y==null)return;const se=L(Y);se!==Y&&(O.preventDefault(),se.length>0&&H(G,se))},Z=O=>{var xe;if(!G||E.value||w.value)return;const Y=((xe=O.clipboardData)==null?void 0:xe.getData("text"))??"",se=L(Y);se!==Y&&(O.preventDefault(),se.length>0&&H(G,se))},J=O=>{if(!G||E.value||w.value)return;const Y=O.target,se=Y.value??"",xe=L(se);xe===se?X(xe):R(Y,xe)},ie=()=>E.value=!0,de=()=>{if(E.value=!1,!G)return;const O=G.value??"",Y=L(O);Y===O?X(Y):R(G,Y)};e.onMounted(()=>{if(G=document.getElementById(u.value),!G)return;G.addEventListener("beforeinput",ae),G.addEventListener("paste",Z),G.addEventListener("input",J),G.addEventListener("compositionstart",ie),G.addEventListener("compositionend",de);const O=G.value??"",Y=L(O);Y===O?X(Y):R(G,Y)}),e.onBeforeUnmount(()=>{G&&(G.removeEventListener("beforeinput",ae),G.removeEventListener("paste",Z),G.removeEventListener("input",J),G.removeEventListener("compositionstart",ie),G.removeEventListener("compositionend",de),G=null)});const Ee=()=>{p.value="",G&&(G.value=""),i("update:modelValue",null),i("clear")},Ne=e.computed(()=>P.value&&T.value>0),ye=e.computed(()=>`${T.value} / ${D.value}`),te=e.computed(()=>!!l.error);return(O,Y)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",fm)):e.createCommentVNode("",!0),Y[1]||(Y[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),P.value?(e.openBlock(),e.createElementBlock("div",hm,[...Y[0]||(Y[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",pm,"*")):e.createCommentVNode("",!0)],8,mm)):e.createCommentVNode("",!0),e.createElementVNode("div",gm,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",bm,[e.renderSlot(O.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${x.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${b.value||r.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-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 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:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,xm),r.value?(e.openBlock(),e.createElementBlock("div",km,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(le.Eye):e.unref(le.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),b.value&&!r.value?(e.openBlock(),e.createElementBlock("div",wm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:Ee}," ✕ ")])):e.createCommentVNode("",!0),Ne.value&&!te.value?(e.openBlock(),e.createElementBlock("p",Cm,e.toDisplayString(ye.value),1)):e.createCommentVNode("",!0)]),te.value?(e.openBlock(),e.createElementBlock("p",Em,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,um)),[[e.vShow,t.visible]])}}),Bm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},_m={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Sm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Am={class:"flex items-center justify-between"},Vm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Dm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},Nm={class:"p-6 flex-1"},Mm={class:"flex flex-col gap-4"},vm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Pm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Tm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Om={class:"flex items-center justify-between"},Fm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},zm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},Im={class:"p-6 flex-1"},Rm={class:"flex flex-col gap-4"},Lm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},za=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=vt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",Bm,[e.createElementVNode("div",_m,[e.createElementVNode("div",Sm,[e.createElementVNode("div",Am,[e.createElementVNode("h3",Vm,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",Dm,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Nm,[e.createElementVNode("div",Mm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(Jn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",vm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Pm,[e.createElementVNode("div",Tm,[e.createElementVNode("div",Om,[e.createElementVNode("h3",Fm,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",zm,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Im,[e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(Jn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Lm,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
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 yo(t){return t+.5|0}const fn=(t,n,o)=>Math.max(Math.min(t,o),n);function xo(t){return fn(yo(t*2.55),0,255)}function hn(t){return fn(yo(t*255),0,255)}function Yt(t){return fn(yo(t/2.55)/100,0,1)}function el(t){return fn(yo(t*100),0,100)}const St={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},Ta=[..."0123456789ABCDEF"],Om=t=>Ta[t&15],Fm=t=>Ta[(t&240)>>4]+Ta[t&15],ar=t=>(t&240)>>4===(t&15),zm=t=>ar(t.r)&&ar(t.g)&&ar(t.b)&&ar(t.a);function Im(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&St[t[1]]*17,g:255&St[t[2]]*17,b:255&St[t[3]]*17,a:n===5?St[t[4]]*17:255}:(n===7||n===9)&&(o={r:St[t[1]]<<4|St[t[2]],g:St[t[3]]<<4|St[t[4]],b:St[t[5]]<<4|St[t[6]],a:n===9?St[t[7]]<<4|St[t[8]]:255})),o}const Rm=(t,n)=>t<255?n(t):"";function Lm(t){var n=zm(t)?Om:Fm;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Rm(t.a,n):void 0}const $m=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tl(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function jm(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function Wm(t,n,o){const r=tl(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function Um(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function Oa(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),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=Um(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Fa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(hn)}function za(t,n,o){return Fa(tl,t,n,o)}function Hm(t,n,o){return Fa(Wm,t,n,o)}function qm(t,n,o){return Fa(jm,t,n,o)}function nl(t){return(t%360+360)%360}function Gm(t){const n=$m.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?xo(+n[5]):hn(+n[5]));const a=nl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=Hm(a,s,i):n[1]==="hsv"?r=qm(a,s,i):r=za(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function Xm(t,n){var o=Oa(t);o[0]=nl(o[0]+n),o=za(o),t.r=o[0],t.g=o[1],t.b=o[2]}function Km(t){if(!t)return;const n=Oa(t),o=n[0],r=el(n[1]),a=el(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${Yt(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const ol={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"},rl={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 Ym(){const t={},n=Object.keys(rl),o=Object.keys(ol);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,ol[s]);s=parseInt(rl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let sr;function Jm(t){sr||(sr=Ym(),sr.transparent=[0,0,0,0]);const n=sr[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const Qm=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Zm(t){const n=Qm.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?xo(i):fn(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?xo(r):fn(r,0,255)),a=255&(n[4]?xo(a):fn(a,0,255)),s=255&(n[6]?xo(s):fn(s,0,255)),{r,g:a,b:s,a:o}}}function ep(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Yt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ia=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function tp(t,n,o){const r=Xn(Yt(t.r)),a=Xn(Yt(t.g)),s=Xn(Yt(t.b));return{r:hn(Ia(r+o*(Xn(Yt(n.r))-r))),g:hn(Ia(a+o*(Xn(Yt(n.g))-a))),b:hn(Ia(s+o*(Xn(Yt(n.b))-s))),a:t.a+o*(n.a-t.a)}}function ir(t,n,o){if(t){let r=Oa(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=za(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function al(t,n){return t&&Object.assign(n||{},t)}function sl(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=hn(t[3]))):(n=al(t,{r:0,g:0,b:0,a:1}),n.a=hn(n.a)),n}function np(t){return t.charAt(0)==="r"?Zm(t):Gm(t)}class ko{constructor(n){if(n instanceof ko)return n;const o=typeof n;let r;o==="object"?r=sl(n):o==="string"&&(r=Im(n)||Jm(n)||np(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=al(this._rgb);return n&&(n.a=Yt(n.a)),n}set rgb(n){this._rgb=sl(n)}rgbString(){return this._valid?ep(this._rgb):void 0}hexString(){return this._valid?Lm(this._rgb):void 0}hslString(){return this._valid?Km(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=tp(this._rgb,n._rgb,o)),this}clone(){return new ko(this.rgb)}alpha(n){return this._rgb.a=hn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=yo(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 ir(this._rgb,2,n),this}darken(n){return ir(this._rgb,2,-n),this}saturate(n){return ir(this._rgb,1,n),this}desaturate(n){return ir(this._rgb,1,-n),this}rotate(n){return Xm(this._rgb,n),this}}/*!
6
+ */function Co(t){return t+.5|0}const xn=(t,n,o)=>Math.max(Math.min(t,o),n);function Eo(t){return xn(Co(t*2.55),0,255)}function kn(t){return xn(Co(t*255),0,255)}function rn(t){return xn(Co(t/2.55)/100,0,1)}function sl(t){return xn(Co(t*100),0,100)}const Pt={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},Ia=[..."0123456789ABCDEF"],$m=t=>Ia[t&15],jm=t=>Ia[(t&240)>>4]+Ia[t&15],dr=t=>(t&240)>>4===(t&15),Wm=t=>dr(t.r)&&dr(t.g)&&dr(t.b)&&dr(t.a);function Um(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&Pt[t[1]]*17,g:255&Pt[t[2]]*17,b:255&Pt[t[3]]*17,a:n===5?Pt[t[4]]*17:255}:(n===7||n===9)&&(o={r:Pt[t[1]]<<4|Pt[t[2]],g:Pt[t[3]]<<4|Pt[t[4]],b:Pt[t[5]]<<4|Pt[t[6]],a:n===9?Pt[t[7]]<<4|Pt[t[8]]:255})),o}const Hm=(t,n)=>t<255?n(t):"";function qm(t){var n=Wm(t)?$m:jm;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Hm(t.a,n):void 0}const Gm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function il(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function Xm(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function Km(t,n,o){const r=il(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function Ym(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function Ra(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),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=Ym(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function La(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(kn)}function $a(t,n,o){return La(il,t,n,o)}function Jm(t,n,o){return La(Km,t,n,o)}function Qm(t,n,o){return La(Xm,t,n,o)}function ll(t){return(t%360+360)%360}function Zm(t){const n=Gm.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?Eo(+n[5]):kn(+n[5]));const a=ll(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=Jm(a,s,i):n[1]==="hsv"?r=Qm(a,s,i):r=$a(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function ep(t,n){var o=Ra(t);o[0]=ll(o[0]+n),o=$a(o),t.r=o[0],t.g=o[1],t.b=o[2]}function tp(t){if(!t)return;const n=Ra(t),o=n[0],r=sl(n[1]),a=sl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${rn(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const cl={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"},dl={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 np(){const t={},n=Object.keys(dl),o=Object.keys(cl);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,cl[s]);s=parseInt(dl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let ur;function op(t){ur||(ur=np(),ur.transparent=[0,0,0,0]);const n=ur[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const rp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ap(t){const n=rp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?Eo(i):xn(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?Eo(r):xn(r,0,255)),a=255&(n[4]?Eo(a):xn(a,0,255)),s=255&(n[6]?Eo(s):xn(s,0,255)),{r,g:a,b:s,a:o}}}function sp(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${rn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ja=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Qn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ip(t,n,o){const r=Qn(rn(t.r)),a=Qn(rn(t.g)),s=Qn(rn(t.b));return{r:kn(ja(r+o*(Qn(rn(n.r))-r))),g:kn(ja(a+o*(Qn(rn(n.g))-a))),b:kn(ja(s+o*(Qn(rn(n.b))-s))),a:t.a+o*(n.a-t.a)}}function fr(t,n,o){if(t){let r=Ra(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=$a(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function ul(t,n){return t&&Object.assign(n||{},t)}function fl(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=kn(t[3]))):(n=ul(t,{r:0,g:0,b:0,a:1}),n.a=kn(n.a)),n}function lp(t){return t.charAt(0)==="r"?ap(t):Zm(t)}class Bo{constructor(n){if(n instanceof Bo)return n;const o=typeof n;let r;o==="object"?r=fl(n):o==="string"&&(r=Um(n)||op(n)||lp(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=ul(this._rgb);return n&&(n.a=rn(n.a)),n}set rgb(n){this._rgb=fl(n)}rgbString(){return this._valid?sp(this._rgb):void 0}hexString(){return this._valid?qm(this._rgb):void 0}hslString(){return this._valid?tp(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=ip(this._rgb,n._rgb,o)),this}clone(){return new Bo(this.rgb)}alpha(n){return this._rgb.a=kn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=Co(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 fr(this._rgb,2,n),this}darken(n){return fr(this._rgb,2,-n),this}saturate(n){return fr(this._rgb,1,n),this}desaturate(n){return fr(this._rgb,1,-n),this}rotate(n){return ep(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 Jt(){}const op=(()=>{let t=0;return()=>t++})();function Ie(t){return t==null}function ot(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Me(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ut(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Lt(t,n){return ut(t)?t:n}function Ae(t,n){return typeof t>"u"?n:t}const rp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,il=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function qe(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Le(t,n,o,r){let a,s,i;if(ot(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Me(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function lr(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function cr(t){if(ot(t))return t.map(cr);if(Me(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=cr(t[o[a]]);return n}return t}function ll(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function ap(t,n,o,r){if(!ll(t))return;const a=n[t],s=o[t];Me(a)&&Me(s)?wo(a,s,r):n[t]=cr(s)}function wo(t,n,o){const r=ot(n)?n:[n],a=r.length;if(!Me(t))return t;o=o||{};const s=o.merger||ap;let i;for(let l=0;l<a;++l){if(i=r[l],!Me(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function Co(t,n){return wo(t,n,{merger:sp})}function sp(t,n,o){if(!ll(t))return;const r=n[t],a=o[t];Me(r)&&Me(a)?Co(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=cr(a))}const cl={"":t=>t,x:t=>t.x,y:t=>t.y};function ip(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function lp(t){const n=ip(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Dn(t,n){return(cl[n]||(cl[n]=lp(n)))(t)}function Ra(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Eo=t=>typeof t<"u",mn=t=>typeof t=="function",dl=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function cp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const $e=Math.PI,Ke=2*$e,dp=Ke+$e,dr=Number.POSITIVE_INFINITY,up=$e/180,st=$e/2,Nn=$e/4,ul=$e*2/3,fl=Math.log10,$t=Math.sign;function Bo(t,n,o){return Math.abs(t-n)<o}function hl(t){const n=Math.round(t);t=Bo(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(fl(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function fp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function hp(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function _o(t){return!hp(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function mp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function pp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function Qt(t){return t*($e/180)}function gp(t){return t*(180/$e)}function ml(t){if(!ut(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function pl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*$e&&(s+=Ke),{angle:s,distance:a}}function La(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function bp(t,n){return(t-n+dp)%Ke-$e}function Ct(t){return(t%Ke+Ke)%Ke}function So(t,n,o,r){const a=Ct(t),s=Ct(n),i=Ct(o),l=Ct(s-a),c=Ct(i-a),d=Ct(a-s),u=Ct(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function ft(t,n,o){return Math.max(n,Math.min(o,t))}function yp(t){return ft(t,-32768,32767)}function Zt(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function $a(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const Mn=(t,n,o,r)=>$a(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),xp=(t,n,o)=>$a(t,o,r=>t[r][n]>=o);function kp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const gl=["push","pop","shift","splice","unshift"];function wp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),gl.forEach(o=>{const r="_onData"+Ra(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function bl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(gl.forEach(s=>{delete t[s]}),delete t._chartjs)}function yl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const xl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function kl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,xl.call(window,()=>{r=!1,t.apply(n,o)}))}}function Cp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const ja=t=>t==="start"?"left":t==="end"?"right":"center",ht=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Ep=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Bp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(Mn(c,u,f).lo,o?r:Mn(n,u,i.getPixelForValue(f)).lo),d){const y=c.slice(0,a+1).reverse().findIndex(k=>!Ie(k[l.axis]));a-=Math.max(0,y)}a=ft(a,0,r-1)}if(g){let y=Math.max(Mn(c,i.axis,h,!0).hi+1,o?0:Mn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const k=c.slice(y-1).findIndex(p=>!Ie(p[l.axis]));y+=Math.max(0,k)}s=ft(y,a,r)-a}else s=r-a}return{start:a,count:s}}function _p(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const ur=t=>t===0||t===1,wl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*Ke/o)),Cl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*Ke/o)+1,Ao={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*st)+1,easeOutSine:t=>Math.sin(t*st),easeInOutSine:t=>-.5*(Math.cos($e*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>ur(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ur(t)?t:wl(t,.075,.3),easeOutElastic:t=>ur(t)?t:Cl(t,.075,.3),easeInOutElastic(t){return ur(t)?t:t<.5?.5*wl(t*2,.1125,.45):.5+.5*Cl(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Ao.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Ao.easeInBounce(t*2)*.5:Ao.easeOutBounce(t*2-1)*.5+.5};function Wa(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function El(t){return Wa(t)?t:new ko(t)}function Ua(t){return Wa(t)?t:new ko(t).saturate(.5).darken(.1).hexString()}const Sp=["x","y","borderWidth","radius","tension"],Ap=["color","borderColor","backgroundColor"];function Vp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:Ap},numbers:{type:"number",properties:Sp}}),t.describe("animations",{_fallback:"animation"}),t.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 Dp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Bl=new Map;function Np(t,n){n=n||{};const o=t+JSON.stringify(n);let r=Bl.get(o);return r||(r=new Intl.NumberFormat(t,n),Bl.set(o,r)),r}function Ha(t,n,o){return Np(n,o).format(t)}const Mp={values(t){return ot(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;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)&&(a="scientific"),s=vp(t,o)}const i=fl(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Ha(t,r,c)}};function vp(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var _l={formatters:Mp};function Pp(t){t.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:_l.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const vn=Object.create(null),qa=Object.create(null);function Vo(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function Ga(t,n,o){return typeof n=="string"?wo(Vo(t,n),o):wo(Vo(t,""),n)}class Tp{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=r=>r.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=(r,a)=>Ua(a.backgroundColor),this.hoverBorderColor=(r,a)=>Ua(a.borderColor),this.hoverColor=(r,a)=>Ua(a.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 Ga(this,n,o)}get(n){return Vo(this,n)}describe(n,o){return Ga(qa,n,o)}override(n,o){return Ga(vn,n,o)}route(n,o,r,a){const s=Vo(this,n),i=Vo(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Me(c)?Object.assign({},d,c):Ae(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var Ze=new Tp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Vp,Dp,Pp]);function Op(t){return!t||Ie(t.size)||Ie(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Sl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Pn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function Al(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Xa(t,n,o,r){Vl(t,n,o,r,null)}function Vl(t,n,o,r,a){let s,i,l,c,d,u,f,h;const m=n.pointStyle,g=n.rotation,y=n.radius;let k=(g||0)*up;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(k),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(y)||y<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,y,0,0,Ke):t.arc(o,r,y,0,Ke),t.closePath();break;case"triangle":u=a?a/2:y,t.moveTo(o+Math.sin(k)*u,r-Math.cos(k)*y),k+=ul,t.lineTo(o+Math.sin(k)*u,r-Math.cos(k)*y),k+=ul,t.lineTo(o+Math.sin(k)*u,r-Math.cos(k)*y),t.closePath();break;case"rectRounded":d=y*.516,c=y-d,i=Math.cos(k+Nn)*c,f=Math.cos(k+Nn)*(a?a/2-d:c),l=Math.sin(k+Nn)*c,h=Math.sin(k+Nn)*(a?a/2-d:c),t.arc(o-f,r-l,d,k-$e,k-st),t.arc(o+h,r-i,d,k-st,k),t.arc(o+f,r+l,d,k,k+st),t.arc(o-h,r+i,d,k+st,k+$e),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*y,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}k+=Nn;case"rectRot":f=Math.cos(k)*(a?a/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(a?a/2:y),t.moveTo(o-f,r-l),t.lineTo(o+h,r-i),t.lineTo(o+f,r+l),t.lineTo(o-h,r+i),t.closePath();break;case"crossRot":k+=Nn;case"cross":f=Math.cos(k)*(a?a/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(a?a/2:y),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"star":f=Math.cos(k)*(a?a/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(a?a/2:y),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i),k+=Nn,f=Math.cos(k)*(a?a/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(a?a/2:y),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"line":i=a?a/2:Math.cos(k)*y,l=Math.sin(k)*y,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(k)*(a?a/2:y),r+Math.sin(k)*y);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Do(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function fr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function hr(t){t.restore()}function Fp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function zp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Ip(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),Ie(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Rp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Lp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function No(t,n,o,r,a,s={}){const i=ot(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Ip(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Lp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Ie(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Rp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function mr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*$e,$e,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,$e,st,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,st,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-st,!0),t.lineTo(o+i.topLeft,r)}const $p=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,jp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Wp(t,n){const o=(""+t).match($p);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const Up=t=>+t||0;function Ka(t,n){const o={},r=Me(n),a=r?Object.keys(n):n,s=Me(t)?r?i=>Ae(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Up(s(i));return o}function Dl(t){return Ka(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Kn(t){return Ka(t,["topLeft","topRight","bottomLeft","bottomRight"])}function At(t){const n=Dl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function mt(t,n){t=t||{},n=n||Ze.font;let o=Ae(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Ae(t.style,n.style);r&&!(""+r).match(jp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Ae(t.family,n.family),lineHeight:Wp(Ae(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Ae(t.weight,n.weight),string:""};return a.string=Op(a),a}function pr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function Hp(t,n,o){const{min:r,max:a}=t,s=il(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Tn(t,n){return Object.assign(Object.create(t),n)}function Ya(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Tl("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>Ya([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Ml(l,c,()=>Zp(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Ol(l).includes(c)},ownKeys(l){return Ol(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function Yn(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Nl(t,r),setContext:s=>Yn(t,s,o,r),override:s=>Yn(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Ml(s,i,()=>Gp(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Nl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:mn(o)?o:()=>o,isIndexable:mn(r)?r:()=>r}}const qp=(t,n)=>t?t+Ra(n):n,Ja=(t,n)=>Me(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Ml(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function Gp(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return mn(l)&&i.isScriptable(n)&&(l=Xp(n,l,t,o)),ot(l)&&l.length&&(l=Kp(n,l,t,i.isIndexable)),Ja(n,l)&&(l=Yn(l,a,s&&s[n],i)),l}function Xp(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),Ja(t,c)&&(c=Qa(a._scopes,a,t,c)),c}function Kp(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Me(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=Qa(d,a,t,u);n.push(Yn(f,s,i&&i[t],l))}}return n}function vl(t,n,o){return mn(t)?t(n,o):t}const Yp=(t,n)=>t===!0?n:typeof t=="string"?Dn(n,t):void 0;function Jp(t,n,o,r,a){for(const s of n){const i=Yp(o,s);if(i){t.add(i);const l=vl(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function Qa(t,n,o,r){const a=n._rootScopes,s=vl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Pl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Pl(l,i,s,c,r),c===null)?!1:Ya(Array.from(l),[""],a,s,()=>Qp(n,o,r))}function Pl(t,n,o,r,a){for(;o;)o=Jp(t,n,o,r,a);return o}function Qp(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return ot(a)&&Me(o)?o:a||{}}function Zp(t,n,o,r){let a;for(const s of n)if(a=Tl(qp(s,t),o),typeof a<"u")return Ja(t,a)?Qa(o,r,t,a):a}function Tl(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Ol(t){let n=t._keys;return n||(n=t._keys=eg(t._scopes)),n}function eg(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const tg=Number.EPSILON||1e-14,Jn=(t,n)=>n<t.length&&!t[n].skip&&t[n],Fl=t=>t==="x"?"y":"x";function ng(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=La(s,a),c=La(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,h=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+h*(i.x-a.x),y:s.y+h*(i.y-a.y)}}}function og(t,n,o){const r=t.length;let a,s,i,l,c,d=Jn(t,0);for(let u=0;u<r-1;++u)if(c=d,d=Jn(t,u+1),!(!c||!d)){if(Bo(n[u],0,tg)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function rg(t,n,o="x"){const r=Fl(o),a=t.length;let s,i,l,c=Jn(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=Jn(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function ag(t,n="x"){const o=Fl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=Jn(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=Jn(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?$t(a[i-1])!==$t(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}og(t,a,s),rg(t,s,n)}function gr(t,n,o){return Math.max(Math.min(t,o),n)}function sg(t,n){let o,r,a,s,i,l=Do(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Do(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=gr(a.cp1x,n.left,n.right),a.cp1y=gr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=gr(a.cp2x,n.left,n.right),a.cp2y=gr(a.cp2y,n.top,n.bottom)))}function ig(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")ag(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=ng(d,l,t[Math.min(s+1,i-(r?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&&sg(t,o)}function Za(){return typeof window<"u"&&typeof document<"u"}function es(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function br(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const yr=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function lg(t,n){return yr(t).getPropertyValue(n)}const cg=["top","right","bottom","left"];function On(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=cg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const dg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function ug(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(dg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Fn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=yr(o),s=a.boxSizing==="border-box",i=On(a,"padding"),l=On(a,"border","width"),{x:c,y:d,box:u}=ug(t,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/r),y:Math.round((d-h)/g*o.height/r)}}function fg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&es(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=yr(s),c=On(l,"border","width"),d=On(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=br(l.maxWidth,s,"clientWidth"),a=br(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||dr,maxHeight:a||dr}}const pn=t=>Math.round(t*10)/10;function hg(t,n,o,r){const a=yr(t),s=On(a,"margin"),i=br(a.maxWidth,t,"clientWidth")||dr,l=br(a.maxHeight,t,"clientHeight")||dr,c=fg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const h=On(a,"border","width"),m=On(a,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=pn(Math.min(d,i,c.maxWidth)),u=pn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=pn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=pn(Math.floor(u*r))),{width:d,height:u}}function zl(t,n,o){const r=n||1,a=pn(t.height*r),s=pn(t.width*r);t.height=pn(t.height),t.width=pn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const mg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};Za()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Il(t,n){const o=lg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function zn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function pg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function gg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=zn(t,a,o),l=zn(a,s,o),c=zn(s,n,o),d=zn(i,l,o),u=zn(l,c,o);return zn(d,u,o)}const bg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},yg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function Qn(t,n,o){return t?bg(n,o):yg()}function Rl(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function Ll(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function $l(t){return t==="angle"?{between:So,compare:bp,normalize:Ct}:{between:Zt,compare:(n,o)=>n-o,normalize:n=>n}}function jl({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function xg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=$l(r),c=n.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][r]),a,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Wl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=$l(r),{start:u,end:f,loop:h,style:m}=xg(t,n,o),g=[];let y=!1,k=null,p,E,C;const w=()=>c(a,C,p)&&l(a,C)!==0,_=()=>l(s,p)===0||c(s,C,p),B=()=>y||w(),x=()=>!y||_();for(let b=u,S=u;b<=f;++b)E=n[b%i],!E.skip&&(p=d(E[r]),p!==C&&(y=c(p,a,s),k===null&&B()&&(k=l(p,a)===0?b:S),k!==null&&x()&&(g.push(jl({start:k,end:b,loop:h,count:i,style:m})),k=null),S=b,C=p));return k!==null&&g.push(jl({start:k,end:f,loop:h,count:i,style:m})),g}function Ul(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Wl(r[a],t.points,n);s.length&&o.push(...s)}return o}function kg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function wg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function Cg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=kg(o,a,s,r);if(r===!0)return Hl(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return Hl(t,wg(o,i,c,d),o,n)}function Hl(t,n,o,r){return!r||!r.setContext||!o?n:Eg(t,n,o,r)}function Eg(t,n,o,r){const a=t._chart.getContext(),s=ql(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(g,y,k,p){const E=l?-1:1;if(g!==y){for(g+=c;o[g%c].skip;)g-=E;for(;o[y%c].skip;)y+=E;g%c!==y%c&&(d.push({start:g%c,end:y%c,loop:k,style:p}),u=p,f=y%c)}}for(const g of n){f=l?f:g.start;let y=o[f%c],k;for(h=f+1;h<=g.end;h++){const p=o[h%c];k=ql(r.setContext(Tn(a,{type:"segment",p0:y,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Bg(k,u)&&m(f,h-1,g.loop,u),y=p,u=k}f<h-1&&m(f,h-1,g.loop,u)}return d}function ql(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Bg(t,n){if(!n)return!1;const o=[],r=function(a,s){return Wa(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function xr(t,n,o){return t.options.clip?t[o]:n[o]}function _g(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:xr(o,n,"left"),right:xr(o,n,"right"),top:xr(r,n,"top"),bottom:xr(r,n,"bottom")}:n}function Gl(t,n){const o=n._clip;if(o.disabled)return!1;const r=_g(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
11
+ */function an(){}const cp=(()=>{let t=0;return()=>t++})();function We(t){return t==null}function it(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function ze(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ft(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Gt(t,n){return ft(t)?t:n}function Pe(t,n){return typeof t>"u"?n:t}const dp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,hl=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function Je(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Ge(t,n,o,r){let a,s,i;if(it(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(ze(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function hr(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function mr(t){if(it(t))return t.map(mr);if(ze(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=mr(t[o[a]]);return n}return t}function ml(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function up(t,n,o,r){if(!ml(t))return;const a=n[t],s=o[t];ze(a)&&ze(s)?_o(a,s,r):n[t]=mr(s)}function _o(t,n,o){const r=it(n)?n:[n],a=r.length;if(!ze(t))return t;o=o||{};const s=o.merger||up;let i;for(let l=0;l<a;++l){if(i=r[l],!ze(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function So(t,n){return _o(t,n,{merger:fp})}function fp(t,n,o){if(!ml(t))return;const r=n[t],a=o[t];ze(r)&&ze(a)?So(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=mr(a))}const pl={"":t=>t,x:t=>t.x,y:t=>t.y};function hp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function mp(t){const n=hp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Tn(t,n){return(pl[n]||(pl[n]=mp(n)))(t)}function Wa(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ao=t=>typeof t<"u",wn=t=>typeof t=="function",gl=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function pp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Xe=Math.PI,Ze=2*Xe,gp=Ze+Xe,pr=Number.POSITIVE_INFINITY,bp=Xe/180,ct=Xe/2,On=Xe/4,bl=Xe*2/3,yl=Math.log10,Xt=Math.sign;function Vo(t,n,o){return Math.abs(t-n)<o}function xl(t){const n=Math.round(t);t=Vo(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(yl(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function yp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function xp(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Do(t){return!xp(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function kp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function wp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function sn(t){return t*(Xe/180)}function Cp(t){return t*(180/Xe)}function kl(t){if(!ft(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function wl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Xe&&(s+=Ze),{angle:s,distance:a}}function Ua(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Ep(t,n){return(t-n+gp)%Ze-Xe}function Bt(t){return(t%Ze+Ze)%Ze}function No(t,n,o,r){const a=Bt(t),s=Bt(n),i=Bt(o),l=Bt(s-a),c=Bt(i-a),d=Bt(a-s),u=Bt(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function ht(t,n,o){return Math.max(n,Math.min(o,t))}function Bp(t){return ht(t,-32768,32767)}function ln(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function Ha(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const Fn=(t,n,o,r)=>Ha(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),_p=(t,n,o)=>Ha(t,o,r=>t[r][n]>=o);function Sp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const Cl=["push","pop","shift","splice","unshift"];function Ap(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Cl.forEach(o=>{const r="_onData"+Wa(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function El(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(Cl.forEach(s=>{delete t[s]}),delete t._chartjs)}function Bl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const _l=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Sl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,_l.call(window,()=>{r=!1,t.apply(n,o)}))}}function Vp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const qa=t=>t==="start"?"left":t==="end"?"right":"center",mt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Dp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Np(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(Fn(c,u,f).lo,o?r:Fn(n,u,i.getPixelForValue(f)).lo),d){const b=c.slice(0,a+1).reverse().findIndex(x=>!We(x[l.axis]));a-=Math.max(0,b)}a=ht(a,0,r-1)}if(g){let b=Math.max(Fn(c,i.axis,h,!0).hi+1,o?0:Fn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const x=c.slice(b-1).findIndex(p=>!We(p[l.axis]));b+=Math.max(0,x)}s=ht(b,a,r)-a}else s=r-a}return{start:a,count:s}}function Mp(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const gr=t=>t===0||t===1,Al=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*Ze/o)),Vl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*Ze/o)+1,Mo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*ct)+1,easeOutSine:t=>Math.sin(t*ct),easeInOutSine:t=>-.5*(Math.cos(Xe*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>gr(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>gr(t)?t:Al(t,.075,.3),easeOutElastic:t=>gr(t)?t:Vl(t,.075,.3),easeInOutElastic(t){return gr(t)?t:t<.5?.5*Al(t*2,.1125,.45):.5+.5*Vl(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Mo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Mo.easeInBounce(t*2)*.5:Mo.easeOutBounce(t*2-1)*.5+.5};function Ga(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function Dl(t){return Ga(t)?t:new Bo(t)}function Xa(t){return Ga(t)?t:new Bo(t).saturate(.5).darken(.1).hexString()}const vp=["x","y","borderWidth","radius","tension"],Pp=["color","borderColor","backgroundColor"];function Tp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:Pp},numbers:{type:"number",properties:vp}}),t.describe("animations",{_fallback:"animation"}),t.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 Op(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Nl=new Map;function Fp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=Nl.get(o);return r||(r=new Intl.NumberFormat(t,n),Nl.set(o,r)),r}function Ka(t,n,o){return Fp(n,o).format(t)}const zp={values(t){return it(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;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)&&(a="scientific"),s=Ip(t,o)}const i=yl(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Ka(t,r,c)}};function Ip(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var Ml={formatters:zp};function Rp(t){t.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:Ml.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const zn=Object.create(null),Ya=Object.create(null);function vo(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function Ja(t,n,o){return typeof n=="string"?_o(vo(t,n),o):_o(vo(t,""),n)}class Lp{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=r=>r.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=(r,a)=>Xa(a.backgroundColor),this.hoverBorderColor=(r,a)=>Xa(a.borderColor),this.hoverColor=(r,a)=>Xa(a.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 Ja(this,n,o)}get(n){return vo(this,n)}describe(n,o){return Ja(Ya,n,o)}override(n,o){return Ja(zn,n,o)}route(n,o,r,a){const s=vo(this,n),i=vo(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return ze(c)?Object.assign({},d,c):Pe(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var rt=new Lp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Tp,Op,Rp]);function $p(t){return!t||We(t.size)||We(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function vl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function In(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function Pl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Qa(t,n,o,r){Tl(t,n,o,r,null)}function Tl(t,n,o,r,a){let s,i,l,c,d,u,f,h;const m=n.pointStyle,g=n.rotation,b=n.radius;let x=(g||0)*bp;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(x),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(b)||b<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,b,0,0,Ze):t.arc(o,r,b,0,Ze),t.closePath();break;case"triangle":u=a?a/2:b,t.moveTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=bl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=bl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),t.closePath();break;case"rectRounded":d=b*.516,c=b-d,i=Math.cos(x+On)*c,f=Math.cos(x+On)*(a?a/2-d:c),l=Math.sin(x+On)*c,h=Math.sin(x+On)*(a?a/2-d:c),t.arc(o-f,r-l,d,x-Xe,x-ct),t.arc(o+h,r-i,d,x-ct,x),t.arc(o+f,r+l,d,x,x+ct),t.arc(o-h,r+i,d,x+ct,x+Xe),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*b,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}x+=On;case"rectRot":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+h,r-i),t.lineTo(o+f,r+l),t.lineTo(o-h,r+i),t.closePath();break;case"crossRot":x+=On;case"cross":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"star":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i),x+=On,f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"line":i=a?a/2:Math.cos(x)*b,l=Math.sin(x)*b,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(x)*(a?a/2:b),r+Math.sin(x)*b);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Po(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function br(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function yr(t){t.restore()}function jp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Wp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Up(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),We(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Hp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function qp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function To(t,n,o,r,a,s={}){const i=it(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Up(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&qp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),We(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Hp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function xr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Xe,Xe,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Xe,ct,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,ct,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-ct,!0),t.lineTo(o+i.topLeft,r)}const Gp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Xp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Kp(t,n){const o=(""+t).match(Gp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const Yp=t=>+t||0;function Za(t,n){const o={},r=ze(n),a=r?Object.keys(n):n,s=ze(t)?r?i=>Pe(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Yp(s(i));return o}function Ol(t){return Za(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Zn(t){return Za(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Tt(t){const n=Ol(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function pt(t,n){t=t||{},n=n||rt.font;let o=Pe(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Pe(t.style,n.style);r&&!(""+r).match(Xp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Pe(t.family,n.family),lineHeight:Kp(Pe(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Pe(t.weight,n.weight),string:""};return a.string=$p(a),a}function kr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function Jp(t,n,o){const{min:r,max:a}=t,s=hl(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Rn(t,n){return Object.assign(Object.create(t),n)}function es(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Ll("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>es([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return zl(l,c,()=>ag(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return $l(l).includes(c)},ownKeys(l){return $l(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function eo(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Fl(t,r),setContext:s=>eo(t,s,o,r),override:s=>eo(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return zl(s,i,()=>Zp(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Fl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:wn(o)?o:()=>o,isIndexable:wn(r)?r:()=>r}}const Qp=(t,n)=>t?t+Wa(n):n,ts=(t,n)=>ze(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function zl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function Zp(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return wn(l)&&i.isScriptable(n)&&(l=eg(n,l,t,o)),it(l)&&l.length&&(l=tg(n,l,t,i.isIndexable)),ts(n,l)&&(l=eo(l,a,s&&s[n],i)),l}function eg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),ts(t,c)&&(c=ns(a._scopes,a,t,c)),c}function tg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(ze(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ns(d,a,t,u);n.push(eo(f,s,i&&i[t],l))}}return n}function Il(t,n,o){return wn(t)?t(n,o):t}const ng=(t,n)=>t===!0?n:typeof t=="string"?Tn(n,t):void 0;function og(t,n,o,r,a){for(const s of n){const i=ng(o,s);if(i){t.add(i);const l=Il(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ns(t,n,o,r){const a=n._rootScopes,s=Il(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Rl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Rl(l,i,s,c,r),c===null)?!1:es(Array.from(l),[""],a,s,()=>rg(n,o,r))}function Rl(t,n,o,r,a){for(;o;)o=og(t,n,o,r,a);return o}function rg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return it(a)&&ze(o)?o:a||{}}function ag(t,n,o,r){let a;for(const s of n)if(a=Ll(Qp(s,t),o),typeof a<"u")return ts(t,a)?ns(o,r,t,a):a}function Ll(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function $l(t){let n=t._keys;return n||(n=t._keys=sg(t._scopes)),n}function sg(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const ig=Number.EPSILON||1e-14,to=(t,n)=>n<t.length&&!t[n].skip&&t[n],jl=t=>t==="x"?"y":"x";function lg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=Ua(s,a),c=Ua(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,h=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+h*(i.x-a.x),y:s.y+h*(i.y-a.y)}}}function cg(t,n,o){const r=t.length;let a,s,i,l,c,d=to(t,0);for(let u=0;u<r-1;++u)if(c=d,d=to(t,u+1),!(!c||!d)){if(Vo(n[u],0,ig)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function dg(t,n,o="x"){const r=jl(o),a=t.length;let s,i,l,c=to(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=to(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function ug(t,n="x"){const o=jl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=to(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=to(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Xt(a[i-1])!==Xt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}cg(t,a,s),dg(t,s,n)}function wr(t,n,o){return Math.max(Math.min(t,o),n)}function fg(t,n){let o,r,a,s,i,l=Po(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Po(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=wr(a.cp1x,n.left,n.right),a.cp1y=wr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=wr(a.cp2x,n.left,n.right),a.cp2y=wr(a.cp2y,n.top,n.bottom)))}function hg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")ug(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=lg(d,l,t[Math.min(s+1,i-(r?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&&fg(t,o)}function os(){return typeof window<"u"&&typeof document<"u"}function rs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function Cr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const Er=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function mg(t,n){return Er(t).getPropertyValue(n)}const pg=["top","right","bottom","left"];function Ln(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=pg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const gg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function bg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(gg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function $n(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=Er(o),s=a.boxSizing==="border-box",i=Ln(a,"padding"),l=Ln(a,"border","width"),{x:c,y:d,box:u}=bg(t,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/r),y:Math.round((d-h)/g*o.height/r)}}function yg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&rs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Er(s),c=Ln(l,"border","width"),d=Ln(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=Cr(l.maxWidth,s,"clientWidth"),a=Cr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||pr,maxHeight:a||pr}}const Cn=t=>Math.round(t*10)/10;function xg(t,n,o,r){const a=Er(t),s=Ln(a,"margin"),i=Cr(a.maxWidth,t,"clientWidth")||pr,l=Cr(a.maxHeight,t,"clientHeight")||pr,c=yg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const h=Ln(a,"border","width"),m=Ln(a,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=Cn(Math.min(d,i,c.maxWidth)),u=Cn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Cn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=Cn(Math.floor(u*r))),{width:d,height:u}}function Wl(t,n,o){const r=n||1,a=Cn(t.height*r),s=Cn(t.width*r);t.height=Cn(t.height),t.width=Cn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const kg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};os()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Ul(t,n){const o=mg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function wg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function Cg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=jn(t,a,o),l=jn(a,s,o),c=jn(s,n,o),d=jn(i,l,o),u=jn(l,c,o);return jn(d,u,o)}const Eg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},Bg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function no(t,n,o){return t?Eg(n,o):Bg()}function Hl(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function ql(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function Gl(t){return t==="angle"?{between:No,compare:Ep,normalize:Bt}:{between:ln,compare:(n,o)=>n-o,normalize:n=>n}}function Xl({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function _g(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=Gl(r),c=n.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][r]),a,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Kl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=Gl(r),{start:u,end:f,loop:h,style:m}=_g(t,n,o),g=[];let b=!1,x=null,p,E,w;const C=()=>c(a,w,p)&&l(a,w)!==0,_=()=>l(s,p)===0||c(s,w,p),B=()=>b||C(),k=()=>!b||_();for(let y=u,A=u;y<=f;++y)E=n[y%i],!E.skip&&(p=d(E[r]),p!==w&&(b=c(p,a,s),x===null&&B()&&(x=l(p,a)===0?y:A),x!==null&&k()&&(g.push(Xl({start:x,end:y,loop:h,count:i,style:m})),x=null),A=y,w=p));return x!==null&&g.push(Xl({start:x,end:f,loop:h,count:i,style:m})),g}function Yl(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Kl(r[a],t.points,n);s.length&&o.push(...s)}return o}function Sg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function Ag(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function Vg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Sg(o,a,s,r);if(r===!0)return Jl(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return Jl(t,Ag(o,i,c,d),o,n)}function Jl(t,n,o,r){return!r||!r.setContext||!o?n:Dg(t,n,o,r)}function Dg(t,n,o,r){const a=t._chart.getContext(),s=Ql(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(g,b,x,p){const E=l?-1:1;if(g!==b){for(g+=c;o[g%c].skip;)g-=E;for(;o[b%c].skip;)b+=E;g%c!==b%c&&(d.push({start:g%c,end:b%c,loop:x,style:p}),u=p,f=b%c)}}for(const g of n){f=l?f:g.start;let b=o[f%c],x;for(h=f+1;h<=g.end;h++){const p=o[h%c];x=Ql(r.setContext(Rn(a,{type:"segment",p0:b,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Ng(x,u)&&m(f,h-1,g.loop,u),b=p,u=x}f<h-1&&m(f,h-1,g.loop,u)}return d}function Ql(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ng(t,n){if(!n)return!1;const o=[],r=function(a,s){return Ga(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Br(t,n,o){return t.options.clip?t[o]:n[o]}function Mg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Br(o,n,"left"),right:Br(o,n,"right"),top:Br(r,n,"top"),bottom:Br(r,n,"bottom")}:n}function Zl(t,n){const o=n._clip;if(o.disabled)return!1;const r=Mg(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.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 Sg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=xl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}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((r,a)=>Math.max(r,a._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 r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var en=new Sg;const Xl="transparent",Ag={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=El(t||Xl),a=r.valid&&El(n||Xl);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Vg{constructor(n,o,r,a){const s=o[r];a=pr([n.to,a,s,n.from]);const i=pr([n.from,s,a]);this._active=!0,this._fn=n.fn||Ag[n.type||typeof i],this._easing=Ao[n.easing]||Ao.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=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=pr([n.to,o,a,n.from]),this._from=pr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class Kl{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Me(n))return;const o=Object.keys(Ze.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Me(s))return;const i={};for(const l of o)i[l]=s[l];(ot(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Ng(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Dg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],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"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const h=r.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 Vg(h,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return en.add(this._chart,r),!0}}function Dg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Ng(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Yl(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function Mg(t,n,o){if(o===!1)return!1;const r=Yl(t,o),a=Yl(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function vg(t){let n,o,r,a;return Me(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function Jl(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function Ql(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],ut(d)&&(s||n===0||$t(n)===$t(d))&&(n+=d)}return!u&&!r.all?0:n}function Pg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function ts(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Tg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Og(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function Fg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function Zl(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function ec(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Tg(s,i,r),f=n.length;let h;for(let m=0;m<f;++m){const g=n[m],{[c]:y,[d]:k}=g,p=g._stacks||(g._stacks={});h=p[d]=Fg(a,u,y),h[l]=k,h._top=Zl(h,i,!0,r.type),h._bottom=Zl(h,i,!1,r.type);const E=h._visualValues||(h._visualValues={});E[l]=k}}function ns(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function zg(t,n){return Tn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Ig(t,n,o){return Tn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Mo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const os=t=>t==="reset"||t==="none",tc=(t,n)=>n?t:Object.assign({},t),Rg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:Jl(o,!0),values:null};class In{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=ts(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&&Mo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=Ae(r.xAxisID,ns(n,"x")),i=o.yAxisID=Ae(r.yAxisID,ns(n,"y")),l=o.rAxisID=Ae(r.rAxisID,ns(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(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&&bl(this._data,this),n._stacked&&Mo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Me(o)){const a=this._cachedMeta;this._data=Pg(o,a)}else if(r!==o){if(r){bl(r,this);const a=this._cachedMeta;Mo(a),a._parsed=[]}o&&Object.isExtensible(o)&&wp(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,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=ts(o.vScale,o),o.stack!==r.stack&&(a=!0,Mo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(ec(this,o._parsed),o._stacked=ts(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{ot(a[n])?h=this.parseArrayData(r,a,n,o):Me(a[n])?h=this.parseObjectData(r,a,n,o):h=this.parsePrimitiveData(r,a,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&ec(this,h)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let h,m,g;for(h=0,m=a;h<m;++h)g=h+r,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=o[h],d[u]={x:s.parse(Dn(m,l),h),y:i.parse(Dn(m,c),h)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:Jl(a,!0),values:o._stacks[n.axis]._visualValues};return Ql(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=Ql(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Rg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Og(l);let h,m;function g(){m=a[h];const y=m[l.axis];return!ut(m[n.axis])||u>y||f<y}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],ut(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=vg(Ae(this.options.clip,Mg(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[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 r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Ig(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=zg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,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",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Eo(r);if(l)return tc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ze.elements[n]),g=()=>this.getContext(r,a,o),y=d.resolveNamedOptions(h,m,g,f);return y.$shared&&(y.$shared=c,s[i]=Object.freeze(tc(y,c))),y}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.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,r,o))}const d=new Kl(a,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||os(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){os(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!os(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"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,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.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(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&Mo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}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 r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ye(In,"defaults",{}),ye(In,"datasetElementType",null),ye(In,"dataElementType",null);function Lg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=yl(r.sort((a,s)=>a-s))}return t._cache.$bar}function $g(t){const n=t.iScale,o=Lg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Eo(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function jg(t,n,o,r){const a=o.barThickness;let s,i;return Ie(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function Wg(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+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/r,ratio:o.barPercentage,start:d}}function Ug(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,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:a,end:s,min:i,max:l}}function nc(t,n,o,r){return ot(t)?Ug(t,n,o,r):n[o.axis]=o.parse(t,r),n}function oc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=o,u=o+r;d<u;++d)h=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(nc(h,f,s,d));return c}function rs(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Hg(t,n,o){return t!==0?$t(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function qg(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function Gg(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=qg(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[rc(u,i,l,c)]=!0,a=d)),s[rc(a,i,l,c)]=!0,t.borderSkipped=s}function rc(t,n,o,r){return r?(t=Xg(t,n,o),t=ac(t,o,n)):t=ac(t,n,o),t}function Xg(t,n,o){return t===n?o:t===o?n:t}function ac(t,n,o){return t==="start"?n:t==="end"?o:t}function Kg(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class kr extends In{parsePrimitiveData(n,o,r,a){return oc(n,o,r,a)}parseArrayData(n,o,r,a){return oc(n,o,r,a)}parseObjectData(n,o,r,a){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,g,y;for(h=r,m=r+a;h<m;++h)y=o[h],g={},g[s.axis]=s.parse(Dn(y,d),h),f.push(nc(Dn(y,u),g,i,h));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._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:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=rs(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.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,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),y=s||Ie(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),k=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],E={horizontal:d,base:y.base,enableBorderRadius:!p||rs(g._custom)||i===p._top||i===p._bottom,x:d?y.head:k.center,y:d?k.center:y.head,height:d?k.size:Math.abs(y.size),width:d?Math.abs(y.size):k.size};h&&(E.options=f||this.resolveDataElementOptions(m,n[m].active?"active":a));const C=E.options||n[m].options;Gg(E,C,p,i),Kg(E,C,u.ratio),this.updateElement(n[m],m,E,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(Ie(h)||isNaN(h))return!0};for(const u of a)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(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Ae(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||$g(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=rs(d);let f=c[o.axis],h=0,m=r?this.applyStack(o,c,r):f,g,y;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&$t(f)!==$t(d.barEnd)&&(h=0),h+=f);const k=!Ie(s)&&!u?s:h;let p=o.getPixelForValue(k);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(h+m):g=p,y=g-p,Math.abs(y)<i){y=Hg(y,o,l)*i,f===l&&(p-=y/2);const E=o.getPixelForDecimal(0),C=o.getPixelForDecimal(1),w=Math.min(E,C),_=Math.max(E,C);p=Math.max(Math.min(p,_),w),g=p+y,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const E=$t(y)*o.getLineWidthForValue(l)/2;p+=E,y-=E}return{size:y,base:p,head:g,center:g+y/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Ae(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?Wg(n,o,a,u*d):jg(n,o,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Ae(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*g+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.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,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}ye(kr,"id","bar"),ye(kr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ye(kr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Yg(t,n,o){let r=1,a=1,s=0,i=0;if(n<Ke){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(C,w,_)=>So(C,l,c,!0)?1:Math.max(w,w*o,_,_*o),g=(C,w,_)=>So(C,l,c,!0)?-1:Math.min(w,w*o,_,_*o),y=m(0,d,f),k=m(st,u,h),p=g($e,d,f),E=g($e+st,u,h);r=(y-p)/2,a=(k-E)/2,s=-(y+p)/2,i=-(k+E)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class Zn extends In{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 r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Me(r[n])){const{key:c="value"}=this._parsing;s=d=>+Dn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return Qt(this.options.rotation-90)}_getCircumference(){return Qt(this.options.circumference)}_getRotationExtents(){let n=Ke,o=-Ke;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._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:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(rp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:y}=Yg(f,u,c),k=(r.width-i)/h,p=(r.height-i)/m,E=Math.max(Math.min(k,p)/2,0),C=il(this.options.radius,E),w=Math.max(C*c,0),_=(C-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=y*C,a.total=this.calculateTotal(),this.outerRadius=C-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/Ke)}updateElements(n,o,r,a){const s=a==="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,g=h?0:this.outerRadius,{sharedOptions:y,includeOptions:k}=this._getSharedOptions(o,a);let p=this._getRotation(),E;for(E=0;E<o;++E)p+=this._circumference(E,s);for(E=o;E<o+r;++E){const C=this._circumference(E,s),w=n[E],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+C,circumference:C,outerRadius:g,innerRadius:m};k&&(_.options=y||this.resolveDataElementOptions(E,w.active?"active":a)),p+=C,this.updateElement(w,E,_,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?Ke*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=Ha(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Ae(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ye(Zn,"id","doughnut"),ye(Zn,"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"}),ye(Zn,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),ye(Zn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,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:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class wr extends In{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Bp(o,a,i);this._drawStart=l,this._drawCount=c,_p(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),h=i.axis,m=l.axis,{spanGaps:g,segment:y}=this.options,k=_o(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",E=o+r,C=n.length;let w=o>0&&this.getParsed(o-1);for(let _=0;_<C;++_){const B=n[_],x=p?B:{};if(_<o||_>=E){x.skip=!0;continue}const b=this.getParsed(_),S=Ie(b[m]),D=x[h]=i.getPixelForValue(b[h],_),M=x[m]=s||S?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],_);x.skip=isNaN(D)||isNaN(M)||S,x.stop=_>0&&Math.abs(b[h]-w[h])>k,y&&(x.parsed=b,x.raw=d.data[_]),f&&(x.options=u||this.resolveDataElementOptions(_,B.active?"active":a)),p||this.updateElement(B,_,x,a),w=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}ye(wr,"id","line"),ye(wr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ye(wr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class as extends Zn{}ye(as,"id","pie"),ye(as,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Rn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{constructor(n){ye(this,"options");this.options=n||{}}static override(n){Object.assign(ss.prototype,n)}init(){}formats(){return Rn()}parse(){return Rn()}format(){return Rn()}add(){return Rn()}diff(){return Rn()}startOf(){return Rn()}endOf(){return Rn()}}var Jg={_date:ss};function Qg(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?xp:Mn;if(r){if(a._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}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(y=>!Ie(y[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(y=>!Ie(y[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Cr(t,n,o,r,a){const s=t.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}=Qg(s[l],n,i,a);for(let m=f;m<=h;++m){const g=u[m];g.skip||r(g,d,m)}}}function Zg(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function is(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Cr(t,o,n,function(l,c,d){!a&&!Do(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function e0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=pl(i,{x:n.x,y:n.y});So(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Cr(t,o,n,s),a}function t0(t,n,o,r,a,s){let i=[];const l=Zg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const k=l(n,g);k<c?(i=[{element:u,datasetIndex:f,index:h}],c=k):k===c&&i.push({element:u,datasetIndex:f,index:h})}return Cr(t,o,n,d),i}function ls(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?e0(t,n,o,a):t0(t,n,o,r,a,s)}function sc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Cr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var n0={modes:{index(t,n,o,r){const a=Fn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?is(t,a,s,r,i):ls(t,a,s,!1,r,i),c=[];return l.length?(t.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(t,n,o,r){const a=Fn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?is(t,a,s,r,i):ls(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=Fn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return is(t,a,s,r,i)},nearest(t,n,o,r){const a=Fn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return ls(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Fn(n,t);return sc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Fn(n,t);return sc(t,a,"y",o.intersect,r)}}};const ic=["left","top","right","bottom"];function vo(t,n){return t.filter(o=>o.pos===n)}function lc(t,n){return t.filter(o=>ic.indexOf(o.pos)===-1&&o.box.axis===n)}function Po(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function o0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function r0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!ic.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function a0(t,n){const o=r0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function s0(t){const n=o0(t),o=Po(n.filter(d=>d.box.fullSize),!0),r=Po(vo(n,"left"),!0),a=Po(vo(n,"right")),s=Po(vo(n,"top"),!0),i=Po(vo(n,"bottom")),l=lc(n,"x"),c=lc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:vo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function cc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function dc(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function i0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Me(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&dc(i,s.getPadding());const l=Math.max(0,n.outerWidth-cc(i,t,"left","right")),c=Math.max(0,n.outerHeight-cc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function l0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function c0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function To(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,c0(l.horizontal,n));const{same:f,other:h}=i0(n,o,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&To(a,n,o,r)||u}function Er(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function uc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[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;Eo(d.start)&&(i=d.start),c.fullSize?Er(c,a.left,i,o.outerWidth-a.right-a.left,h):Er(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;Eo(d.start)&&(s=d.start),c.fullSize?Er(c,s,a.top,h,o.outerHeight-a.bottom-a.top):Er(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Vt={addBox(t,n){t.boxes||(t.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)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=At(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=s0(t.boxes),c=l.vertical,d=l.horizontal;Le(t.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=c.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);dc(h,At(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),g=a0(c.concat(d),f);To(l.fullSize,m,f,g),To(c,m,f,g),To(d,m,f,g)&&To(c,m,f,g),l0(m),uc(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,uc(l.rightAndBottom,m,f,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Le(l.chartArea,y=>{const k=y.box;Object.assign(k,t.chartArea),k.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class fc{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class d0 extends fc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const Br="$chartjs",u0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hc=t=>t===null||t==="";function f0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[Br]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",hc(a)){const s=Il(t,"width");s!==void 0&&(t.width=s)}if(hc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Il(t,"height");s!==void 0&&(t.height=s)}return t}const mc=mg?{passive:!0}:!1;function h0(t,n,o){t&&t.addEventListener(n,o,mc)}function m0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,mc)}function p0(t,n){const o=u0[t.type]||t.type,{x:r,y:a}=Fn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function _r(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function g0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||_r(l.addedNodes,r),i=i&&!_r(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function b0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||_r(l.removedNodes,r),i=i&&!_r(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Oo=new Map;let pc=0;function gc(){const t=window.devicePixelRatio;t!==pc&&(pc=t,Oo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function y0(t,n){Oo.size||window.addEventListener("resize",gc),Oo.set(t,n)}function x0(t){Oo.delete(t),Oo.size||window.removeEventListener("resize",gc)}function k0(t,n,o){const r=t.canvas,a=r&&es(r);if(!a)return;const s=kl((l,c)=>{const d=a.clientWidth;o(l,c),d<a.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(a),y0(t,s),i}function cs(t,n,o){o&&o.disconnect(),n==="resize"&&x0(t)}function w0(t,n,o){const r=t.canvas,a=kl(s=>{t.ctx!==null&&o(p0(s,t))},t);return h0(r,n,a),a}class C0 extends fc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(f0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[Br])return!1;const r=o[Br].initial;["height","width"].forEach(s=>{const i=r[s];Ie(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[Br],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:g0,detach:b0,resize:k0}[o]||w0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:cs,detach:cs,resize:cs}[o]||m0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return hg(n,o,r,a)}isAttached(n){const o=n&&es(n);return!!(o&&o.isConnected)}}function E0(t){return!Za()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?d0:C0}let tn=(aa=class{constructor(){ye(this,"x");ye(this,"y");ye(this,"active",!1);ye(this,"options");ye(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return _o(this.x)&&_o(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},ye(aa,"defaults",{}),ye(aa,"defaultRoutes"),aa);function B0(t,n){const o=t.options.ticks,r=_0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?A0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return V0(n,d,s,i/a),d;const u=S0(s,n,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Sr(n,d,u,Ie(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Sr(n,d,u,s[f],s[f+1]);return Sr(n,d,u,c,Ie(m)?n.length:c+m),d}return Sr(n,d,u),d}function _0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function S0(t,n,o){const r=D0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=fp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function A0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function V0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function Sr(t,n,o,r,a){const s=Ae(r,0),i=Math.min(Ae(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,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(t[d]),l++,u=Math.round(s+l*o))}function D0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const N0=t=>t==="left"?"right":t==="right"?"left":t,bc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,yc=(t,n)=>Math.min(n||t,t);function xc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function M0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function v0(t,n){Le(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Fo(t){return t.drawTicks?t.tickLength:0}function kc(t,n){if(!t.display)return 0;const o=mt(t.font,n),r=At(t.padding);return(ot(t.text)?t.text.length:1)*o.lineHeight+r.height}function P0(t,n){return Tn(t,{scale:n,type:"scale"})}function T0(t,n,o){return Tn(t,{tick:o,index:n,type:"tick"})}function O0(t,n,o){let r=ja(t);return(o&&n!=="right"||!o&&n==="right")&&(r=N0(r)),r}function F0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,g;const y=i-a,k=l-s;if(t.isHorizontal()){if(m=ht(r,s,l),Me(o)){const p=Object.keys(o)[0],E=o[p];g=u[p].getPixelForValue(E)+y-n}else o==="center"?g=(d.bottom+d.top)/2+y-n:g=bc(t,o,n);h=l-s}else{if(Me(o)){const p=Object.keys(o)[0],E=o[p];m=u[p].getPixelForValue(E)-k+n}else o==="center"?m=(d.left+d.right)/2-k+n:m=bc(t,o,n);g=ht(r,i,a),f=o==="left"?-st:st}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class eo extends tn{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:r,_suggestedMax:a}=this;return n=Lt(n,Number.POSITIVE_INFINITY),o=Lt(o,Number.NEGATIVE_INFINITY),r=Lt(r,Number.POSITIVE_INFINITY),a=Lt(a,Number.NEGATIVE_INFINITY),{min:Lt(n,r),max:Lt(o,a),minDefined:ut(n),maxDefined:ut(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:Lt(o,Lt(r,o)),max:Lt(r,Lt(o,r))}}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(){qe(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Hp(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?xc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=B0(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,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){qe(this.options.afterUpdate,[this])}beforeSetDimensions(){qe(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(){qe(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),qe(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){qe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=qe(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){qe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){qe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=yc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=ft(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-Fo(n.grid)-o.padding-kc(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=gp(Math.min(Math.asin(ft((u.highest.height+6)/l,-1,1)),Math.asin(ft(c/d,-1,1))-Math.asin(ft(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){qe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qe(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=kc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Fo(s)+c):(n.height=this.maxHeight,n.width=Fo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,g=Qt(this.labelRotation),y=Math.cos(g),k=Math.sin(g);if(l){const p=r.mirror?0:k*f.width+y*h.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:y*f.width+k*h.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,k,y)}}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,r,a){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=a*n.width,m=r*o.height):(h=r*n.height,m=a*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(){qe(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,r;for(o=0,r=n.length;o<r;o++)Ie(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=xc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/yc(o,r));let d=0,u=0,f,h,m,g,y,k,p,E,C,w,_;for(f=0;f<o;f+=c){if(g=n[f].label,y=this._resolveTickFontOptions(f),a.font=k=y.string,p=s[k]=s[k]||{data:{},gc:[]},E=y.lineHeight,C=w=0,!Ie(g)&&!ot(g))C=Sl(a,p.data,p.gc,C,g),w=E;else if(ot(g))for(h=0,m=g.length;h<m;++h)_=g[h],!Ie(_)&&!ot(_)&&(C=Sl(a,p.data,p.gc,C,_),w+=E);i.push(C),l.push(w),d=Math.max(C,d),u=Math.max(w,u)}v0(s,o);const B=i.indexOf(d),x=l.indexOf(u),b=S=>({width:i[S]||0,height:l[S]||0});return{first:b(0),last:b(o-1),widest:b(B),highest:b(x),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 yp(this._alignToPixels?Pn(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 r=o[n];return r.$context||(r.$context=T0(this.getContext(),n,r))}return this.$context||(this.$context=P0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=Qt(this.labelRotation),r=Math.abs(Math.cos(o)),a=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*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Fo(s),m=[],g=l.setContext(this.getContext()),y=g.display?g.width:0,k=y/2,p=function($){return Pn(r,$,y)};let E,C,w,_,B,x,b,S,D,M,N,P;if(i==="top")E=p(this.bottom),x=this.bottom-h,S=E-k,M=p(n.top)+k,P=n.bottom;else if(i==="bottom")E=p(this.top),M=n.top,P=p(n.bottom)-k,x=E+k,S=this.top+h;else if(i==="left")E=p(this.right),B=this.right-h,b=E-k,D=p(n.left)+k,N=n.right;else if(i==="right")E=p(this.left),D=n.left,N=p(n.right)-k,B=E+k,b=this.left+h;else if(o==="x"){if(i==="center")E=p((n.top+n.bottom)/2+.5);else if(Me(i)){const $=Object.keys(i)[0],H=i[$];E=p(this.chart.scales[$].getPixelForValue(H))}M=n.top,P=n.bottom,x=E+k,S=x+h}else if(o==="y"){if(i==="center")E=p((n.left+n.right)/2);else if(Me(i)){const $=Object.keys(i)[0],H=i[$];E=p(this.chart.scales[$].getPixelForValue(H))}B=E-k,b=B-h,D=n.left,N=n.right}const T=Ae(a.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/T));for(C=0;C<f;C+=K){const $=this.getContext(C),H=s.setContext($),ee=l.setContext($),q=H.lineWidth,R=H.color,j=ee.dash||[],ae=ee.dashOffset,Z=H.tickWidth,J=H.tickColor,le=H.tickBorderDash||[],ue=H.tickBorderDashOffset;w=M0(this,C,c),w!==void 0&&(_=Pn(r,w,q),d?B=b=D=N=_:x=S=M=P=_,m.push({tx1:B,ty1:x,tx2:b,ty2:S,x1:D,y1:M,x2:N,y2:P,width:q,color:R,borderDash:j,borderDashOffset:ae,tickWidth:Z,tickColor:J,tickBorderDash:le,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=E,m}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Fo(r.grid),m=h+u,g=f?-u:m,y=-Qt(this.labelRotation),k=[];let p,E,C,w,_,B,x,b,S,D,M,N,P="middle";if(a==="top")B=this.bottom-g,x=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+g,x=this._getXAxisLabelAlignment();else if(a==="left"){const K=this._getYAxisLabelAlignment(h);x=K.textAlign,_=K.x}else if(a==="right"){const K=this._getYAxisLabelAlignment(h);x=K.textAlign,_=K.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+m;else if(Me(a)){const K=Object.keys(a)[0],$=a[K];B=this.chart.scales[K].getPixelForValue($)+m}x=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")_=(n.left+n.right)/2-m;else if(Me(a)){const K=Object.keys(a)[0],$=a[K];_=this.chart.scales[K].getPixelForValue($)}x=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?P="top":c==="end"&&(P="bottom"));const T=this._getLabelSizes();for(p=0,E=l.length;p<E;++p){C=l[p],w=C.label;const K=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,S=this._resolveTickFontOptions(p),D=S.lineHeight,M=ot(w)?w.length:1;const $=M/2,H=K.color,ee=K.textStrokeColor,q=K.textStrokeWidth;let R=x;i?(_=b,x==="inner"&&(p===E-1?R=this.options.reverse?"left":"right":p===0?R=this.options.reverse?"right":"left":R="center"),a==="top"?d==="near"||y!==0?N=-M*D+D/2:d==="center"?N=-T.highest.height/2-$*D+D:N=-T.highest.height+D/2:d==="near"||y!==0?N=D/2:d==="center"?N=T.highest.height/2-$*D:N=T.highest.height-M*D,f&&(N*=-1),y!==0&&!K.showLabelBackdrop&&(_+=D/2*Math.sin(y))):(B=b,N=(1-M)*D/2);let j;if(K.showLabelBackdrop){const ae=At(K.backdropPadding),Z=T.heights[p],J=T.widths[p];let le=N-ae.top,ue=0-ae.left;switch(P){case"middle":le-=Z/2;break;case"bottom":le-=Z;break}switch(x){case"center":ue-=J/2;break;case"right":ue-=J;break;case"inner":p===E-1?ue-=J:p>0&&(ue-=J/2);break}j={left:ue,top:le,width:J+ae.width,height:Z+ae.height,color:K.backdropColor}}k.push({label:w,font:S,textOffset:N,options:{rotation:y,color:H,strokeColor:ee,strokeWidth:q,textAlign:R,textBaseline:P,translation:[_,B],backdrop:j}})}return k}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-Qt(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="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:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[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:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=Pn(n,this.left,i)-i/2,u=Pn(n,this.right,l)+l/2,f=h=c):(f=Pn(n,this.top,i)-i/2,h=Pn(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 r=this.ctx,a=this._computeLabelArea();a&&fr(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;No(r,d,0,u,c,l)}a&&hr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=mt(r.font),i=At(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Me(o)?(c+=i.bottom,ot(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=F0(this,c,o,l);No(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:O0(l,o,a),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,r=Ae(n.grid&&n.grid.z,-1),a=Ae(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==eo.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return mt(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Ar{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,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 r;R0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,z0(n,i,r),this.override&&Ze.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in Ze[a]&&(delete Ze[a][r],this.override&&delete vn[r])}}function z0(t,n,o){const r=wo(Object.create(null),[o?Ze.get(o):{},Ze.get(n),t.defaults]);Ze.set(n,r),t.defaultRoutes&&I0(n,t.defaultRoutes),t.descriptors&&Ze.describe(n,t.descriptors)}function I0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");Ze.route(s,a,c,l)})}function R0(t){return"id"in t&&"defaults"in t}class L0{constructor(){this.controllers=new Ar(In,"datasets",!0),this.elements=new Ar(tn,"elements"),this.plugins=new Ar(Object,"plugins"),this.scales=new Ar(eo,"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,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Le(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Ra(n);qe(r["before"+a],[],r),o[n](r),qe(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var jt=new L0;class $0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(qe(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){Ie(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 r=n&&n.config,a=Ae(r.options&&r.options.plugins,{}),s=j0(r);return a===!1&&!o?[]:U0(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function j0(t){const n={},o=[],r=Object.keys(jt.plugins.items);for(let s=0;s<r.length;s++)o.push(jt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function W0(t,n){return!n&&t===!1?null:t===!0?{}:t}function U0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=W0(r[c],a);d!==null&&s.push({plugin:l,options:H0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function H0(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ds(t,n){const o=Ze.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function q0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function G0(t,n){return t===n?"_index_":"_value_"}function wc(t){if(t==="x"||t==="y"||t==="r")return t}function X0(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function us(t,...n){if(wc(t))return t;for(const o of n){const r=o.axis||X0(o.position)||t.length>1&&wc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Cc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function K0(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return Cc(t,"x",o[0])||Cc(t,"y",o[0])}return{}}function Y0(t,n){const o=vn[t.type]||{scales:{}},r=n.scales||{},a=ds(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Me(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=us(i,l,K0(i,t),Ze.scales[l.type]),d=G0(c,a),u=o.scales||{};s[i]=Co(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||ds(l,n),u=(vn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=q0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Co(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Co(l,[Ze.scales[l.type],Ze.scale])}),s}function Ec(t){const n=t.options||(t.options={});n.plugins=Ae(n.plugins,{}),n.scales=Y0(t,n)}function Bc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function J0(t){return t=t||{},t.data=Bc(t.data),Ec(t),t}const _c=new Map,Sc=new Set;function Vr(t,n){let o=_c.get(t);return o||(o=n(),_c.set(t,o),Sc.add(o)),o}const zo=(t,n,o)=>{const r=Dn(n,o);r!==void 0&&t.add(r)};class Q0{constructor(n){this._config=J0(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=Bc(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(),Ec(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Vr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Vr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Vr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Vr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>zo(c,n,f))),u.forEach(f=>zo(c,a,f)),u.forEach(f=>zo(c,vn[s]||{},f)),u.forEach(f=>zo(c,Ze,f)),u.forEach(f=>zo(c,qa,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Sc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,vn[o]||{},Ze.datasets[o]||{},{type:o},Ze,qa]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Ac(this._resolverCache,n,a);let c=i;if(eb(i,o)){s.$shared=!1,r=mn(r)?r():r;const d=this.createResolver(n,r,l);c=Yn(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Ac(this._resolverCache,n,r);return Me(o)?Yn(s,o,void 0,a):s}}function Ac(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:Ya(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const Z0=t=>Me(t)&&Object.getOwnPropertyNames(t).some(n=>mn(t[n]));function eb(t,n){const{isScriptable:o,isIndexable:r}=Nl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(mn(l)||Z0(l))||i&&ot(l))return!0}return!1}var tb="4.5.1";const nb=["top","bottom","left","right","chartArea"];function Vc(t,n){return t==="top"||t==="bottom"||nb.indexOf(t)===-1&&n==="x"}function Dc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Nc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),qe(o&&o.onComplete,[t],n)}function ob(t){const n=t.chart,o=n.options.animation;qe(o&&o.onProgress,[t],n)}function Mc(t){return Za()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Dr={},vc=t=>{const n=Mc(t);return Object.values(Dr).filter(o=>o.canvas===n).pop()};function rb(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function ab(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class nn{static register(...n){jt.add(...n),Pc()}static unregister(...n){jt.remove(...n),Pc()}constructor(n,o){const r=this.config=new Q0(o),a=Mc(n),s=vc(a);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=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||E0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=op(),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 $0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],Dr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Nc),en.listen(this,"progress",ob),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return Ie(n)?o&&s?s:a?r/a: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 jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():zl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Al(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(n,o){en.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,zl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),qe(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Le(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=us(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Le(s,i=>{const l=i.options,c=l.id,d=us(c,l),u=Ae(l.type,i.dtype);(l.position===void 0||Vc(l.position,d)!==Vc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const h=jt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Le(a,(i,l)=>{i||delete r[l]}),Le(r,i=>{Vt.configure(this,i,i.options),Vt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Dc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||ds(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=jt.getController(l),{datasetElementType:d,dataElementType:u}=Ze.datasets[l];Object.assign(c,{dataElementType:jt.getElement(u),datasetElementType:d&&jt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Le(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 r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.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=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Le(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Dc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Le(this.scales,n=>{Vt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!dl(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;rb(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!dl(a,r(s)))return;return Array.from(a).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;Vt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Le(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,mn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Nc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}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,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}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,r={meta:n,index:n.index,cancelable:!0},a=Gl(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&fr(o,a),n.controller.draw(),a&&hr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Do(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=n0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={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},r.push(a)),a}getContext(){return this.$context||(this.$context=Tn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Eo(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a: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(),en.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(),Al(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete Dr[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,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Le(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(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=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Le(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Le(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=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}});!lr(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=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=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=cp(n),d=ab(n,this._lastEvent,r,c);r&&(this._lastEvent=null,qe(s.onHover,[n,l,this],this),c&&qe(s.onClick,[n,l,this],this));const u=!lr(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}ye(nn,"defaults",Ze),ye(nn,"instances",Dr),ye(nn,"overrides",vn),ye(nn,"registry",jt),ye(nn,"version",tb),ye(nn,"getChart",vc);function Pc(){return Le(nn.instances,t=>t._plugins.invalidate())}function sb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Ct(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const h=Math.min(d/l,Ct(r-o));t.arc(a,s,l+d/2,o-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Ct(r-o));if(u==="round")t.arc(a,s,h,o-$e/2,r+$e/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+$e/2)+a,y=-m*Math.sin(o+$e/2)+s,k=m*Math.cos(r+$e/2)+a,p=m*Math.sin(r+$e/2)+s;t.lineTo(g,y),t.lineTo(k,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function ib(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+st,r-st),t.closePath(),t.clip()}function lb(t){return Ka(t,["outerStart","outerEnd","innerStart","innerEnd"])}function cb(t,n,o,r){const a=lb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return ft(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:ft(a.innerStart,0,i),innerEnd:ft(a.innerEnd,0,i)}}function to(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Nr(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),h=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const K=u>0?u-r:0,$=f>0?f-r:0,H=(K+$)/2,ee=H!==0?g*H/(H+r):g;m=(g-ee)/2}const y=Math.max(.001,g*f-o/$e)/f,k=(g-y)/2,p=c+k+m,E=a-k-m,{outerStart:C,outerEnd:w,innerStart:_,innerEnd:B}=cb(n,h,f,E-p),x=f-C,b=f-w,S=p+C/x,D=E-w/b,M=h+_,N=h+B,P=p+_/M,T=E-B/N;if(t.beginPath(),s){const K=(S+D)/2;if(t.arc(i,l,f,S,K),t.arc(i,l,f,K,D),w>0){const q=to(b,D,i,l);t.arc(q.x,q.y,w,D,E+st)}const $=to(N,E,i,l);if(t.lineTo($.x,$.y),B>0){const q=to(N,T,i,l);t.arc(q.x,q.y,B,E+st,T+Math.PI)}const H=(E-B/h+(p+_/h))/2;if(t.arc(i,l,h,E-B/h,H,!0),t.arc(i,l,h,H,p+_/h,!0),_>0){const q=to(M,P,i,l);t.arc(q.x,q.y,_,P+Math.PI,p-st)}const ee=to(x,p,i,l);if(t.lineTo(ee.x,ee.y),C>0){const q=to(x,S,i,l);t.arc(q.x,q.y,C,p-st,S)}}else{t.moveTo(i,l);const K=Math.cos(S)*f+i,$=Math.sin(S)*f+l;t.lineTo(K,$);const H=Math.cos(D)*f+i,ee=Math.sin(D)*f+l;t.lineTo(H,ee)}t.closePath()}function db(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Nr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Ke||Ke))}return Nr(t,n,o,r,c,a),t.fill(),c}function ub(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let y=n.endAngle;if(s){Nr(t,n,o,r,y,a);for(let k=0;k<s;++k)t.stroke();isNaN(l)||(y=i+(l%Ke||Ke))}g&&ib(t,n,y),c.selfJoin&&y-i>=$e&&m===0&&u!=="miter"&&sb(t,n,y),s||(Nr(t,n,o,r,y,a),t.stroke())}class Io extends tn{constructor(o){super();ye(this,"circumference");ye(this,"endAngle");ye(this,"fullCircles");ye(this,"innerRadius");ye(this,"outerRadius");ye(this,"pixelMargin");ye(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,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=pl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=Ae(h,d-c),y=So(i,c,d)&&c!==d,k=g>=Ke||y,p=Zt(l,u+m,f+m);return k&&p}getCenterPoint(o){const{x:r,y:a,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:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Ke?Math.floor(a/Ke):0,a===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($e,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,db(o,this,u,i,l),ub(o,this,u,i,l),o.restore()}}ye(Io,"id","arc"),ye(Io,"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}),ye(Io,"defaultRoutes",{backgroundColor:"backgroundColor"}),ye(Io,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Tc(t,n,o=n){t.lineCap=Ae(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Ae(o.borderDash,n.borderDash)),t.lineDashOffset=Ae(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Ae(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Ae(o.borderWidth,n.borderWidth),t.strokeStyle=Ae(o.borderColor,n.borderColor)}function fb(t,n,o){t.lineTo(o.x,o.y)}function hb(t){return t.stepped?Fp:t.tension||t.cubicInterpolationMode==="monotone"?zp:fb}function Oc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function mb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Oc(a,o,r),u=hb(s);let{move:f=!0,reverse:h}=r||{},m,g,y;for(m=0;m<=d;++m)g=a[(l+(h?d-m:m))%i],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,y,g,h,s.stepped),y=g);return c&&(g=a[(l+(h?d:0))%i],u(t,y,g,h,s.stepped)),!!c}function pb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Oc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,g,y,k,p;const E=w=>(i+(d?l-w:w))%s,C=()=>{y!==k&&(t.lineTo(u,k),t.lineTo(u,y),t.lineTo(u,p))};for(c&&(m=a[E(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[E(h)],m.skip)continue;const w=m.x,_=m.y,B=w|0;B===g?(_<y?y=_:_>k&&(k=_),u=(f*u+w)/++f):(C(),t.lineTo(w,_),g=B,f=0,y=k=_),p=_}C()}function fs(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?pb:mb}function gb(t){return t.stepped?pg:t.tension||t.cubicInterpolationMode==="monotone"?gg:zn}function bb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Tc(t,n.options),t.stroke(a)}function yb(t,n,o,r){const{segments:a,options:s}=n,i=fs(n);for(const l of a)Tc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const xb=typeof Path2D=="function";function kb(t,n,o,r){xb&&!n.options.segment?bb(t,n,o,r):yb(t,n,o,r)}class gn extends tn{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 r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;ig(this._points,r,n,a,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=Cg(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,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=Ul(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=gb(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const y=Math.abs((a-m[o])/(g[o]-m[o])),k=c(m,g,y,r.stepped);k[o]=n[o],l.push(k)}return l.length===1?l[0]:l}pathSegment(n,o,r){return fs(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=fs(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),kb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ye(gn,"id","line"),ye(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ye(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ye(gn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Fc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Mr extends tn{constructor(o){super();ye(this,"parsed");ye(this,"skip");ye(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,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return Fc(this,o,"x",r)}inYRange(o,r){return Fc(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!Do(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,Xa(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}ye(Mr,"id","point"),ye(Mr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ye(Mr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function zc(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function bn(t,n,o,r){return t?0:ft(n,o,r)}function wb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Dl(r);return{t:bn(a.top,s.top,0,o),r:bn(a.right,s.right,0,n),b:bn(a.bottom,s.bottom,0,o),l:bn(a.left,s.left,0,n)}}function Cb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Kn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Me(a);return{topLeft:bn(!c||l.top||l.left,s.topLeft,0,i),topRight:bn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:bn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:bn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Eb(t){const n=zc(t),o=n.right-n.left,r=n.bottom-n.top,a=wb(t,o/2,r/2),s=Cb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function hs(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&zc(t,r);return l&&(a||Zt(n,l.left,l.right))&&(s||Zt(o,l.top,l.bottom))}function Bb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function _b(t,n){t.rect(n.x,n.y,n.w,n.h)}function ms(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class vr extends tn{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:r,backgroundColor:a}}=this,{inner:s,outer:i}=Eb(this),l=Bb(i.radius)?mr:_b;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,ms(i,o,s)),n.clip(),l(n,ms(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,ms(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return hs(this,n,o,r)}inXRange(n,o){return hs(this,n,null,o)}inYRange(n,o){return hs(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}ye(vr,"id","bar"),ye(vr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ye(vr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Sb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Pr(c,d,a);const u=ps(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=Ul(n,u);for(const h of f){const m=ps(o,s[h.start],s[h.end],h.loop),g=Wl(l,a,m);for(const y of g)i.push({source:y,target:h,start:{[o]:Ic(u,m,"start",Math.max)},end:{[o]:Ic(u,m,"end",Math.min)}})}}return i}function ps(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Ct(a),s=Ct(s)),{property:t,start:a,end:s}}function Ab(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Pr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Pr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Ic(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function Rc(t,n){let o=[],r=!1;return ot(t)?(r=!0,o=t):o=Ab(t,n),o.length?new gn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function Lc(t){return t&&t.fill!==!1}function Vb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!ut(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Db(t,n,o){const r=Pb(t);if(Me(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ut(a)&&Math.floor(a)===a?Nb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Nb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function Mb(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Me(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function vb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Me(t)?r=t.value:r=n.getBaseValue(),r}function Pb(t){const n=t.options,o=n.fill;let r=Ae(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Tb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Ob(n,o);l.push(Rc({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Fb(a,i[u],l)}return new gn({points:a,options:{}})}function Ob(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function Fb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=zb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function zb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.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(Zt(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class $c{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:Ke},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Ib(t){const{chart:n,fill:o,line:r}=t;if(ut(o))return Rb(n,o);if(o==="stack")return Tb(t);if(o==="shape")return!0;const a=Lb(t);return a instanceof $c?a:Rc(a,r)}function Rb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Lb(t){return(t.scale||{}).getPointPositionForValue?jb(t):$b(t)}function $b(t){const{scale:n={},fill:o}=t,r=Mb(o,n);if(ut(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function jb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=vb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new $c({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function gs(t,n,o){const r=Ib(n),{chart:a,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||{},g=a.getDatasetMeta(s),y=Gl(a,g);r&&i.points.length&&(fr(t,o),Wb(t,{line:i,target:r,above:h,below:m,area:o,scale:l,axis:c,clip:y}),hr(t))}function Wb(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(jc(t,r,i.top),bs(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),jc(t,r,i.bottom)):d==="y"&&(Wc(t,r,i.left),bs(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Wc(t,r,i.right),u=a)),bs(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function jc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Pr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function Wc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Pr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function bs(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Sb(o,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,Ub(t,i,l,g&&ps(a,f,h)),t.beginPath();const y=!!o.pathSegment(t,d);let k;if(g){y?t.closePath():Uc(t,r,h,a);const p=!!r.pathSegment(t,u,{move:y,reverse:!0});k=y&&p,k||Uc(t,r,f,a)}t.closePath(),t.fill(k?"evenodd":"nonzero"),t.restore()}}function Ub(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.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)),t.rect(c,d,u-c,f-d),t.clip()}}function Uc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Hb={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof gn&&(c={visible:t.isDatasetVisible(i),index:i,fill:Db(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Vb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&gs(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;Lc(s)&&gs(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!Lc(r)||o.drawTime!=="beforeDatasetDraw"||gs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hc=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},qb=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class qc extends tn{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,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,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=qe(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,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 r=n.labels,a=mt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Hc(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((g,y)=>{const k=r+o/2+s.measureText(g.text).width;(y===0||d[d.length-1]+k+2*l>i)&&(f+=u,d[d.length-(y>0?0:1)]=0,m+=u,h++),c[y]={left:0,top:m,row:h,width:k,height:a},d[d.length-1]+=k+l}),f}_fitCols(n,o,r,a){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,g=0,y=0;return this.legendItems.forEach((k,p)=>{const{itemWidth:E,itemHeight:C}=Gb(r,o,s,k,a);p>0&&m+C+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,y++,h=m=0),c[p]={left:g,top:m,col:y,width:E,height:C},h=Math.max(h,E),m+=C+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=Qn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=ht(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=ht(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=ht(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=ht(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;fr(n,this),this._draw(),hr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=Ze.color,c=Qn(n.rtl,this.left,this.width),d=mt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:y,itemHeight:k}=Hc(i,f),p=function(B,x,b){if(isNaN(g)||g<=0||isNaN(y)||y<0)return;a.save();const S=Ae(b.lineWidth,1);if(a.fillStyle=Ae(b.fillStyle,l),a.lineCap=Ae(b.lineCap,"butt"),a.lineDashOffset=Ae(b.lineDashOffset,0),a.lineJoin=Ae(b.lineJoin,"miter"),a.lineWidth=S,a.strokeStyle=Ae(b.strokeStyle,l),a.setLineDash(Ae(b.lineDash,[])),i.usePointStyle){const D={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:S},M=c.xPlus(B,g/2),N=x+h;Vl(a,D,M,N,i.pointStyleWidth&&g)}else{const D=x+Math.max((f-y)/2,0),M=c.leftForLtr(B,g),N=Kn(b.borderRadius);a.beginPath(),Object.values(N).some(P=>P!==0)?mr(a,{x:M,y:D,w:g,h:y,radius:N}):a.rect(M,D,g,y),a.fill(),S!==0&&a.stroke()}a.restore()},E=function(B,x,b){No(a,b.text,B,x+k/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},C=this.isHorizontal(),w=this._computeTitleHeight();C?m={x:ht(s,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:ht(s,this.top+w+u,this.bottom-o[0].height),line:0},Rl(this.ctx,n.textDirection);const _=k+u;this.legendItems.forEach((B,x)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const b=a.measureText(B.text).width,S=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),D=g+h+b;let M=m.x,N=m.y;c.setWidth(this.width),C?x>0&&M+D+u>this.right&&(N=m.y+=_,m.line++,M=m.x=ht(s,this.left+u,this.right-r[m.line])):x>0&&N+_>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,N=m.y=ht(s,this.top+w+u,this.bottom-o[m.line].height));const P=c.x(M);if(p(P,N,B),M=Ep(S,M+g+h,C?M+D:this.right,n.rtl),E(c.x(M),N,B),C)m.x+=D+u;else if(typeof B.text!="string"){const T=d.lineHeight;m.y+=Gc(B,T)+u}else m.y+=_}),Ll(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=mt(o.font),a=At(o.padding);if(!o.display)return;const s=Qn(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=ht(n.align,f,this.right-h);else{const g=this.columnSizes.reduce((y,k)=>Math.max(y,k.height),0);u=d+ht(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=ht(l,f,f+h);i.textAlign=s.textAlign(ja(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,No(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=mt(n.font),r=At(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(Zt(n,this.left,this.right)&&Zt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],Zt(n,a.left,a.left+a.width)&&Zt(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!Yb(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=qb(a,r);a&&!s&&qe(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&qe(o.onHover,[n,r,this],this)}else r&&qe(o.onClick,[n,r,this],this)}}function Gb(t,n,o,r,a){const s=Xb(r,t,n,o),i=Kb(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function Xb(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function Kb(t,n,o){let r=t;return typeof n.text!="string"&&(r=Gc(n,o)),r}function Gc(t,n){const o=t.text?t.text.length:0;return n*o}function Yb(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var Jb={id:"legend",_element:qc,start(t,n,o){const r=t.legend=new qc({ctx:t.ctx,options:o,chart:t});Vt.configure(t,r,o),Vt.addBox(t,r)},stop(t){Vt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Vt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=At(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:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Xc extends tn{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 r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=ot(r.text)?r.text.length:1;this._padding=At(r.padding);const s=a*mt(r.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:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=ht(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=ht(l,a,o),c=$e*-.5):(u=s-n,f=ht(l,o,a),c=$e*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=mt(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);No(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:ja(o.align),textBaseline:"middle",translation:[i,l]})}}function Qb(t,n){const o=new Xc({ctx:t.ctx,options:n,chart:t});Vt.configure(t,o,n),Vt.addBox(t,o),t.titleBlock=o}var Zb={id:"title",_element:Xc,start(t,n,o){Qb(t,o)},stop(t){const n=t.titleBlock;Vt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Vt.configure(t,r,o),r.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 Ro={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=La(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function Wt(t,n){return n&&(ot(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function on(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
16
+ */class vg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=_l.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}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((r,a)=>Math.max(r,a._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 r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var cn=new vg;const ec="transparent",Pg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=Dl(t||ec),a=r.valid&&Dl(n||ec);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Tg{constructor(n,o,r,a){const s=o[r];a=kr([n.to,a,s,n.from]);const i=kr([n.from,s,a]);this._active=!0,this._fn=n.fn||Pg[n.type||typeof i],this._easing=Mo[n.easing]||Mo.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=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=kr([n.to,o,a,n.from]),this._from=kr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class tc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!ze(n))return;const o=Object.keys(rt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!ze(s))return;const i={};for(const l of o)i[l]=s[l];(it(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Fg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Og(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],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"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const h=r.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 Tg(h,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return cn.add(this._chart,r),!0}}function Og(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Fg(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function nc(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function zg(t,n,o){if(o===!1)return!1;const r=nc(t,o),a=nc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Ig(t){let n,o,r,a;return ze(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function oc(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function rc(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],ft(d)&&(s||n===0||Xt(n)===Xt(d))&&(n+=d)}return!u&&!r.all?0:n}function Rg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function as(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Lg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function $g(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function jg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function ac(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function sc(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Lg(s,i,r),f=n.length;let h;for(let m=0;m<f;++m){const g=n[m],{[c]:b,[d]:x}=g,p=g._stacks||(g._stacks={});h=p[d]=jg(a,u,b),h[l]=x,h._top=ac(h,i,!0,r.type),h._bottom=ac(h,i,!1,r.type);const E=h._visualValues||(h._visualValues={});E[l]=x}}function ss(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Wg(t,n){return Rn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Ug(t,n,o){return Rn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Oo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const is=t=>t==="reset"||t==="none",ic=(t,n)=>n?t:Object.assign({},t),Hg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:oc(o,!0),values:null};class Wn{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=as(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&&Oo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=Pe(r.xAxisID,ss(n,"x")),i=o.yAxisID=Pe(r.yAxisID,ss(n,"y")),l=o.rAxisID=Pe(r.rAxisID,ss(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(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&&El(this._data,this),n._stacked&&Oo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(ze(o)){const a=this._cachedMeta;this._data=Rg(o,a)}else if(r!==o){if(r){El(r,this);const a=this._cachedMeta;Oo(a),a._parsed=[]}o&&Object.isExtensible(o)&&Ap(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,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=as(o.vScale,o),o.stack!==r.stack&&(a=!0,Oo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(sc(this,o._parsed),o._stacked=as(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{it(a[n])?h=this.parseArrayData(r,a,n,o):ze(a[n])?h=this.parseObjectData(r,a,n,o):h=this.parsePrimitiveData(r,a,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&sc(this,h)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let h,m,g;for(h=0,m=a;h<m;++h)g=h+r,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=o[h],d[u]={x:s.parse(Tn(m,l),h),y:i.parse(Tn(m,c),h)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:oc(a,!0),values:o._stacks[n.axis]._visualValues};return rc(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=rc(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Hg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=$g(l);let h,m;function g(){m=a[h];const b=m[l.axis];return!ft(m[n.axis])||u>b||f<b}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],ft(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Ig(Pe(this.options.clip,zg(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[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 r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Ug(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Wg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,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",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Ao(r);if(l)return ic(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(rt.elements[n]),g=()=>this.getContext(r,a,o),b=d.resolveNamedOptions(h,m,g,f);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(ic(b,c))),b}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.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,r,o))}const d=new tc(a,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||is(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){is(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!is(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"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,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.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(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&Oo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}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 r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}be(Wn,"defaults",{}),be(Wn,"datasetElementType",null),be(Wn,"dataElementType",null);function qg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=Bl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Gg(t){const n=t.iScale,o=qg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Ao(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function Xg(t,n,o,r){const a=o.barThickness;let s,i;return We(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function Kg(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+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/r,ratio:o.barPercentage,start:d}}function Yg(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,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:a,end:s,min:i,max:l}}function lc(t,n,o,r){return it(t)?Yg(t,n,o,r):n[o.axis]=o.parse(t,r),n}function cc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=o,u=o+r;d<u;++d)h=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(lc(h,f,s,d));return c}function ls(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Jg(t,n,o){return t!==0?Xt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function Qg(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function Zg(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Qg(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[dc(u,i,l,c)]=!0,a=d)),s[dc(a,i,l,c)]=!0,t.borderSkipped=s}function dc(t,n,o,r){return r?(t=e0(t,n,o),t=uc(t,o,n)):t=uc(t,n,o),t}function e0(t,n,o){return t===n?o:t===o?n:t}function uc(t,n,o){return t==="start"?n:t==="end"?o:t}function t0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class _r extends Wn{parsePrimitiveData(n,o,r,a){return cc(n,o,r,a)}parseArrayData(n,o,r,a){return cc(n,o,r,a)}parseObjectData(n,o,r,a){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,g,b;for(h=r,m=r+a;h<m;++h)b=o[h],g={},g[s.axis]=s.parse(Tn(b,d),h),f.push(lc(Tn(b,u),g,i,h));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._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:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=ls(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.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,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),b=s||We(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],E={horizontal:d,base:b.base,enableBorderRadius:!p||ls(g._custom)||i===p._top||i===p._bottom,x:d?b.head:x.center,y:d?x.center:b.head,height:d?x.size:Math.abs(b.size),width:d?Math.abs(b.size):x.size};h&&(E.options=f||this.resolveDataElementOptions(m,n[m].active?"active":a));const w=E.options||n[m].options;Zg(E,w,p,i),t0(E,w,u.ratio),this.updateElement(n[m],m,E,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(We(h)||isNaN(h))return!0};for(const u of a)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(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Pe(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Gg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=ls(d);let f=c[o.axis],h=0,m=r?this.applyStack(o,c,r):f,g,b;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Xt(f)!==Xt(d.barEnd)&&(h=0),h+=f);const x=!We(s)&&!u?s:h;let p=o.getPixelForValue(x);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(h+m):g=p,b=g-p,Math.abs(b)<i){b=Jg(b,o,l)*i,f===l&&(p-=b/2);const E=o.getPixelForDecimal(0),w=o.getPixelForDecimal(1),C=Math.min(E,w),_=Math.max(E,w);p=Math.max(Math.min(p,_),C),g=p+b,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const E=Xt(b)*o.getLineWidthForValue(l)/2;p+=E,b-=E}return{size:b,base:p,head:g,center:g+b/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Pe(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?Kg(n,o,a,u*d):Xg(n,o,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Pe(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*g+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.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,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}be(_r,"id","bar"),be(_r,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),be(_r,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function n0(t,n,o){let r=1,a=1,s=0,i=0;if(n<Ze){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,C,_)=>No(w,l,c,!0)?1:Math.max(C,C*o,_,_*o),g=(w,C,_)=>No(w,l,c,!0)?-1:Math.min(C,C*o,_,_*o),b=m(0,d,f),x=m(ct,u,h),p=g(Xe,d,f),E=g(Xe+ct,u,h);r=(b-p)/2,a=(x-E)/2,s=-(b+p)/2,i=-(x+E)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class oo extends Wn{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 r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(ze(r[n])){const{key:c="value"}=this._parsing;s=d=>+Tn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return sn(this.options.rotation-90)}_getCircumference(){return sn(this.options.circumference)}_getRotationExtents(){let n=Ze,o=-Ze;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._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:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(dp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:b}=n0(f,u,c),x=(r.width-i)/h,p=(r.height-i)/m,E=Math.max(Math.min(x,p)/2,0),w=hl(this.options.radius,E),C=Math.max(w*c,0),_=(w-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=b*w,a.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/Ze)}updateElements(n,o,r,a){const s=a==="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,g=h?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(o,a);let p=this._getRotation(),E;for(E=0;E<o;++E)p+=this._circumference(E,s);for(E=o;E<o+r;++E){const w=this._circumference(E,s),C=n[E],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+w,circumference:w,outerRadius:g,innerRadius:m};x&&(_.options=b||this.resolveDataElementOptions(E,C.active?"active":a)),p+=w,this.updateElement(C,E,_,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?Ze*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=Ka(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Pe(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}be(oo,"id","doughnut"),be(oo,"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"}),be(oo,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),be(oo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,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:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class Sr extends Wn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Np(o,a,i);this._drawStart=l,this._drawCount=c,Mp(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),h=i.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,x=Do(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",E=o+r,w=n.length;let C=o>0&&this.getParsed(o-1);for(let _=0;_<w;++_){const B=n[_],k=p?B:{};if(_<o||_>=E){k.skip=!0;continue}const y=this.getParsed(_),A=We(y[m]),V=k[h]=i.getPixelForValue(y[h],_),M=k[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,y,c):y[m],_);k.skip=isNaN(V)||isNaN(M)||A,k.stop=_>0&&Math.abs(y[h]-C[h])>x,b&&(k.parsed=y,k.raw=d.data[_]),f&&(k.options=u||this.resolveDataElementOptions(_,B.active?"active":a)),p||this.updateElement(B,_,k,a),C=y}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}be(Sr,"id","line"),be(Sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),be(Sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class cs extends oo{}be(cs,"id","pie"),be(cs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Un(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ds{constructor(n){be(this,"options");this.options=n||{}}static override(n){Object.assign(ds.prototype,n)}init(){}formats(){return Un()}parse(){return Un()}format(){return Un()}add(){return Un()}diff(){return Un()}startOf(){return Un()}endOf(){return Un()}}var o0={_date:ds};function r0(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?_p:Fn;if(r){if(a._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}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(b=>!We(b[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(b=>!We(b[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Ar(t,n,o,r,a){const s=t.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}=r0(s[l],n,i,a);for(let m=f;m<=h;++m){const g=u[m];g.skip||r(g,d,m)}}}function a0(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function us(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Ar(t,o,n,function(l,c,d){!a&&!Po(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function s0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=wl(i,{x:n.x,y:n.y});No(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Ar(t,o,n,s),a}function i0(t,n,o,r,a,s){let i=[];const l=a0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const x=l(n,g);x<c?(i=[{element:u,datasetIndex:f,index:h}],c=x):x===c&&i.push({element:u,datasetIndex:f,index:h})}return Ar(t,o,n,d),i}function fs(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?s0(t,n,o,a):i0(t,n,o,r,a,s)}function fc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Ar(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var l0={modes:{index(t,n,o,r){const a=$n(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?us(t,a,s,r,i):fs(t,a,s,!1,r,i),c=[];return l.length?(t.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(t,n,o,r){const a=$n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?us(t,a,s,r,i):fs(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=$n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return us(t,a,s,r,i)},nearest(t,n,o,r){const a=$n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return fs(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=$n(n,t);return fc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=$n(n,t);return fc(t,a,"y",o.intersect,r)}}};const hc=["left","top","right","bottom"];function Fo(t,n){return t.filter(o=>o.pos===n)}function mc(t,n){return t.filter(o=>hc.indexOf(o.pos)===-1&&o.box.axis===n)}function zo(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function c0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function d0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!hc.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function u0(t,n){const o=d0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function f0(t){const n=c0(t),o=zo(n.filter(d=>d.box.fullSize),!0),r=zo(Fo(n,"left"),!0),a=zo(Fo(n,"right")),s=zo(Fo(n,"top"),!0),i=zo(Fo(n,"bottom")),l=mc(n,"x"),c=mc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Fo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function pc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function gc(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function h0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!ze(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&gc(i,s.getPadding());const l=Math.max(0,n.outerWidth-pc(i,t,"left","right")),c=Math.max(0,n.outerHeight-pc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function m0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function p0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function Io(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,p0(l.horizontal,n));const{same:f,other:h}=h0(n,o,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&Io(a,n,o,r)||u}function Vr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function bc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[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;Ao(d.start)&&(i=d.start),c.fullSize?Vr(c,a.left,i,o.outerWidth-a.right-a.left,h):Vr(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;Ao(d.start)&&(s=d.start),c.fullSize?Vr(c,s,a.top,h,o.outerHeight-a.bottom-a.top):Vr(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Ot={addBox(t,n){t.boxes||(t.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)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=Tt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=f0(t.boxes),c=l.vertical,d=l.horizontal;Ge(t.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);gc(h,Tt(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),g=u0(c.concat(d),f);Io(l.fullSize,m,f,g),Io(c,m,f,g),Io(d,m,f,g)&&Io(c,m,f,g),m0(m),bc(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,bc(l.rightAndBottom,m,f,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Ge(l.chartArea,b=>{const x=b.box;Object.assign(x,t.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class yc{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class g0 extends yc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const Dr="$chartjs",b0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xc=t=>t===null||t==="";function y0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[Dr]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",xc(a)){const s=Ul(t,"width");s!==void 0&&(t.width=s)}if(xc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Ul(t,"height");s!==void 0&&(t.height=s)}return t}const kc=kg?{passive:!0}:!1;function x0(t,n,o){t&&t.addEventListener(n,o,kc)}function k0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,kc)}function w0(t,n){const o=b0[t.type]||t.type,{x:r,y:a}=$n(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function Nr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function C0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Nr(l.addedNodes,r),i=i&&!Nr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function E0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Nr(l.removedNodes,r),i=i&&!Nr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Ro=new Map;let wc=0;function Cc(){const t=window.devicePixelRatio;t!==wc&&(wc=t,Ro.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function B0(t,n){Ro.size||window.addEventListener("resize",Cc),Ro.set(t,n)}function _0(t){Ro.delete(t),Ro.size||window.removeEventListener("resize",Cc)}function S0(t,n,o){const r=t.canvas,a=r&&rs(r);if(!a)return;const s=Sl((l,c)=>{const d=a.clientWidth;o(l,c),d<a.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(a),B0(t,s),i}function hs(t,n,o){o&&o.disconnect(),n==="resize"&&_0(t)}function A0(t,n,o){const r=t.canvas,a=Sl(s=>{t.ctx!==null&&o(w0(s,t))},t);return x0(r,n,a),a}class V0 extends yc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(y0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[Dr])return!1;const r=o[Dr].initial;["height","width"].forEach(s=>{const i=r[s];We(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[Dr],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:C0,detach:E0,resize:S0}[o]||A0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:hs,detach:hs,resize:hs}[o]||k0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return xg(n,o,r,a)}isAttached(n){const o=n&&rs(n);return!!(o&&o.isConnected)}}function D0(t){return!os()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?g0:V0}let dn=(ca=class{constructor(){be(this,"x");be(this,"y");be(this,"active",!1);be(this,"options");be(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return Do(this.x)&&Do(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},be(ca,"defaults",{}),be(ca,"defaultRoutes"),ca);function N0(t,n){const o=t.options.ticks,r=M0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?P0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return T0(n,d,s,i/a),d;const u=v0(s,n,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Mr(n,d,u,We(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Mr(n,d,u,s[f],s[f+1]);return Mr(n,d,u,c,We(m)?n.length:c+m),d}return Mr(n,d,u),d}function M0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function v0(t,n,o){const r=O0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=yp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function P0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function T0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function Mr(t,n,o,r,a){const s=Pe(r,0),i=Math.min(Pe(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,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(t[d]),l++,u=Math.round(s+l*o))}function O0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const F0=t=>t==="left"?"right":t==="right"?"left":t,Ec=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,Bc=(t,n)=>Math.min(n||t,t);function _c(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function z0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function I0(t,n){Ge(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Lo(t){return t.drawTicks?t.tickLength:0}function Sc(t,n){if(!t.display)return 0;const o=pt(t.font,n),r=Tt(t.padding);return(it(t.text)?t.text.length:1)*o.lineHeight+r.height}function R0(t,n){return Rn(t,{scale:n,type:"scale"})}function L0(t,n,o){return Rn(t,{tick:o,index:n,type:"tick"})}function $0(t,n,o){let r=qa(t);return(o&&n!=="right"||!o&&n==="right")&&(r=F0(r)),r}function j0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,g;const b=i-a,x=l-s;if(t.isHorizontal()){if(m=mt(r,s,l),ze(o)){const p=Object.keys(o)[0],E=o[p];g=u[p].getPixelForValue(E)+b-n}else o==="center"?g=(d.bottom+d.top)/2+b-n:g=Ec(t,o,n);h=l-s}else{if(ze(o)){const p=Object.keys(o)[0],E=o[p];m=u[p].getPixelForValue(E)-x+n}else o==="center"?m=(d.left+d.right)/2-x+n:m=Ec(t,o,n);g=mt(r,i,a),f=o==="left"?-ct:ct}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class ro extends dn{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:r,_suggestedMax:a}=this;return n=Gt(n,Number.POSITIVE_INFINITY),o=Gt(o,Number.NEGATIVE_INFINITY),r=Gt(r,Number.POSITIVE_INFINITY),a=Gt(a,Number.NEGATIVE_INFINITY),{min:Gt(n,r),max:Gt(o,a),minDefined:ft(n),maxDefined:ft(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:Gt(o,Gt(r,o)),max:Gt(r,Gt(o,r))}}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(){Je(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Jp(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?_c(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=N0(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,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Je(this.options.afterUpdate,[this])}beforeSetDimensions(){Je(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(){Je(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),Je(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Je(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=Je(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){Je(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Je(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=Bc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=ht(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-Lo(n.grid)-o.padding-Sc(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Cp(Math.min(Math.asin(ht((u.highest.height+6)/l,-1,1)),Math.asin(ht(c/d,-1,1))-Math.asin(ht(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Je(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Je(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Sc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Lo(s)+c):(n.height=this.maxHeight,n.width=Lo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,g=sn(this.labelRotation),b=Math.cos(g),x=Math.sin(g);if(l){const p=r.mirror?0:x*f.width+b*h.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:b*f.width+x*h.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,x,b)}}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,r,a){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=a*n.width,m=r*o.height):(h=r*n.height,m=a*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(){Je(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,r;for(o=0,r=n.length;o<r;o++)We(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=_c(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/Bc(o,r));let d=0,u=0,f,h,m,g,b,x,p,E,w,C,_;for(f=0;f<o;f+=c){if(g=n[f].label,b=this._resolveTickFontOptions(f),a.font=x=b.string,p=s[x]=s[x]||{data:{},gc:[]},E=b.lineHeight,w=C=0,!We(g)&&!it(g))w=vl(a,p.data,p.gc,w,g),C=E;else if(it(g))for(h=0,m=g.length;h<m;++h)_=g[h],!We(_)&&!it(_)&&(w=vl(a,p.data,p.gc,w,_),C+=E);i.push(w),l.push(C),d=Math.max(w,d),u=Math.max(C,u)}I0(s,o);const B=i.indexOf(d),k=l.indexOf(u),y=A=>({width:i[A]||0,height:l[A]||0});return{first:y(0),last:y(o-1),widest:y(B),highest:y(k),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 Bp(this._alignToPixels?In(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 r=o[n];return r.$context||(r.$context=L0(this.getContext(),n,r))}return this.$context||(this.$context=R0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=sn(this.labelRotation),r=Math.abs(Math.cos(o)),a=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*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Lo(s),m=[],g=l.setContext(this.getContext()),b=g.display?g.width:0,x=b/2,p=function(L){return In(r,L,b)};let E,w,C,_,B,k,y,A,V,M,D,T;if(i==="top")E=p(this.bottom),k=this.bottom-h,A=E-x,M=p(n.top)+x,T=n.bottom;else if(i==="bottom")E=p(this.top),M=n.top,T=p(n.bottom)-x,k=E+x,A=this.top+h;else if(i==="left")E=p(this.right),B=this.right-h,y=E-x,V=p(n.left)+x,D=n.right;else if(i==="right")E=p(this.left),V=n.left,D=p(n.right)-x,B=E+x,y=this.left+h;else if(o==="x"){if(i==="center")E=p((n.top+n.bottom)/2+.5);else if(ze(i)){const L=Object.keys(i)[0],G=i[L];E=p(this.chart.scales[L].getPixelForValue(G))}M=n.top,T=n.bottom,k=E+x,A=k+h}else if(o==="y"){if(i==="center")E=p((n.left+n.right)/2);else if(ze(i)){const L=Object.keys(i)[0],G=i[L];E=p(this.chart.scales[L].getPixelForValue(G))}B=E-x,y=B-h,V=n.left,D=n.right}const P=Pe(a.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/P));for(w=0;w<f;w+=K){const L=this.getContext(w),G=s.setContext(L),Q=l.setContext(L),X=G.lineWidth,R=G.color,H=Q.dash||[],ae=Q.dashOffset,Z=G.tickWidth,J=G.tickColor,ie=G.tickBorderDash||[],de=G.tickBorderDashOffset;C=z0(this,w,c),C!==void 0&&(_=In(r,C,X),d?B=y=V=D=_:k=A=M=T=_,m.push({tx1:B,ty1:k,tx2:y,ty2:A,x1:V,y1:M,x2:D,y2:T,width:X,color:R,borderDash:H,borderDashOffset:ae,tickWidth:Z,tickColor:J,tickBorderDash:ie,tickBorderDashOffset:de}))}return this._ticksLength=f,this._borderValue=E,m}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Lo(r.grid),m=h+u,g=f?-u:m,b=-sn(this.labelRotation),x=[];let p,E,w,C,_,B,k,y,A,V,M,D,T="middle";if(a==="top")B=this.bottom-g,k=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+g,k=this._getXAxisLabelAlignment();else if(a==="left"){const K=this._getYAxisLabelAlignment(h);k=K.textAlign,_=K.x}else if(a==="right"){const K=this._getYAxisLabelAlignment(h);k=K.textAlign,_=K.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+m;else if(ze(a)){const K=Object.keys(a)[0],L=a[K];B=this.chart.scales[K].getPixelForValue(L)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")_=(n.left+n.right)/2-m;else if(ze(a)){const K=Object.keys(a)[0],L=a[K];_=this.chart.scales[K].getPixelForValue(L)}k=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?T="top":c==="end"&&(T="bottom"));const P=this._getLabelSizes();for(p=0,E=l.length;p<E;++p){w=l[p],C=w.label;const K=s.setContext(this.getContext(p));y=this.getPixelForTick(p)+s.labelOffset,A=this._resolveTickFontOptions(p),V=A.lineHeight,M=it(C)?C.length:1;const L=M/2,G=K.color,Q=K.textStrokeColor,X=K.textStrokeWidth;let R=k;i?(_=y,k==="inner"&&(p===E-1?R=this.options.reverse?"left":"right":p===0?R=this.options.reverse?"right":"left":R="center"),a==="top"?d==="near"||b!==0?D=-M*V+V/2:d==="center"?D=-P.highest.height/2-L*V+V:D=-P.highest.height+V/2:d==="near"||b!==0?D=V/2:d==="center"?D=P.highest.height/2-L*V:D=P.highest.height-M*V,f&&(D*=-1),b!==0&&!K.showLabelBackdrop&&(_+=V/2*Math.sin(b))):(B=y,D=(1-M)*V/2);let H;if(K.showLabelBackdrop){const ae=Tt(K.backdropPadding),Z=P.heights[p],J=P.widths[p];let ie=D-ae.top,de=0-ae.left;switch(T){case"middle":ie-=Z/2;break;case"bottom":ie-=Z;break}switch(k){case"center":de-=J/2;break;case"right":de-=J;break;case"inner":p===E-1?de-=J:p>0&&(de-=J/2);break}H={left:de,top:ie,width:J+ae.width,height:Z+ae.height,color:K.backdropColor}}x.push({label:C,font:A,textOffset:D,options:{rotation:b,color:G,strokeColor:Q,strokeWidth:X,textAlign:R,textBaseline:T,translation:[_,B],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-sn(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="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:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[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:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=In(n,this.left,i)-i/2,u=In(n,this.right,l)+l/2,f=h=c):(f=In(n,this.top,i)-i/2,h=In(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 r=this.ctx,a=this._computeLabelArea();a&&br(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;To(r,d,0,u,c,l)}a&&yr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=pt(r.font),i=Tt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||ze(o)?(c+=i.bottom,it(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=j0(this,c,o,l);To(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:$0(l,o,a),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,r=Pe(n.grid&&n.grid.z,-1),a=Pe(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==ro.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return pt(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class vr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,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 r;H0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,W0(n,i,r),this.override&&rt.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in rt[a]&&(delete rt[a][r],this.override&&delete zn[r])}}function W0(t,n,o){const r=_o(Object.create(null),[o?rt.get(o):{},rt.get(n),t.defaults]);rt.set(n,r),t.defaultRoutes&&U0(n,t.defaultRoutes),t.descriptors&&rt.describe(n,t.descriptors)}function U0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");rt.route(s,a,c,l)})}function H0(t){return"id"in t&&"defaults"in t}class q0{constructor(){this.controllers=new vr(Wn,"datasets",!0),this.elements=new vr(dn,"elements"),this.plugins=new vr(Object,"plugins"),this.scales=new vr(ro,"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,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Ge(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Wa(n);Je(r["before"+a],[],r),o[n](r),Je(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var Kt=new q0;class G0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(Je(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){We(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 r=n&&n.config,a=Pe(r.options&&r.options.plugins,{}),s=X0(r);return a===!1&&!o?[]:Y0(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function X0(t){const n={},o=[],r=Object.keys(Kt.plugins.items);for(let s=0;s<r.length;s++)o.push(Kt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function K0(t,n){return!n&&t===!1?null:t===!0?{}:t}function Y0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=K0(r[c],a);d!==null&&s.push({plugin:l,options:J0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function J0(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ms(t,n){const o=rt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function Q0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function Z0(t,n){return t===n?"_index_":"_value_"}function Ac(t){if(t==="x"||t==="y"||t==="r")return t}function eb(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function ps(t,...n){if(Ac(t))return t;for(const o of n){const r=o.axis||eb(o.position)||t.length>1&&Ac(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Vc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function tb(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return Vc(t,"x",o[0])||Vc(t,"y",o[0])}return{}}function nb(t,n){const o=zn[t.type]||{scales:{}},r=n.scales||{},a=ms(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!ze(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=ps(i,l,tb(i,t),rt.scales[l.type]),d=Z0(c,a),u=o.scales||{};s[i]=So(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||ms(l,n),u=(zn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Q0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),So(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];So(l,[rt.scales[l.type],rt.scale])}),s}function Dc(t){const n=t.options||(t.options={});n.plugins=Pe(n.plugins,{}),n.scales=nb(t,n)}function Nc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function ob(t){return t=t||{},t.data=Nc(t.data),Dc(t),t}const Mc=new Map,vc=new Set;function Pr(t,n){let o=Mc.get(t);return o||(o=n(),Mc.set(t,o),vc.add(o)),o}const $o=(t,n,o)=>{const r=Tn(n,o);r!==void 0&&t.add(r)};class rb{constructor(n){this._config=ob(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=Nc(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 Pr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Pr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Pr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Pr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>$o(c,n,f))),u.forEach(f=>$o(c,a,f)),u.forEach(f=>$o(c,zn[s]||{},f)),u.forEach(f=>$o(c,rt,f)),u.forEach(f=>$o(c,Ya,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),vc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,zn[o]||{},rt.datasets[o]||{},{type:o},rt,Ya]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Pc(this._resolverCache,n,a);let c=i;if(sb(i,o)){s.$shared=!1,r=wn(r)?r():r;const d=this.createResolver(n,r,l);c=eo(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Pc(this._resolverCache,n,r);return ze(o)?eo(s,o,void 0,a):s}}function Pc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:es(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const ab=t=>ze(t)&&Object.getOwnPropertyNames(t).some(n=>wn(t[n]));function sb(t,n){const{isScriptable:o,isIndexable:r}=Fl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(wn(l)||ab(l))||i&&it(l))return!0}return!1}var ib="4.5.1";const lb=["top","bottom","left","right","chartArea"];function Tc(t,n){return t==="top"||t==="bottom"||lb.indexOf(t)===-1&&n==="x"}function Oc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Fc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),Je(o&&o.onComplete,[t],n)}function cb(t){const n=t.chart,o=n.options.animation;Je(o&&o.onProgress,[t],n)}function zc(t){return os()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Tr={},Ic=t=>{const n=zc(t);return Object.values(Tr).filter(o=>o.canvas===n).pop()};function db(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function ub(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class un{static register(...n){Kt.add(...n),Rc()}static unregister(...n){Kt.remove(...n),Rc()}constructor(n,o){const r=this.config=new rb(o),a=zc(n),s=Ic(a);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=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||D0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=cp(),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 G0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Vp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],Tr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}cn.listen(this,"complete",Fc),cn.listen(this,"progress",cb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return We(n)?o&&s?s:a?r/a: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 Kt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pl(this.canvas,this.ctx),this}stop(){return cn.stop(this),this}resize(n,o){cn.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Wl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Je(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ge(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=ps(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ge(s,i=>{const l=i.options,c=l.id,d=ps(c,l),u=Pe(l.type,i.dtype);(l.position===void 0||Tc(l.position,d)!==Tc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const h=Kt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Ge(a,(i,l)=>{i||delete r[l]}),Ge(r,i=>{Ot.configure(this,i,i.options),Ot.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Oc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||ms(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=Kt.getController(l),{datasetElementType:d,dataElementType:u}=rt.datasets[l];Object.assign(c,{dataElementType:Kt.getElement(u),datasetElementType:d&&Kt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Ge(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 r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.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=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Ge(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Oc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ge(this.scales,n=>{Ot.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!gl(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;db(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!gl(a,r(s)))return;return Array.from(a).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;Ot.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Ge(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,wn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(cn.has(this)?this.attached&&!cn.running(this)&&cn.start(this):(this.draw(),Fc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}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,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}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,r={meta:n,index:n.index,cancelable:!0},a=Zl(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&br(o,a),n.controller.draw(),a&&yr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Po(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=l0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={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},r.push(a)),a}getContext(){return this.$context||(this.$context=Rn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Ao(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a: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(),cn.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(),Pl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete Tr[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,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Ge(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(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=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Ge(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Ge(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=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}});!hr(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=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=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=pp(n),d=ub(n,this._lastEvent,r,c);r&&(this._lastEvent=null,Je(s.onHover,[n,l,this],this),c&&Je(s.onClick,[n,l,this],this));const u=!hr(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}be(un,"defaults",rt),be(un,"instances",Tr),be(un,"overrides",zn),be(un,"registry",Kt),be(un,"version",ib),be(un,"getChart",Ic);function Rc(){return Ge(un.instances,t=>t._plugins.invalidate())}function fb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Bt(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const h=Math.min(d/l,Bt(r-o));t.arc(a,s,l+d/2,o-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Bt(r-o));if(u==="round")t.arc(a,s,h,o-Xe/2,r+Xe/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+Xe/2)+a,b=-m*Math.sin(o+Xe/2)+s,x=m*Math.cos(r+Xe/2)+a,p=m*Math.sin(r+Xe/2)+s;t.lineTo(g,b),t.lineTo(x,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function hb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+ct,r-ct),t.closePath(),t.clip()}function mb(t){return Za(t,["outerStart","outerEnd","innerStart","innerEnd"])}function pb(t,n,o,r){const a=mb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return ht(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:ht(a.innerStart,0,i),innerEnd:ht(a.innerEnd,0,i)}}function ao(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Or(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),h=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const K=u>0?u-r:0,L=f>0?f-r:0,G=(K+L)/2,Q=G!==0?g*G/(G+r):g;m=(g-Q)/2}const b=Math.max(.001,g*f-o/Xe)/f,x=(g-b)/2,p=c+x+m,E=a-x-m,{outerStart:w,outerEnd:C,innerStart:_,innerEnd:B}=pb(n,h,f,E-p),k=f-w,y=f-C,A=p+w/k,V=E-C/y,M=h+_,D=h+B,T=p+_/M,P=E-B/D;if(t.beginPath(),s){const K=(A+V)/2;if(t.arc(i,l,f,A,K),t.arc(i,l,f,K,V),C>0){const X=ao(y,V,i,l);t.arc(X.x,X.y,C,V,E+ct)}const L=ao(D,E,i,l);if(t.lineTo(L.x,L.y),B>0){const X=ao(D,P,i,l);t.arc(X.x,X.y,B,E+ct,P+Math.PI)}const G=(E-B/h+(p+_/h))/2;if(t.arc(i,l,h,E-B/h,G,!0),t.arc(i,l,h,G,p+_/h,!0),_>0){const X=ao(M,T,i,l);t.arc(X.x,X.y,_,T+Math.PI,p-ct)}const Q=ao(k,p,i,l);if(t.lineTo(Q.x,Q.y),w>0){const X=ao(k,A,i,l);t.arc(X.x,X.y,w,p-ct,A)}}else{t.moveTo(i,l);const K=Math.cos(A)*f+i,L=Math.sin(A)*f+l;t.lineTo(K,L);const G=Math.cos(V)*f+i,Q=Math.sin(V)*f+l;t.lineTo(G,Q)}t.closePath()}function gb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Or(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Ze||Ze))}return Or(t,n,o,r,c,a),t.fill(),c}function bb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let b=n.endAngle;if(s){Or(t,n,o,r,b,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(b=i+(l%Ze||Ze))}g&&hb(t,n,b),c.selfJoin&&b-i>=Xe&&m===0&&u!=="miter"&&fb(t,n,b),s||(Or(t,n,o,r,b,a),t.stroke())}class jo extends dn{constructor(o){super();be(this,"circumference");be(this,"endAngle");be(this,"fullCircles");be(this,"innerRadius");be(this,"outerRadius");be(this,"pixelMargin");be(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,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=wl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=Pe(h,d-c),b=No(i,c,d)&&c!==d,x=g>=Ze||b,p=ln(l,u+m,f+m);return x&&p}getCenterPoint(o){const{x:r,y:a,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:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Ze?Math.floor(a/Ze):0,a===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(Xe,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,gb(o,this,u,i,l),bb(o,this,u,i,l),o.restore()}}be(jo,"id","arc"),be(jo,"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}),be(jo,"defaultRoutes",{backgroundColor:"backgroundColor"}),be(jo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Lc(t,n,o=n){t.lineCap=Pe(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Pe(o.borderDash,n.borderDash)),t.lineDashOffset=Pe(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Pe(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Pe(o.borderWidth,n.borderWidth),t.strokeStyle=Pe(o.borderColor,n.borderColor)}function yb(t,n,o){t.lineTo(o.x,o.y)}function xb(t){return t.stepped?jp:t.tension||t.cubicInterpolationMode==="monotone"?Wp:yb}function $c(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function kb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=$c(a,o,r),u=xb(s);let{move:f=!0,reverse:h}=r||{},m,g,b;for(m=0;m<=d;++m)g=a[(l+(h?d-m:m))%i],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,b,g,h,s.stepped),b=g);return c&&(g=a[(l+(h?d:0))%i],u(t,b,g,h,s.stepped)),!!c}function wb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=$c(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,g,b,x,p;const E=C=>(i+(d?l-C:C))%s,w=()=>{b!==x&&(t.lineTo(u,x),t.lineTo(u,b),t.lineTo(u,p))};for(c&&(m=a[E(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[E(h)],m.skip)continue;const C=m.x,_=m.y,B=C|0;B===g?(_<b?b=_:_>x&&(x=_),u=(f*u+C)/++f):(w(),t.lineTo(C,_),g=B,f=0,b=x=_),p=_}w()}function gs(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?wb:kb}function Cb(t){return t.stepped?wg:t.tension||t.cubicInterpolationMode==="monotone"?Cg:jn}function Eb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Lc(t,n.options),t.stroke(a)}function Bb(t,n,o,r){const{segments:a,options:s}=n,i=gs(n);for(const l of a)Lc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const _b=typeof Path2D=="function";function Sb(t,n,o,r){_b&&!n.options.segment?Eb(t,n,o,r):Bb(t,n,o,r)}class En extends dn{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 r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;hg(this._points,r,n,a,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=Vg(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,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=Yl(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Cb(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const b=Math.abs((a-m[o])/(g[o]-m[o])),x=c(m,g,b,r.stepped);x[o]=n[o],l.push(x)}return l.length===1?l[0]:l}pathSegment(n,o,r){return gs(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=gs(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),Sb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}be(En,"id","line"),be(En,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),be(En,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),be(En,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function jc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Fr extends dn{constructor(o){super();be(this,"parsed");be(this,"skip");be(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,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return jc(this,o,"x",r)}inYRange(o,r){return jc(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!Po(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,Qa(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}be(Fr,"id","point"),be(Fr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),be(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Wc(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Bn(t,n,o,r){return t?0:ht(n,o,r)}function Ab(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Ol(r);return{t:Bn(a.top,s.top,0,o),r:Bn(a.right,s.right,0,n),b:Bn(a.bottom,s.bottom,0,o),l:Bn(a.left,s.left,0,n)}}function Vb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Zn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||ze(a);return{topLeft:Bn(!c||l.top||l.left,s.topLeft,0,i),topRight:Bn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Bn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Bn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Db(t){const n=Wc(t),o=n.right-n.left,r=n.bottom-n.top,a=Ab(t,o/2,r/2),s=Vb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function bs(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Wc(t,r);return l&&(a||ln(n,l.left,l.right))&&(s||ln(o,l.top,l.bottom))}function Nb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Mb(t,n){t.rect(n.x,n.y,n.w,n.h)}function ys(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class zr extends dn{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:r,backgroundColor:a}}=this,{inner:s,outer:i}=Db(this),l=Nb(i.radius)?xr:Mb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,ys(i,o,s)),n.clip(),l(n,ys(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,ys(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return bs(this,n,o,r)}inXRange(n,o){return bs(this,n,null,o)}inYRange(n,o){return bs(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}be(zr,"id","bar"),be(zr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),be(zr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function vb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Ir(c,d,a);const u=xs(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=Yl(n,u);for(const h of f){const m=xs(o,s[h.start],s[h.end],h.loop),g=Kl(l,a,m);for(const b of g)i.push({source:b,target:h,start:{[o]:Uc(u,m,"start",Math.max)},end:{[o]:Uc(u,m,"end",Math.min)}})}}return i}function xs(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Bt(a),s=Bt(s)),{property:t,start:a,end:s}}function Pb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Ir(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Ir(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Uc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function Hc(t,n){let o=[],r=!1;return it(t)?(r=!0,o=t):o=Pb(t,n),o.length?new En({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function qc(t){return t&&t.fill!==!1}function Tb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!ft(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Ob(t,n,o){const r=Rb(t);if(ze(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ft(a)&&Math.floor(a)===a?Fb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Fb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function zb(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:ze(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Ib(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:ze(t)?r=t.value:r=n.getBaseValue(),r}function Rb(t){const n=t.options,o=n.fill;let r=Pe(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Lb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=$b(n,o);l.push(Hc({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)jb(a,i[u],l)}return new En({points:a,options:{}})}function $b(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function jb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Wb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Wb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.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(ln(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class Gc{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:Ze},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Ub(t){const{chart:n,fill:o,line:r}=t;if(ft(o))return Hb(n,o);if(o==="stack")return Lb(t);if(o==="shape")return!0;const a=qb(t);return a instanceof Gc?a:Hc(a,r)}function Hb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function qb(t){return(t.scale||{}).getPointPositionForValue?Xb(t):Gb(t)}function Gb(t){const{scale:n={},fill:o}=t,r=zb(o,n);if(ft(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Xb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Ib(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new Gc({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function ks(t,n,o){const r=Ub(n),{chart:a,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||{},g=a.getDatasetMeta(s),b=Zl(a,g);r&&i.points.length&&(br(t,o),Kb(t,{line:i,target:r,above:h,below:m,area:o,scale:l,axis:c,clip:b}),yr(t))}function Kb(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(Xc(t,r,i.top),ws(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Xc(t,r,i.bottom)):d==="y"&&(Kc(t,r,i.left),ws(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Kc(t,r,i.right),u=a)),ws(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Xc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Ir(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function Kc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Ir(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function ws(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=vb(o,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,Yb(t,i,l,g&&xs(a,f,h)),t.beginPath();const b=!!o.pathSegment(t,d);let x;if(g){b?t.closePath():Yc(t,r,h,a);const p=!!r.pathSegment(t,u,{move:b,reverse:!0});x=b&&p,x||Yc(t,r,f,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function Yb(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.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)),t.rect(c,d,u-c,f-d),t.clip()}}function Yc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Jb={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof En&&(c={visible:t.isDatasetVisible(i),index:i,fill:Ob(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Tb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&ks(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;qc(s)&&ks(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!qc(r)||o.drawTime!=="beforeDatasetDraw"||ks(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jc=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},Qb=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class Qc extends dn{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,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,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=Je(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,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 r=n.labels,a=pt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Jc(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((g,b)=>{const x=r+o/2+s.measureText(g.text).width;(b===0||d[d.length-1]+x+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:x,height:a},d[d.length-1]+=x+l}),f}_fitCols(n,o,r,a){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,g=0,b=0;return this.legendItems.forEach((x,p)=>{const{itemWidth:E,itemHeight:w}=Zb(r,o,s,x,a);p>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,b++,h=m=0),c[p]={left:g,top:m,col:b,width:E,height:w},h=Math.max(h,E),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=no(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=mt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=mt(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=mt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=mt(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;br(n,this),this._draw(),yr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=rt.color,c=no(n.rtl,this.left,this.width),d=pt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:b,itemHeight:x}=Jc(i,f),p=function(B,k,y){if(isNaN(g)||g<=0||isNaN(b)||b<0)return;a.save();const A=Pe(y.lineWidth,1);if(a.fillStyle=Pe(y.fillStyle,l),a.lineCap=Pe(y.lineCap,"butt"),a.lineDashOffset=Pe(y.lineDashOffset,0),a.lineJoin=Pe(y.lineJoin,"miter"),a.lineWidth=A,a.strokeStyle=Pe(y.strokeStyle,l),a.setLineDash(Pe(y.lineDash,[])),i.usePointStyle){const V={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:A},M=c.xPlus(B,g/2),D=k+h;Tl(a,V,M,D,i.pointStyleWidth&&g)}else{const V=k+Math.max((f-b)/2,0),M=c.leftForLtr(B,g),D=Zn(y.borderRadius);a.beginPath(),Object.values(D).some(T=>T!==0)?xr(a,{x:M,y:V,w:g,h:b,radius:D}):a.rect(M,V,g,b),a.fill(),A!==0&&a.stroke()}a.restore()},E=function(B,k,y){To(a,y.text,B,k+x/2,d,{strikethrough:y.hidden,textAlign:c.textAlign(y.textAlign)})},w=this.isHorizontal(),C=this._computeTitleHeight();w?m={x:mt(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:mt(s,this.top+C+u,this.bottom-o[0].height),line:0},Hl(this.ctx,n.textDirection);const _=x+u;this.legendItems.forEach((B,k)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const y=a.measureText(B.text).width,A=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),V=g+h+y;let M=m.x,D=m.y;c.setWidth(this.width),w?k>0&&M+V+u>this.right&&(D=m.y+=_,m.line++,M=m.x=mt(s,this.left+u,this.right-r[m.line])):k>0&&D+_>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,D=m.y=mt(s,this.top+C+u,this.bottom-o[m.line].height));const T=c.x(M);if(p(T,D,B),M=Dp(A,M+g+h,w?M+V:this.right,n.rtl),E(c.x(M),D,B),w)m.x+=V+u;else if(typeof B.text!="string"){const P=d.lineHeight;m.y+=Zc(B,P)+u}else m.y+=_}),ql(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=pt(o.font),a=Tt(o.padding);if(!o.display)return;const s=no(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=mt(n.align,f,this.right-h);else{const g=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=d+mt(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=mt(l,f,f+h);i.textAlign=s.textAlign(qa(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,To(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=pt(n.font),r=Tt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(ln(n,this.left,this.right)&&ln(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],ln(n,a.left,a.left+a.width)&&ln(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!ny(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=Qb(a,r);a&&!s&&Je(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&Je(o.onHover,[n,r,this],this)}else r&&Je(o.onClick,[n,r,this],this)}}function Zb(t,n,o,r,a){const s=ey(r,t,n,o),i=ty(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function ey(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function ty(t,n,o){let r=t;return typeof n.text!="string"&&(r=Zc(n,o)),r}function Zc(t,n){const o=t.text?t.text.length:0;return n*o}function ny(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var oy={id:"legend",_element:Qc,start(t,n,o){const r=t.legend=new Qc({ctx:t.ctx,options:o,chart:t});Ot.configure(t,r,o),Ot.addBox(t,r)},stop(t){Ot.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Ot.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=Tt(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:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ed extends dn{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 r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=it(r.text)?r.text.length:1;this._padding=Tt(r.padding);const s=a*pt(r.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:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=mt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=mt(l,a,o),c=Xe*-.5):(u=s-n,f=mt(l,o,a),c=Xe*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=pt(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);To(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:qa(o.align),textBaseline:"middle",translation:[i,l]})}}function ry(t,n){const o=new ed({ctx:t.ctx,options:n,chart:t});Ot.configure(t,o,n),Ot.addBox(t,o),t.titleBlock=o}var ay={id:"title",_element:ed,start(t,n,o){ry(t,o)},stop(t){const n=t.titleBlock;Ot.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Ot.configure(t,r,o),r.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 Wo={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Ua(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function Yt(t,n){return n&&(it(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function fn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
17
17
  `)>-1?t.split(`
18
- `):t}function ey(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function Kc(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=mt(n.bodyFont),d=mt(n.titleFont),u=mt(n.footerFont),f=s.length,h=a.length,m=r.length,g=At(n.padding);let y=g.height,k=0,p=r.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(y+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const w=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;y+=m*w+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}h&&(y+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let E=0;const C=function(w){k=Math.max(k,o.measureText(w).width+E)};return o.save(),o.font=d.string,Le(t.title,C),o.font=c.string,Le(t.beforeBody.concat(t.afterBody),C),E=n.displayColors?i+2+n.boxPadding:0,Le(r,w=>{Le(w.before,C),Le(w.lines,C),Le(w.after,C)}),E=0,o.font=u.string,Le(t.footer,C),o.restore(),k+=g.width,{width:k,height:y}}function ty(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function ny(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function oy(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),ny(d,t,n,o)&&(d="center"),d}function Yc(t,n,o){const r=o.yAlign||n.yAlign||ty(t,o);return{xAlign:o.xAlign||n.xAlign||oy(t,n,o,r),yAlign:r}}function ry(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function ay(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function Jc(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Kn(i);let g=ry(n,l);const y=ay(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+a:l==="right"&&(g+=Math.max(f,m)+a),{x:ft(g,0,r.width-n.width),y:ft(y,0,r.height-n.height)}}function Tr(t,n,o){const r=At(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function Qc(t){return Wt([],on(t))}function sy(t,n,o){return Tn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function Zc(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const ed={beforeTitle:Jt,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:Jt,beforeBody:Jt,beforeLabel:Jt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return Ie(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Jt,afterBody:Jt,beforeFooter:Jt,footer:Jt,afterFooter:Jt};function bt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?ed[n].call(o,r):a}class ys extends tn{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,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new Kl(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=sy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=bt(r,"beforeTitle",this,n),s=bt(r,"title",this,n),i=bt(r,"afterTitle",this,n);let l=[];return l=Wt(l,on(a)),l=Wt(l,on(s)),l=Wt(l,on(i)),l}getBeforeBody(n,o){return Qc(bt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Le(n,s=>{const i={before:[],lines:[],after:[]},l=Zc(r,s);Wt(i.before,on(bt(l,"beforeLabel",this,s))),Wt(i.lines,bt(l,"label",this,s)),Wt(i.after,on(bt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return Qc(bt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=bt(r,"beforeFooter",this,n),s=bt(r,"footer",this,n),i=bt(r,"afterFooter",this,n);let l=[];return l=Wt(l,on(a)),l=Wt(l,on(s)),l=Wt(l,on(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(ey(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Le(l,u=>{const f=Zc(n.callbacks,u);a.push(bt(f,"labelColor",this,u)),s.push(bt(f,"labelPointStyle",this,u)),i.push(bt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=Ro[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=Kc(this,r),d=Object.assign({},l,c),u=Yc(this.chart,r,d),f=Jc(r,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&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Kn(l),{x:h,y:m}=n,{width:g,height:y}=o;let k,p,E,C,w,_;return s==="center"?(w=m+y/2,a==="left"?(k=h,p=k-i,C=w+i,_=w-i):(k=h+g,p=k+i,C=w-i,_=w+i),E=k):(a==="left"?p=h+Math.max(c,u)+i:a==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(C=m,w=C-i,k=p-i,E=p+i):(C=m+y,w=C+i,k=p+i,E=p-i),_=C),{x1:k,x2:p,x3:E,y1:C,y2:w,y3:_}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=Qn(r.rtl,this.x,this.width);for(n.x=Tr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=mt(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=mt(s.bodyFont),f=Tr(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const y={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},k=a.leftForLtr(h,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Xa(n,y,k,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Xa(n,y,k,p)}else{n.lineWidth=Me(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 y=a.leftForLtr(h,d),k=a.leftForLtr(a.xPlus(h,1),d-2),p=Kn(i.borderRadius);Object.values(p).some(E=>E!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,mr(n,{x:y,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),mr(n,{x:k,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(y,g,d,c),n.strokeRect(y,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(k,g+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=mt(r.bodyFont);let h=f.lineHeight,m=0;const g=Qn(r.rtl,this.x,this.width),y=function(b){o.fillText(b,g.x(n.x+m),n.y+h/2),n.y+=h+s},k=g.textAlign(i);let p,E,C,w,_,B,x;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Tr(this,k,r),o.fillStyle=r.bodyColor,Le(this.beforeBody,y),m=l&&k!=="right"?i==="center"?d/2+u:d+2+u:0,w=0,B=a.length;w<B;++w){for(p=a[w],E=this.labelTextColors[w],o.fillStyle=E,Le(p.before,y),C=p.lines,l&&C.length&&(this._drawColorBox(o,n,w,g,r),h=Math.max(f.lineHeight,c)),_=0,x=C.length;_<x;++_)y(C[_]),h=f.lineHeight;Le(p.after,y)}m=0,h=f.lineHeight,Le(this.afterBody,y),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=Qn(r.rtl,this.x,this.width);for(n.x=Tr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=mt(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:g}=Kn(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=Ro[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=Kc(this,n),c=Object.assign({},i,this._size),d=Yc(o,n,c),u=Jc(n,c,d,o);(a._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 r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=At(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=r,this.drawBackground(s,n,a,o),Rl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),Ll(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=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=!lr(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!lr(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)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,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=Ro[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}ye(ys,"positioners",Ro);var iy={id:"tooltip",_element:ys,positioners:Ro,afterInit(t,n,o){o&&(t.tooltip=new ys({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.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:(t,n)=>n.bodyFont.size,boxWidth:(t,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:ed},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ly=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function cy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return ly(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const dy=(t,n)=>t===null?null:ft(Math.round(t),0,n);function td(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class xs extends eo{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(Ie(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:cy(r,n,Ae(o,n),this._addedLabels),dy(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return td.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}}ye(xs,"id","category"),ye(xs,"defaults",{ticks:{callback:td}});function uy(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,g=u-1,{min:y,max:k}=n,p=!Ie(i),E=!Ie(l),C=!Ie(d),w=(k-y)/(f+1);let _=hl((k-y)/g/m)*m,B,x,b,S;if(_<1e-14&&!p&&!E)return[{value:y},{value:k}];S=Math.ceil(k/_)-Math.floor(y/_),S>g&&(_=hl(S*_/g/m)*m),Ie(c)||(B=Math.pow(10,c),_=Math.ceil(_*B)/B),a==="ticks"?(x=Math.floor(y/_)*_,b=Math.ceil(k/_)*_):(x=y,b=k),p&&E&&s&&mp((l-i)/s,_/1e3)?(S=Math.round(Math.min((l-i)/_,u)),_=(l-i)/S,x=i,b=l):C?(x=p?i:x,b=E?l:b,S=d-1,_=(b-x)/S):(S=(b-x)/_,Bo(S,Math.round(S),_/1e3)?S=Math.round(S):S=Math.ceil(S));const D=Math.max(ml(_),ml(x));B=Math.pow(10,Ie(c)?D:c),x=Math.round(x*B)/B,b=Math.round(b*B)/B;let M=0;for(p&&(h&&x!==i?(o.push({value:i}),x<i&&M++,Bo(Math.round((x+M*_)*B)/B,i,nd(i,w,t))&&M++):x<i&&M++);M<S;++M){const N=Math.round((x+M*_)*B)/B;if(E&&N>l)break;o.push({value:N})}return E&&h&&b!==l?o.length&&Bo(o[o.length-1].value,l,nd(l,w,t))?o[o.length-1].value=l:o.push({value:l}):(!E||b===l)&&o.push({value:b}),o}function nd(t,n,{horizontal:o,minRotation:r}){const a=Qt(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class fy extends eo{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 Ie(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=$t(a),d=$t(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,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=uy(a,s);return n.bounds==="ticks"&&pp(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,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return Ha(n,this.chart.options.locale,this.options.ticks.format)}}class ks extends fy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=ut(n)?n:0,this.max=ut(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=Qt(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}ye(ks,"id","linear"),ye(ks,"defaults",{ticks:{callback:_l.formatters.numeric}});const Or={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}},yt=Object.keys(Or);function od(t,n){return t-n}function rd(t,n){if(Ie(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),ut(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(_o(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function ad(t,n,o,r){const a=yt.length;for(let s=yt.indexOf(t);s<a-1;++s){const i=Or[yt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return yt[s]}return yt[a-1]}function hy(t,n,o,r,a){for(let s=yt.length-1;s>=yt.indexOf(o);s--){const i=yt[s];if(Or[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return yt[o?yt.indexOf(o):0]}function my(t){for(let n=yt.indexOf(t)+1,o=yt.length;n<o;++n)if(Or[yt[n]].common)return yt[n]}function sd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=$a(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function py(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function id(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:py(t,r,a,o)}class Fr extends eo{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 r=n.time||(n.time={}),a=this._adapter=new Jg._date(n.adapters.date);a.init(o),Co(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:rd(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,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))),a=ut(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=ut(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=kp(a,s,i);return this._unit=o.unit||(r.autoSkip?ad(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):hy(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:my(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),id(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=ft(o,0,i),r=ft(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||ad(s.minUnit,o,r,this._getLabelCapacity(o)),l=Ae(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=_o(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(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const g=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+n.add(h,l,i),m++)sd(u,h,g);return(h===r||a.bounds==="ticks"||m===1)&&sd(u,h,g),Object.keys(u).sort(od).map(y=>+y)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return qe(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[o],m=d&&f&&h&&h.major;return this._adapter.format(n,a||(m?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=Qt(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,id(this,[n],this._majorUnit),a),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,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(rd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return yl(n.sort(od))}}ye(Fr,"id","time"),ye(Fr,"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 zr(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=Mn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=Mn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class ld extends Fr{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=zr(o,this.min),this._tableRange=zr(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[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 r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(zr(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return zr(this._table,r*this._tableRange+this._minPos,!0)}}ye(ld,"id","timeseries"),ye(ld,"defaults",Fr.defaults);const gy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},by={key:0,class:"text-red-500 ml-1"},yy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},xy={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},ky={class:"text-red-600 text-sm"},wy={key:1,class:"mt-2 text-xs text-gray-500"},Cy={key:0},cd=wt(e.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(t,{expose:n,emit:o}){nn.register(xs,ks,Mr,gn,vr,Io,Zb,iy,Jb,Hb,wr,kr,as,Zn);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},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:r.type!=="pie"&&r.type!=="doughnut"&&r.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,g)=>{const y=g%r.colors.length,k=r.colors[y];let p=m.backgroundColor,E=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((C,w)=>r.colors[w%r.colors.length]+"80"),E=m.data.map((C,w)=>r.colors[w%r.colors.length])):(p=p||k+"40",E=E||k),{...m,borderColor:E,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||k,pointBorderColor:m.pointBorderColor||k,hoverBackgroundColor:m.hoverBackgroundColor||k+"60",hoverBorderColor:m.hoverBorderColor||k}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const y=Object.keys(h[0]),k=y.find(E=>["label","name","x","category","title"].includes(E.toLowerCase()))||y[0],p=y.find(E=>E!==k&&["value","y","count","amount","total","data"].includes(E.toLowerCase()))||y.find(E=>E!==k&&typeof h[0][E]=="number")||(y.length>1?y.find(E=>E!==k):y[0]);m={labels:h.map(E=>E[k||""]),datasets:[{label:r.label||"Data",data:h.map(E=>E[p||""])}]}}else h.length>0?m={labels:h.map((y,k)=>`Data ${k+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(y,k)=>{a("click",y,k),r.onClick&&r.onClick(y,k)},onHover:(y,k)=>{a("hover",y,k),r.onHover&&r.onHover(y,k)}};i.value=new nn(s.value,{type:r.type,data:l.value,options:g}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",gy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",by,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",yy,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",xy,[e.createElementVNode("div",ky,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",wy,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",Cy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Lo=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ke.Label),e.mergeProps(e.unref(o),{class:e.unref(ve)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ey={class:"grid gap-1.5"},By={key:0,class:"ml-1 text-destructive"},_y=["aria-busy"],Sy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Ay={key:1,class:"flex items-center"},Vy=["id","checked","indeterminate","disabled","required"],rn=wt(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(a.disabled)return;const h=!d.value;d.value=h,r("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Ey,[t.label?(e.openBlock(),e.createBlock(Lo,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",By,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Sy)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",Ay,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Vy),e.createElementVNode("div",{class:e.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||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.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"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,_y),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-f9cef4a6"]]),Dy={class:"w-full"},Ny={key:0,class:"mb-4"},My={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},vy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Py={key:0,class:"ml-1 text-destructive"},Ty={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Oy={key:1,class:"flex flex-wrap gap-4"},Fy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},zy={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Iy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},ws=wt(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=nt(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,_=>{if(!_){s.value=new Set;return}const B=_.map(x=>typeof x=="object"&&x!==null?x.id!==void 0?x.id:x.value:x);s.value=new Set(B)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var B,x;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!_&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const S=((x=a.endpoint)==null?void 0:x.apiMethod)||a.apiMethod||"GET",D={page:1,perPage:100,...a.apiParams};if(_)b=await o(_,S,D);else if(a.apiModule&&a.apiAction){const{DCodeApi:N}=nt();b=await N(a.apiModule,a.apiAction,D)}let M=b;a.dataPath?M=a.dataPath.split(".").reduce((P,T)=>P&&P[T]!==void 0?P[T]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(M=b.data),Array.isArray(M)?i.value=M:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&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"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=_=>{if(typeof _!="object"||_===null)return _;const B=a.itemValue||a.model||"id";return _[B]},y=_=>{if(typeof _!="object"||_===null)return String(_);const B=a.itemTitle||"name";return _[B]},k=_=>s.value.has(_),p=(_,B)=>{if(a.disabled)return;const x=new Set(s.value);B?x.add(_):x.delete(_),s.value=x;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},E=e.computed(()=>a.skeleton||l.value),C=e.computed(()=>!!a.error||!!c.value),w=e.computed(()=>a.error||c.value);return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Dy,[t.label||E.value?(e.openBlock(),e.createElementBlock("div",Ny,[E.value?(e.openBlock(),e.createElementBlock("div",My)):(e.openBlock(),e.createElementBlock("h3",vy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Py,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Ty,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",Oy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,x=>e.createElementVNode("div",{key:`skeleton-${x}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...B[1]||(B[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",Fy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",zy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(x,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(rn,{"model-value":k(g(x)),title:y(x),disabled:t.disabled,"onUpdate:modelValue":S=>p(g(x),S)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),C.value&&w.value?(e.openBlock(),e.createElementBlock("div",Iy,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(w.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ry=["aria-busy"],Ly={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},$y={key:1,class:"flex justify-end"},jy=["for"],Wy={key:0,class:"ml-1 text-destructive"},Uy={class:"relative w-full group"},Hy={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},qy={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Gy=["id","disabled","readonly","placeholder","maxlength"],Xy={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"},Ky={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Cs=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const M=o.required,N=o["aria-required"];return M===""||M===!0||M==="true"||(N==="true"||N===!0)}),c=e.computed(()=>{const M=o.maxlength??o.maxLength;let N=Number.NaN;return typeof M=="number"?N=M:typeof M=="string"&&(N=Number.parseInt(M,10)),Number.isFinite(N)&&N>0?N:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=M=>{const N=M.replaceAll(/\D/g,"");return N?Number(N):null},m=M=>f.value.format(M),g=e.ref(""),y=e.ref(null);e.watch(()=>a.modelValue,M=>{M==null?g.value="":h(g.value)!==M&&(g.value=m(M))},{immediate:!0});const k=(M,N)=>{let P=0;for(let T=0;T<N;T++)/\d/.test(M[T])&&P++;return P},p=(M,N)=>{let P=0;for(let T=0;T<M.length;T++)if(/\d/.test(M[T])&&(P++,P===N))return T+1;return M.length},E=M=>{const N=M.target,P=N.value,T=N.selectionStart??P.length,K=h(P);if(K===null){g.value="",r("update:modelValue",null);return}const $=m(K);if(P!==$){const H=k(P,T);g.value=$,e.nextTick(()=>{if(y.value){const ee=p($,H);y.value.setSelectionRange(ee,ee)}})}r("update:modelValue",K)},C=()=>{g.value="",r("update:modelValue",null),r("clear")},w=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),_=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:M,maxlength:N,maxLength:P,...T}=o;return T}),x=e.computed(()=>g.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),S=e.computed(()=>b.value&&x.value>0),D=e.computed(()=>`${x.value} / ${c.value}`);return(M,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Ly)):e.createCommentVNode("",!0),N[2]||(N[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",$y,[...N[1]||(N[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Wy,"*")):e.createCommentVNode("",!0)],8,jy)):e.createCommentVNode("",!0),e.createElementVNode("div",Uy,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",_.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",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",Hy,[e.createElementVNode("span",qy,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:y,"onUpdate:modelValue":N[0]||(N[0]=P=>g.value=P),onInput:E,type:"text",inputmode:"numeric"},B.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.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",w.value?"pr-8":""]}),null,16,Gy),[[e.vModelText,g.value]]),w.value?(e.openBlock(),e.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:C},[e.createVNode(e.unref(ce.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),S.value&&!_.value?(e.openBlock(),e.createElementBlock("p",Xy,e.toDisplayString(D.value),1)):e.createCommentVNode("",!0)]),_.value?(e.openBlock(),e.createElementBlock("p",Ky,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ry))}}),dd=6048e5,Yy=864e5,ud=Symbol.for("constructDateFrom");function yn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&ud in t?t[ud](n):t instanceof Date?new t.constructor(n):new Date(n)}function Ot(t,n){return yn(n||t,t)}let Jy={};function Ir(){return Jy}function $o(t,n){var l,c,d,u;const o=Ir(),r=(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,a=Ot(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Rr(t,n){return $o(t,{...n,weekStartsOn:1})}function fd(t,n){const o=Ot(t,n==null?void 0:n.in),r=o.getFullYear(),a=yn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Rr(a),i=yn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=Rr(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function hd(t){const n=Ot(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function Qy(t,...n){const o=yn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function md(t,n){const o=Ot(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function Zy(t,n,o){const[r,a]=Qy(o==null?void 0:o.in,t,n),s=md(r),i=md(a),l=+s-hd(s),c=+i-hd(i);return Math.round((l-c)/Yy)}function ex(t,n){const o=fd(t,n),r=yn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),Rr(r)}function tx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nx(t){return!(!tx(t)&&typeof t!="number"||isNaN(+Ot(t)))}function ox(t,n){const o=Ot(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const rx={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"}},ax=(t,n,o)=>{let r;const a=rx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function no(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const sx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ix={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cx={date:no({formats:sx,defaultWidth:"full"}),time:no({formats:ix,defaultWidth:"full"}),dateTime:no({formats:lx,defaultWidth:"full"})},dx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ux=(t,n,o,r)=>dx[t];function Ut(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const fx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},px={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"]},gx={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"}},bx={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"}},yx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Ut({values:fx,defaultWidth:"wide"}),quarter:Ut({values:hx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ut({values:mx,defaultWidth:"wide"}),day:Ut({values:px,defaultWidth:"wide"}),dayPeriod:Ut({values:gx,defaultWidth:"wide",formattingValues:bx,defaultFormattingWidth:"wide"})};function Ht(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?kx(l,f=>f.test(i)):xx(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function xx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function kx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function pd(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const wx=/^(\d+)(th|st|nd|rd)?/i,Cx=/\d+/i,Ex={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},Bx={any:[/^b/i,/^(a|c)/i]},_x={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sx={any:[/1/i,/2/i,/3/i,/4/i]},Ax={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},Vx={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]},Dx={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},Nx={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]},Mx={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},vx={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}},Px={ordinalNumber:pd({matchPattern:wx,parsePattern:Cx,valueCallback:t=>parseInt(t,10)}),era:Ht({matchPatterns:Ex,defaultMatchWidth:"wide",parsePatterns:Bx,defaultParseWidth:"any"}),quarter:Ht({matchPatterns:_x,defaultMatchWidth:"wide",parsePatterns:Sx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ht({matchPatterns:Ax,defaultMatchWidth:"wide",parsePatterns:Vx,defaultParseWidth:"any"}),day:Ht({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Nx,defaultParseWidth:"any"}),dayPeriod:Ht({matchPatterns:Mx,defaultMatchWidth:"any",parsePatterns:vx,defaultParseWidth:"any"})},gd={code:"en-US",formatDistance:ax,formatLong:cx,formatRelative:ux,localize:yx,match:Px,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Tx(t,n){const o=Ot(t,n==null?void 0:n.in);return Zy(o,ox(o))+1}function Ox(t,n){const o=Ot(t,n==null?void 0:n.in),r=+Rr(o)-+ex(o);return Math.round(r/dd)+1}function bd(t,n){var u,f,h,m;const o=Ot(t,n==null?void 0:n.in),r=o.getFullYear(),a=Ir(),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)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=yn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=$o(i,n),c=yn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=$o(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function Fx(t,n){var l,c,d,u;const o=Ir(),r=(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,a=bd(t,n),s=yn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),$o(s,n)}function zx(t,n){const o=Ot(t,n==null?void 0:n.in),r=+$o(o,n)-+Fx(o,n);return Math.round(r/dd)+1}function je(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const xn={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return je(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):je(o+1,2)},d(t,n){return je(t.getDate(),n.length)},a(t,n){const o=t.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(t,n){return je(t.getHours()%12||12,n.length)},H(t,n){return je(t.getHours(),n.length)},m(t,n){return je(t.getMinutes(),n.length)},s(t,n){return je(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return je(a,n.length)}},oo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return xn.y(t,n)},Y:function(t,n,o,r){const a=bd(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return je(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):je(s,n.length)},R:function(t,n){const o=fd(t);return je(o,n.length)},u:function(t,n){const o=t.getFullYear();return je(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return je(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return je(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return xn.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return je(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=zx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):je(a,n.length)},I:function(t,n,o){const r=Ox(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):je(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):xn.d(t,n)},D:function(t,n,o){const r=Tx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):je(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":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"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return je(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});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"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return je(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return je(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=oo.noon:r===0?a=oo.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=oo.evening:r>=12?a=oo.afternoon:r>=4?a=oo.morning:a=oo.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return xn.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):xn.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):je(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):je(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):xn.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):xn.s(t,n)},S:function(t,n){return xn.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return kd(r);case"XXXX":case"XX":return Ln(r);case"XXXXX":case"XXX":default:return Ln(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return kd(r);case"xxxx":case"xx":return Ln(r);case"xxxxx":case"xxx":default:return Ln(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+xd(r,":");case"OOOO":default:return"GMT"+Ln(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+xd(r,":");case"zzzz":default:return"GMT"+Ln(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return je(r,n.length)},T:function(t,n,o){return je(+t,n.length)}};function xd(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+je(s,2)}function kd(t,n){return t%60===0?(t>0?"-":"+")+je(Math.abs(t)/60,2):Ln(t,n)}function Ln(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=je(Math.trunc(r/60),2),s=je(r%60,2);return o+a+n+s}const wd=(t,n)=>{switch(t){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"})}},Cd=(t,n)=>{switch(t){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"})}},Ix={p:Cd,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return wd(t,n);let s;switch(r){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}}",wd(r,n)).replace("{{time}}",Cd(a,n))}},Rx=/^D+$/,Lx=/^Y+$/,$x=["D","DD","YY","YYYY"];function jx(t){return Rx.test(t)}function Wx(t){return Lx.test(t)}function Ux(t,n,o){const r=Hx(t,n,o);if(console.warn(r),$x.includes(t))throw new RangeError(r)}function Hx(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Gx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Kx=/''/g,Yx=/[a-zA-Z]/;function Ed(t,n,o){var u,f,h,m;const r=Ir(),a=r.locale??gd,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Ot(t,o==null?void 0:o.in);if(!nx(l))throw new RangeError("Invalid time value");let c=n.match(Gx).map(g=>{const y=g[0];if(y==="p"||y==="P"){const k=Ix[y];return k(g,a.formatLong)}return g}).join("").match(qx).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:Jx(g)};if(yd[y])return{isToken:!0,value:g};if(y.match(Yx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const y=g.value;(Wx(y)||jx(y))&&Ux(y,n,String(t));const k=yd[y[0]];return k(l,y,a.localize,d)}).join("")}function Jx(t){const n=t.match(Xx);return n?n[1].replace(Kx,"'"):t}const Qx={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"}},Zx=(t,n,o)=>{let r;const a=Qx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},ek={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},tk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},nk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ok={date:no({formats:ek,defaultWidth:"full"}),time:no({formats:tk,defaultWidth:"full"}),dateTime:no({formats:nk,defaultWidth:"full"})},rk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},ak=(t,n,o,r)=>rk[t],sk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},ik={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},lk={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"]},ck={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"]},dk={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"}},uk={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"}},fk={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Ut({values:sk,defaultWidth:"wide"}),quarter:Ut({values:ik,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ut({values:lk,defaultWidth:"wide"}),day:Ut({values:ck,defaultWidth:"wide"}),dayPeriod:Ut({values:dk,defaultWidth:"wide",formattingValues:uk,defaultFormattingWidth:"wide"})},hk=/^ke-(\d+)?/i,mk=/\d+/i,pk={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},gk={any:[/^s/i,/^(m|e)/i]},bk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},yk={any:[/1/i,/2/i,/3/i,/4/i]},xk={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},kk={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]},wk={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},Ck={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]},Ek={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},Bk={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}},_k={ordinalNumber:pd({matchPattern:hk,parsePattern:mk,valueCallback:t=>parseInt(t,10)}),era:Ht({matchPatterns:pk,defaultMatchWidth:"wide",parsePatterns:gk,defaultParseWidth:"any"}),quarter:Ht({matchPatterns:bk,defaultMatchWidth:"wide",parsePatterns:yk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ht({matchPatterns:xk,defaultMatchWidth:"wide",parsePatterns:kk,defaultParseWidth:"any"}),day:Ht({matchPatterns:wk,defaultMatchWidth:"wide",parsePatterns:Ck,defaultParseWidth:"any"}),dayPeriod:Ht({matchPatterns:Ek,defaultMatchWidth:"any",parsePatterns:Bk,defaultParseWidth:"any"})},Sk={code:"id",formatDistance:Zx,formatLong:ok,formatRelative:ak,localize:fk,match:_k,options:{weekStartsOn:1,firstWeekContainsDate:1}},Bd={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)"}}},_d="dcode-dp-theme-forced";function Ak(t,n=_d){const o=Bd[t]??Bd.primary,r=`
18
+ `):t}function sy(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function td(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=pt(n.bodyFont),d=pt(n.titleFont),u=pt(n.footerFont),f=s.length,h=a.length,m=r.length,g=Tt(n.padding);let b=g.height,x=0,p=r.reduce((C,_)=>C+_.before.length+_.lines.length+_.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const C=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*C+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}h&&(b+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let E=0;const w=function(C){x=Math.max(x,o.measureText(C).width+E)};return o.save(),o.font=d.string,Ge(t.title,w),o.font=c.string,Ge(t.beforeBody.concat(t.afterBody),w),E=n.displayColors?i+2+n.boxPadding:0,Ge(r,C=>{Ge(C.before,w),Ge(C.lines,w),Ge(C.after,w)}),E=0,o.font=u.string,Ge(t.footer,w),o.restore(),x+=g.width,{width:x,height:b}}function iy(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function ly(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function cy(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),ly(d,t,n,o)&&(d="center"),d}function nd(t,n,o){const r=o.yAlign||n.yAlign||iy(t,o);return{xAlign:o.xAlign||n.xAlign||cy(t,n,o,r),yAlign:r}}function dy(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function uy(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function od(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Zn(i);let g=dy(n,l);const b=uy(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+a:l==="right"&&(g+=Math.max(f,m)+a),{x:ht(g,0,r.width-n.width),y:ht(b,0,r.height-n.height)}}function Rr(t,n,o){const r=Tt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function rd(t){return Yt([],fn(t))}function fy(t,n,o){return Rn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function ad(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const sd={beforeTitle:an,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:an,beforeBody:an,beforeLabel:an,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return We(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:an,afterBody:an,beforeFooter:an,footer:an,afterFooter:an};function bt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?sd[n].call(o,r):a}class Cs extends dn{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,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new tc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=fy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=bt(r,"beforeTitle",this,n),s=bt(r,"title",this,n),i=bt(r,"afterTitle",this,n);let l=[];return l=Yt(l,fn(a)),l=Yt(l,fn(s)),l=Yt(l,fn(i)),l}getBeforeBody(n,o){return rd(bt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Ge(n,s=>{const i={before:[],lines:[],after:[]},l=ad(r,s);Yt(i.before,fn(bt(l,"beforeLabel",this,s))),Yt(i.lines,bt(l,"label",this,s)),Yt(i.after,fn(bt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return rd(bt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=bt(r,"beforeFooter",this,n),s=bt(r,"footer",this,n),i=bt(r,"afterFooter",this,n);let l=[];return l=Yt(l,fn(a)),l=Yt(l,fn(s)),l=Yt(l,fn(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(sy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Ge(l,u=>{const f=ad(n.callbacks,u);a.push(bt(f,"labelColor",this,u)),s.push(bt(f,"labelPointStyle",this,u)),i.push(bt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=Wo[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=td(this,r),d=Object.assign({},l,c),u=nd(this.chart,r,d),f=od(r,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&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Zn(l),{x:h,y:m}=n,{width:g,height:b}=o;let x,p,E,w,C,_;return s==="center"?(C=m+b/2,a==="left"?(x=h,p=x-i,w=C+i,_=C-i):(x=h+g,p=x+i,w=C-i,_=C+i),E=x):(a==="left"?p=h+Math.max(c,u)+i:a==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(w=m,C=w-i,x=p-i,E=p+i):(w=m+b,C=w+i,x=p+i,E=p-i),_=w),{x1:x,x2:p,x3:E,y1:w,y2:C,y3:_}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=no(r.rtl,this.x,this.width);for(n.x=Rr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=pt(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=pt(s.bodyFont),f=Rr(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(h,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Qa(n,b,x,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Qa(n,b,x,p)}else{n.lineWidth=ze(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 b=a.leftForLtr(h,d),x=a.leftForLtr(a.xPlus(h,1),d-2),p=Zn(i.borderRadius);Object.values(p).some(E=>E!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,xr(n,{x:b,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),xr(n,{x,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(b,g,d,c),n.strokeRect(b,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(x,g+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=pt(r.bodyFont);let h=f.lineHeight,m=0;const g=no(r.rtl,this.x,this.width),b=function(y){o.fillText(y,g.x(n.x+m),n.y+h/2),n.y+=h+s},x=g.textAlign(i);let p,E,w,C,_,B,k;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Rr(this,x,r),o.fillStyle=r.bodyColor,Ge(this.beforeBody,b),m=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,C=0,B=a.length;C<B;++C){for(p=a[C],E=this.labelTextColors[C],o.fillStyle=E,Ge(p.before,b),w=p.lines,l&&w.length&&(this._drawColorBox(o,n,C,g,r),h=Math.max(f.lineHeight,c)),_=0,k=w.length;_<k;++_)b(w[_]),h=f.lineHeight;Ge(p.after,b)}m=0,h=f.lineHeight,Ge(this.afterBody,b),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=no(r.rtl,this.x,this.width);for(n.x=Rr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=pt(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:g}=Zn(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=Wo[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=td(this,n),c=Object.assign({},i,this._size),d=nd(o,n,c),u=od(n,c,d,o);(a._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 r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=Tt(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=r,this.drawBackground(s,n,a,o),Hl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),ql(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=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=!hr(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!hr(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)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,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=Wo[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}be(Cs,"positioners",Wo);var hy={id:"tooltip",_element:Cs,positioners:Wo,afterInit(t,n,o){o&&(t.tooltip=new Cs({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.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:(t,n)=>n.bodyFont.size,boxWidth:(t,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:sd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const my=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function py(t,n,o,r){const a=t.indexOf(n);if(a===-1)return my(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const gy=(t,n)=>t===null?null:ht(Math.round(t),0,n);function id(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class Es extends ro{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(We(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:py(r,n,Pe(o,n),this._addedLabels),gy(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return id.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}}be(Es,"id","category"),be(Es,"defaults",{ticks:{callback:id}});function by(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,g=u-1,{min:b,max:x}=n,p=!We(i),E=!We(l),w=!We(d),C=(x-b)/(f+1);let _=xl((x-b)/g/m)*m,B,k,y,A;if(_<1e-14&&!p&&!E)return[{value:b},{value:x}];A=Math.ceil(x/_)-Math.floor(b/_),A>g&&(_=xl(A*_/g/m)*m),We(c)||(B=Math.pow(10,c),_=Math.ceil(_*B)/B),a==="ticks"?(k=Math.floor(b/_)*_,y=Math.ceil(x/_)*_):(k=b,y=x),p&&E&&s&&kp((l-i)/s,_/1e3)?(A=Math.round(Math.min((l-i)/_,u)),_=(l-i)/A,k=i,y=l):w?(k=p?i:k,y=E?l:y,A=d-1,_=(y-k)/A):(A=(y-k)/_,Vo(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const V=Math.max(kl(_),kl(k));B=Math.pow(10,We(c)?V:c),k=Math.round(k*B)/B,y=Math.round(y*B)/B;let M=0;for(p&&(h&&k!==i?(o.push({value:i}),k<i&&M++,Vo(Math.round((k+M*_)*B)/B,i,ld(i,C,t))&&M++):k<i&&M++);M<A;++M){const D=Math.round((k+M*_)*B)/B;if(E&&D>l)break;o.push({value:D})}return E&&h&&y!==l?o.length&&Vo(o[o.length-1].value,l,ld(l,C,t))?o[o.length-1].value=l:o.push({value:l}):(!E||y===l)&&o.push({value:y}),o}function ld(t,n,{horizontal:o,minRotation:r}){const a=sn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class yy extends ro{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 We(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=Xt(a),d=Xt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,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=by(a,s);return n.bounds==="ticks"&&wp(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,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return Ka(n,this.chart.options.locale,this.options.ticks.format)}}class Bs extends yy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=ft(n)?n:0,this.max=ft(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=sn(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}be(Bs,"id","linear"),be(Bs,"defaults",{ticks:{callback:Ml.formatters.numeric}});const Lr={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}},yt=Object.keys(Lr);function cd(t,n){return t-n}function dd(t,n){if(We(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),ft(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(Do(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function ud(t,n,o,r){const a=yt.length;for(let s=yt.indexOf(t);s<a-1;++s){const i=Lr[yt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return yt[s]}return yt[a-1]}function xy(t,n,o,r,a){for(let s=yt.length-1;s>=yt.indexOf(o);s--){const i=yt[s];if(Lr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return yt[o?yt.indexOf(o):0]}function ky(t){for(let n=yt.indexOf(t)+1,o=yt.length;n<o;++n)if(Lr[yt[n]].common)return yt[n]}function fd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=Ha(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function wy(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function hd(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:wy(t,r,a,o)}class $r extends ro{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 r=n.time||(n.time={}),a=this._adapter=new o0._date(n.adapters.date);a.init(o),So(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:dd(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,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))),a=ft(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=ft(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=Sp(a,s,i);return this._unit=o.unit||(r.autoSkip?ud(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):xy(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ky(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),hd(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=ht(o,0,i),r=ht(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||ud(s.minUnit,o,r,this._getLabelCapacity(o)),l=Pe(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Do(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(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const g=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+n.add(h,l,i),m++)fd(u,h,g);return(h===r||a.bounds==="ticks"||m===1)&&fd(u,h,g),Object.keys(u).sort(cd).map(b=>+b)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return Je(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[o],m=d&&f&&h&&h.major;return this._adapter.format(n,a||(m?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=sn(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,hd(this,[n],this._majorUnit),a),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,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(dd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return Bl(n.sort(cd))}}be($r,"id","time"),be($r,"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 jr(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=Fn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=Fn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class md extends $r{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=jr(o,this.min),this._tableRange=jr(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[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 r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(jr(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return jr(this._table,r*this._tableRange+this._minPos,!0)}}be(md,"id","timeseries"),be(md,"defaults",$r.defaults);const Cy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Ey={key:0,class:"text-red-500 ml-1"},By={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},_y={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Sy={class:"text-red-600 text-sm"},Ay={key:1,class:"mt-2 text-xs text-gray-500"},Vy={key:0},pd=Et(e.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(t,{expose:n,emit:o}){un.register(Es,Bs,Fr,En,zr,jo,ay,hy,oy,Jb,Sr,_r,cs,oo);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},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:r.type!=="pie"&&r.type!=="doughnut"&&r.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,g)=>{const b=g%r.colors.length,x=r.colors[b];let p=m.backgroundColor,E=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((w,C)=>r.colors[C%r.colors.length]+"80"),E=m.data.map((w,C)=>r.colors[C%r.colors.length])):(p=p||x+"40",E=E||x),{...m,borderColor:E,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||x,pointBorderColor:m.pointBorderColor||x,hoverBackgroundColor:m.hoverBackgroundColor||x+"60",hoverBorderColor:m.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.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]),x=b.find(E=>["label","name","x","category","title"].includes(E.toLowerCase()))||b[0],p=b.find(E=>E!==x&&["value","y","count","amount","total","data"].includes(E.toLowerCase()))||b.find(E=>E!==x&&typeof h[0][E]=="number")||(b.length>1?b.find(E=>E!==x):b[0]);m={labels:h.map(E=>E[x||""]),datasets:[{label:r.label||"Data",data:h.map(E=>E[p||""])}]}}else h.length>0?m={labels:h.map((b,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(b,x)=>{a("click",b,x),r.onClick&&r.onClick(b,x)},onHover:(b,x)=>{a("hover",b,x),r.onHover&&r.onHover(b,x)}};i.value=new un(s.value,{type:r.type,data:l.value,options:g}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Cy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ey,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",By,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",_y,[e.createElementVNode("div",Sy,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",Ay,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",Vy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Uo=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.Label),e.mergeProps(e.unref(o),{class:e.unref(Fe)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Dy={class:"grid gap-1.5"},Ny={key:0,class:"ml-1 text-destructive"},My=["aria-busy"],vy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Py={key:1,class:"flex items-center"},Ty=["id","checked","indeterminate","disabled","required"],hn=Et(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(a.disabled)return;const h=!d.value;d.value=h,r("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Dy,[t.label?(e.openBlock(),e.createBlock(Uo,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ny,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",vy)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",Py,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Ty),e.createElementVNode("div",{class:e.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||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(le.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.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"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,My),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),Oy={class:"w-full"},Fy={key:0,class:"mb-4"},zy={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Iy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ry={key:0,class:"ml-1 text-destructive"},Ly={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},$y={key:1,class:"flex flex-wrap gap-4"},jy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Wy={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Uy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},_s=Et(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=st(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,_=>{if(!_){s.value=new Set;return}const B=_.map(k=>typeof k=="object"&&k!==null?k.id!==void 0?k.id:k.value:k);s.value=new Set(B)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var B,k;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!_&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let y;const A=((k=a.endpoint)==null?void 0:k.apiMethod)||a.apiMethod||"GET",V={page:1,perPage:100,...a.apiParams};if(_)y=await o(_,A,V);else if(a.apiModule&&a.apiAction){const{DCodeApi:D}=st();y=await D(a.apiModule,a.apiAction,V)}let M=y;a.dataPath?M=a.dataPath.split(".").reduce((T,P)=>T&&T[P]!==void 0?T[P]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(M=y.data),Array.isArray(M)?i.value=M:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(y){console.error("DCodeCardCheckboxList fetch error:",y),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&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"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=_=>{if(typeof _!="object"||_===null)return _;const B=a.itemValue||a.model||"id";return _[B]},b=_=>{if(typeof _!="object"||_===null)return String(_);const B=a.itemTitle||"name";return _[B]},x=_=>s.value.has(_),p=(_,B)=>{if(a.disabled)return;const k=new Set(s.value);B?k.add(_):k.delete(_),s.value=k;const y=Array.from(s.value);r("update:modelValue",y),r("change",y)},E=e.computed(()=>a.skeleton||l.value),w=e.computed(()=>!!a.error||!!c.value),C=e.computed(()=>a.error||c.value);return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Oy,[t.label||E.value?(e.openBlock(),e.createElementBlock("div",Fy,[E.value?(e.openBlock(),e.createElementBlock("div",zy)):(e.openBlock(),e.createElementBlock("h3",Iy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ry,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Ly,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",$y,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,k=>e.createElementVNode("div",{key:`skeleton-${k}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...B[1]||(B[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",jy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Wy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"flex items-start"},[e.createVNode(hn,{"model-value":x(g(k)),title:b(k),disabled:t.disabled,"onUpdate:modelValue":A=>p(g(k),A)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),w.value&&C.value?(e.openBlock(),e.createElementBlock("div",Uy,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Hy=["aria-busy"],qy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Gy={key:1,class:"flex justify-end"},Xy=["for"],Ky={key:0,class:"ml-1 text-destructive"},Yy={class:"relative w-full group"},Jy={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Qy={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Zy=["id","disabled","readonly","placeholder","maxlength"],ex={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"},tx={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Ss=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const M=o.required,D=o["aria-required"];return M===""||M===!0||M==="true"||(D==="true"||D===!0)}),c=e.computed(()=>{const M=o.maxlength??o.maxLength;let D=Number.NaN;return typeof M=="number"?D=M:typeof M=="string"&&(D=Number.parseInt(M,10)),Number.isFinite(D)&&D>0?D:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=M=>{const D=M.replaceAll(/\D/g,"");return D?Number(D):null},m=M=>f.value.format(M),g=e.ref(""),b=e.ref(null);e.watch(()=>a.modelValue,M=>{M==null?g.value="":h(g.value)!==M&&(g.value=m(M))},{immediate:!0});const x=(M,D)=>{let T=0;for(let P=0;P<D;P++)/\d/.test(M[P])&&T++;return T},p=(M,D)=>{let T=0;for(let P=0;P<M.length;P++)if(/\d/.test(M[P])&&(T++,T===D))return P+1;return M.length},E=M=>{const D=M.target,T=D.value,P=D.selectionStart??T.length,K=h(T);if(K===null){g.value="",r("update:modelValue",null);return}const L=m(K);if(T!==L){const G=x(T,P);g.value=L,e.nextTick(()=>{if(b.value){const Q=p(L,G);b.value.setSelectionRange(Q,Q)}})}r("update:modelValue",K)},w=()=>{g.value="",r("update:modelValue",null),r("clear")},C=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),_=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:M,maxlength:D,maxLength:T,...P}=o;return P}),k=e.computed(()=>g.value.length),y=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),A=e.computed(()=>y.value&&k.value>0),V=e.computed(()=>`${k.value} / ${c.value}`);return(M,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",qy)):e.createCommentVNode("",!0),D[2]||(D[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),y.value?(e.openBlock(),e.createElementBlock("div",Gy,[...D[1]||(D[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Ky,"*")):e.createCommentVNode("",!0)],8,Xy)):e.createCommentVNode("",!0),e.createElementVNode("div",Yy,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",_.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",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",Jy,[e.createElementVNode("span",Qy,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":D[0]||(D[0]=T=>g.value=T),onInput:E,type:"text",inputmode:"numeric"},B.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.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,Zy),[[e.vModelText,g.value]]),C.value?(e.openBlock(),e.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},[e.createVNode(e.unref(le.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),A.value&&!_.value?(e.openBlock(),e.createElementBlock("p",ex,e.toDisplayString(V.value),1)):e.createCommentVNode("",!0)]),_.value?(e.openBlock(),e.createElementBlock("p",tx,[e.createVNode(e.unref(le.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Hy))}}),gd=6048e5,nx=864e5,bd=Symbol.for("constructDateFrom");function _n(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&bd in t?t[bd](n):t instanceof Date?new t.constructor(n):new Date(n)}function Wt(t,n){return _n(n||t,t)}let ox={};function Wr(){return ox}function Ho(t,n){var l,c,d,u;const o=Wr(),r=(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,a=Wt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Ur(t,n){return Ho(t,{...n,weekStartsOn:1})}function yd(t,n){const o=Wt(t,n==null?void 0:n.in),r=o.getFullYear(),a=_n(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Ur(a),i=_n(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=Ur(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function xd(t){const n=Wt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function rx(t,...n){const o=_n.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function kd(t,n){const o=Wt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function ax(t,n,o){const[r,a]=rx(o==null?void 0:o.in,t,n),s=kd(r),i=kd(a),l=+s-xd(s),c=+i-xd(i);return Math.round((l-c)/nx)}function sx(t,n){const o=yd(t,n),r=_n(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),Ur(r)}function ix(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function lx(t){return!(!ix(t)&&typeof t!="number"||isNaN(+Wt(t)))}function cx(t,n){const o=Wt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const dx={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"}},ux=(t,n,o)=>{let r;const a=dx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function so(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const fx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},px={date:so({formats:fx,defaultWidth:"full"}),time:so({formats:hx,defaultWidth:"full"}),dateTime:so({formats:mx,defaultWidth:"full"})},gx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bx=(t,n,o,r)=>gx[t];function Jt(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const yx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kx={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"]},wx={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"]},Cx={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"}},Ex={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"}},Bx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Jt({values:yx,defaultWidth:"wide"}),quarter:Jt({values:xx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Jt({values:kx,defaultWidth:"wide"}),day:Jt({values:wx,defaultWidth:"wide"}),dayPeriod:Jt({values:Cx,defaultWidth:"wide",formattingValues:Ex,defaultFormattingWidth:"wide"})};function Qt(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Sx(l,f=>f.test(i)):_x(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function _x(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Sx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function wd(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const Ax=/^(\d+)(th|st|nd|rd)?/i,Vx=/\d+/i,Dx={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},Nx={any:[/^b/i,/^(a|c)/i]},Mx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vx={any:[/1/i,/2/i,/3/i,/4/i]},Px={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},Tx={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]},Ox={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},Fx={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]},zx={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},Ix={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}},Rx={ordinalNumber:wd({matchPattern:Ax,parsePattern:Vx,valueCallback:t=>parseInt(t,10)}),era:Qt({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Nx,defaultParseWidth:"any"}),quarter:Qt({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:vx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Qt({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),day:Qt({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any"}),dayPeriod:Qt({matchPatterns:zx,defaultMatchWidth:"any",parsePatterns:Ix,defaultParseWidth:"any"})},Cd={code:"en-US",formatDistance:ux,formatLong:px,formatRelative:bx,localize:Bx,match:Rx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lx(t,n){const o=Wt(t,n==null?void 0:n.in);return ax(o,cx(o))+1}function $x(t,n){const o=Wt(t,n==null?void 0:n.in),r=+Ur(o)-+sx(o);return Math.round(r/gd)+1}function Ed(t,n){var u,f,h,m;const o=Wt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Wr(),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)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=_n((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=Ho(i,n),c=_n((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=Ho(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function jx(t,n){var l,c,d,u;const o=Wr(),r=(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,a=Ed(t,n),s=_n((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),Ho(s,n)}function Wx(t,n){const o=Wt(t,n==null?void 0:n.in),r=+Ho(o,n)-+jx(o,n);return Math.round(r/gd)+1}function Ke(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const Sn={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return Ke(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):Ke(o+1,2)},d(t,n){return Ke(t.getDate(),n.length)},a(t,n){const o=t.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(t,n){return Ke(t.getHours()%12||12,n.length)},H(t,n){return Ke(t.getHours(),n.length)},m(t,n){return Ke(t.getMinutes(),n.length)},s(t,n){return Ke(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return Ke(a,n.length)}},io={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return Sn.y(t,n)},Y:function(t,n,o,r){const a=Ed(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return Ke(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Ke(s,n.length)},R:function(t,n){const o=yd(t);return Ke(o,n.length)},u:function(t,n){const o=t.getFullYear();return Ke(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Ke(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Ke(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return Sn.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return Ke(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Wx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):Ke(a,n.length)},I:function(t,n,o){const r=$x(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):Ke(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):Sn.d(t,n)},D:function(t,n,o){const r=Lx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Ke(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":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"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Ke(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});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"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Ke(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return Ke(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=io.noon:r===0?a=io.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=io.evening:r>=12?a=io.afternoon:r>=4?a=io.morning:a=io.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Sn.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):Sn.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Ke(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):Ke(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):Sn.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):Sn.s(t,n)},S:function(t,n){return Sn.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Sd(r);case"XXXX":case"XX":return Hn(r);case"XXXXX":case"XXX":default:return Hn(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Sd(r);case"xxxx":case"xx":return Hn(r);case"xxxxx":case"xxx":default:return Hn(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+_d(r,":");case"OOOO":default:return"GMT"+Hn(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+_d(r,":");case"zzzz":default:return"GMT"+Hn(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return Ke(r,n.length)},T:function(t,n,o){return Ke(+t,n.length)}};function _d(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+Ke(s,2)}function Sd(t,n){return t%60===0?(t>0?"-":"+")+Ke(Math.abs(t)/60,2):Hn(t,n)}function Hn(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Ke(Math.trunc(r/60),2),s=Ke(r%60,2);return o+a+n+s}const Ad=(t,n)=>{switch(t){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"})}},Vd=(t,n)=>{switch(t){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"})}},Ux={p:Vd,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Ad(t,n);let s;switch(r){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}}",Ad(r,n)).replace("{{time}}",Vd(a,n))}},Hx=/^D+$/,qx=/^Y+$/,Gx=["D","DD","YY","YYYY"];function Xx(t){return Hx.test(t)}function Kx(t){return qx.test(t)}function Yx(t,n,o){const r=Jx(t,n,o);if(console.warn(r),Gx.includes(t))throw new RangeError(r)}function Jx(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Qx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ek=/^'([^]*?)'?$/,tk=/''/g,nk=/[a-zA-Z]/;function Dd(t,n,o){var u,f,h,m;const r=Wr(),a=r.locale??Cd,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Wt(t,o==null?void 0:o.in);if(!lx(l))throw new RangeError("Invalid time value");let c=n.match(Zx).map(g=>{const b=g[0];if(b==="p"||b==="P"){const x=Ux[b];return x(g,a.formatLong)}return g}).join("").match(Qx).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:ok(g)};if(Bd[b])return{isToken:!0,value:g};if(b.match(nk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const b=g.value;(Kx(b)||Xx(b))&&Yx(b,n,String(t));const x=Bd[b[0]];return x(l,b,a.localize,d)}).join("")}function ok(t){const n=t.match(ek);return n?n[1].replace(tk,"'"):t}const rk={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"}},ak=(t,n,o)=>{let r;const a=rk[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},sk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},ik={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},lk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ck={date:so({formats:sk,defaultWidth:"full"}),time:so({formats:ik,defaultWidth:"full"}),dateTime:so({formats:lk,defaultWidth:"full"})},dk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},uk=(t,n,o,r)=>dk[t],fk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},hk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},mk={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"]},pk={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"]},gk={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"}},bk={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"}},yk={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Jt({values:fk,defaultWidth:"wide"}),quarter:Jt({values:hk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Jt({values:mk,defaultWidth:"wide"}),day:Jt({values:pk,defaultWidth:"wide"}),dayPeriod:Jt({values:gk,defaultWidth:"wide",formattingValues:bk,defaultFormattingWidth:"wide"})},xk=/^ke-(\d+)?/i,kk=/\d+/i,wk={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},Ck={any:[/^s/i,/^(m|e)/i]},Ek={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Bk={any:[/1/i,/2/i,/3/i,/4/i]},_k={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},Sk={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]},Ak={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},Vk={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]},Dk={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},Nk={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}},Mk={ordinalNumber:wd({matchPattern:xk,parsePattern:kk,valueCallback:t=>parseInt(t,10)}),era:Qt({matchPatterns:wk,defaultMatchWidth:"wide",parsePatterns:Ck,defaultParseWidth:"any"}),quarter:Qt({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Bk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Qt({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:Sk,defaultParseWidth:"any"}),day:Qt({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Vk,defaultParseWidth:"any"}),dayPeriod:Qt({matchPatterns:Dk,defaultMatchWidth:"any",parsePatterns:Nk,defaultParseWidth:"any"})},vk={code:"id",formatDistance:ak,formatLong:ck,formatRelative:uk,localize:yk,match:Mk,options:{weekStartsOn:1,firstWeekContainsDate:1}},Nd={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)"}}},Md="dcode-dp-theme-forced";function Pk(t,n=Md){const o=Nd[t]??Nd.primary,r=`
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 a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Vk(t,n=_d){e.watch(t,o=>Ak(o,n),{immediate:!0})}const Dk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Nk=["for"],Mk={key:0,class:"ml-1 text-destructive"},vk=["disabled","onClick"],Pk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Tk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Ok={class:"h-full p-2 flex flex-col gap-3 w-32"},Fk=["onClick"],zk={class:"flex items-center justify-end gap-2 w-full p-2"},Ik=["disabled","onClick"],Rk={key:1,class:"text-xs text-destructive"},Lr=e.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(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const P=o.required,T=o["aria-required"];return P===""||P===!0||P==="true"||T==="true"||T===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:P=>{a("update:modelValue",P),a("change",P)}}),u=e.computed(()=>r.locale==="en"?gd:Sk),f=e.computed(()=>r.range?2:!1),h=e.computed(()=>{if(!r.range)return!1;const P={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(P.maxRange=r.autoRangeDays,P.autoRange=r.autoRangeDays),P}),m=P=>{const T=new Date(P);return T.setHours(0,0,0,0),T},g=P=>{const T=new Date(P);return T.setHours(23,59,59,999),T},y=(P,T)=>{const K=new Date(P);return K.setDate(K.getDate()+T),K},k=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(y(new Date,r.maxDaysAhead))}),E=e.ref(null),C=e.ref(null),w=P=>{C.value={month:P.month,year:P.year}},_=e.ref(!1);let B=null;e.onMounted(()=>{const P=document.documentElement,T=()=>_.value=P.classList.contains("dark");T(),B=new MutationObserver(T),B.observe(P,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Vk(e.toRef(r,"tone"));const x=P=>{const T=new Date(P),K=T.getDay(),$=T.getDate()-K+(K===0?-6:1);return T.setDate($),m(T)},b=P=>{const T=x(P);return T.setDate(T.getDate()+6),g(T)},S=P=>{const T=new Date(P);return T.setDate(1),m(T)},D=P=>{const T=new Date(P);return T.setMonth(T.getMonth()+1),T.setDate(0),g(T)},M=e.computed(()=>{if(!r.range)return[];const P=new Date,T=m(P),K=x(P),$=b(P),H=S(P),ee=D(P),q=(R,j)=>{let ae=R;r.disablePast&&ae<T&&(ae=T);let Z=j;if(r.autoRangeDays&&r.autoRangeDays>0){const J=g(y(ae,r.autoRangeDays-1));Z>J&&(Z=J)}return Z<ae&&(Z=g(new Date(ae))),[ae,Z]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:q(K,$)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:q(H,ee)}]}),N=async P=>{var j,ae;const T=r.modelType||"yyyy-MM-dd";if(P.length===0){d.value=null;return}if(P.length<2)return;const K=Ed(P[0],T),$=Ed(P[1],T);d.value=[K,$],await e.nextTick();const H=P[0],ee=H.getMonth(),q=H.getFullYear();C.value&&C.value.month===ee&&C.value.year===q||(j=E.value)==null||j.setMonthYear({month:ee,year:q}),(ae=E.value)==null||ae.openMenu()};return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Dk)):e.createCommentVNode("",!0),T[2]||(T[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Mk,"*")):e.createCommentVNode("",!0)],8,Nk)):e.createCommentVNode("",!0),e.createVNode(e.unref(iu.VueDatePicker),{ref_key:"dpRef",ref:E,modelValue:d.value,"onUpdate:modelValue":T[1]||(T[1]=K=>d.value=K),dark:_.value,range:h.value,"multi-calendars":f.value,disabled:t.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":t.modelType,formats:{input:t.displayFormat},"min-date":k.value,"max-date":p.value,"preset-ranges":M.value,floating:{placement:t.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:w},e.createSlots({"dp-input":e.withCtx(({value:K,onInput:$,onEnter:H,onTab:ee,onBlur:q,onFocus:R,onKeypress:j,onPaste:ae,toggleMenu:Z})=>[e.createElementVNode("div",{class:e.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":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.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:J=>Z()},[e.createVNode(e.unref(ce.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,vk),T[4]||(T[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Pk,e.toDisplayString(t.prependInner),1),T[3]||(T[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:K,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.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",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:J=>Z(),onFocus:J=>R(),onBlur:J=>q(),onInput:J=>$(J),onKeydown:[e.withKeys(J=>H(J),["enter"]),e.withKeys(J=>ee(J),["tab"])],onKeypress:J=>j(J),onPaste:J=>ae()},null,42,Tk)],2)]),"action-buttons":e.withCtx(({selectDate:K,selectionDisabled:$})=>[e.createElementVNode("div",zk,[e.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]=H=>{var ee;return(ee=E.value)==null?void 0:ee.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:$,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:H=>K()},e.toDisplayString(t.selectLabel),9,Ik)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Ok,[M.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(M.value,K=>(e.openBlock(),e.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:$=>N(K.range)},e.toDisplayString(K.label),9,Fk))),128)):e.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?(e.openBlock(),e.createElementBlock("p",Rk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Lk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=ke.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(ke.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),$k=e.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(t,{emit:n}){const o=t,r=n,a=Je.reactiveOmit(o,"class"),s=ke.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(ke.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ke.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"}),e.createVNode(e.unref(ke.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("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:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(ke.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:e.withCtx(()=>[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),jk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(ve)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Wk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(ve)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Uk={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"},Hk={class:"flex items-center gap-3"},qk={class:"flex flex-col"},Gk={key:0,class:"flex items-center gap-2"},Xk={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"},Kk={class:"flex justify-end gap-3 flex-wrap"},ro=wt(e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?Nt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Lk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref($k),e.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=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",Uk,[e.createElementVNode("div",Hk,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",qk,[e.createVNode(e.unref(Wk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(jk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",Gk,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",Xk,[e.createElementVNode("div",Kk,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),Sd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>Nt[n.icon]??Nt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Tt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),Yk=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)(e.unref(Qk)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Jk=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Qk=Ma("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"}}),Es=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Bs=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),_s=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ss=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(ve)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Zk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},ew={class:"flex flex-wrap items-center justify-center gap-2"},tw=["accept","multiple"],$r=wt(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var x;o.disabled||(x=a.value)==null||x.click()}function f(x){const b=x/1024,S=b/1024;return S>=1?`${S.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${x} B`}function h(x){var S;if(!x)return"File tidak valid";if((S=o.accept)!=null&&S.includes("image/")&&!x.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return x.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(x){l.value=x.name,c.value=x.size}function g(x){if(i.value=null,!x.length)return;if(o.mode==="single"){const S=x[0],D=h(S);if(D){i.value=D,r("error",D);return}o.showSelected&&m(S),r("picked",S);return}const b=[];for(const S of x){const D=h(S);if(D){i.value=D,r("error",D);return}b.push(S)}b.length&&(o.showSelected&&m(b[0]),r("picked:multiple",b))}function y(x){const b=x.target,S=Array.from(b.files??[]);g(S),b.value=""}function k(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function E(){s.value=!1}function C(x){var D,M;if(o.disabled)return;s.value=!1;const b=Array.from(((D=x.dataTransfer)==null?void 0:D.files)??[]),S=(M=o.accept)!=null&&M.includes("image/")?b.filter(N=>N.type.startsWith("image/")):b;g(S)}const w=e.computed(()=>(o.accept||"file/*").split(",").map(x=>x.trim()).filter(Boolean).map(x=>x==="image/*"?"IMAGE":x.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const _=e.ref(!1),B=e.computed(()=>{if(o.disabled||!_.value)return{};const x=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:x?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:x?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(x,b)=>{const S=e.resolveComponent("DCodeBadge");return e.openBlock(),e.createBlock(e.unref(Es),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:e.withCtx(()=>[e.createVNode(e.unref(_s),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ss),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(Bs),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.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",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:e.withModifiers(k,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(E,["prevent"]),onDrop:e.withModifiers(C,["prevent"]),onMouseenter:b[0]||(b[0]=D=>_.value=!0),onMouseleave:b[1]||(b[1]=D=>_.value=!1)},[e.createElementVNode("div",Zk,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",ew,[e.createVNode(S,{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(w.value),1)]),_:1}),e.createVNode(S,{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(S,{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:y},null,40,tw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(Yk),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Jk),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"])}}}),[["__scopeId","data-v-0897e9f4"]]),nw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},ow=["src"],rw={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"},aw={class:"space-y-0.5"},sw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},iw={class:"text-xs opacity-70"},lw=["disabled"],cw={key:1},dw=["disabled"],uw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},fw={class:"flex gap-2"},hw={class:"font-medium truncate"},mw={class:"flex gap-2"},pw={class:"font-medium"},gw={class:"flex gap-2"},bw={class:"font-medium truncate"},As=wt(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,y=g/1024;return y>=1?`${y.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.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=e.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,g)=>t.file?(e.openBlock(),e.createBlock(Es,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:e.withCtx(()=>[e.createVNode(_s,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ss,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",nw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Bs,{class:"pt-2"},{default:e.withCtx(()=>{var y,k,p,E,C;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=w=>c.value=!0),onMouseleave:g[3]||(g[3]=w=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,ow)):(e.openBlock(),e.createElementBlock("div",rw,[e.createVNode(e.unref(ce.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",aw,[e.createElementVNode("p",sw,e.toDisplayString((y=l.value)==null?void 0:y.name),1),e.createElementVNode("p",iw,e.toDisplayString((k=l.value)==null?void 0:k.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=w=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,lw)):(e.openBlock(),e.createElementBlock("div",cw)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=w=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,dw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",uw,[e.createElementVNode("div",fw,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",hw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",mw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",pw,e.toDisplayString((E=l.value)==null?void 0:E.size),1)]),e.createElementVNode("div",gw,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",bw,e.toDisplayString((C=l.value)==null?void 0:C.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function Vs(){const t=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:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const yw={class:"space-y-3"},xw={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"},Ad=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:B=>r("update:modelValue",B)}),s=e.ref(null),i=e.ref(null);function l(B){i.value=B,r("error",B)}function c(){i.value=null}const d=e.computed(()=>{const B=(o.allowedTypes??"").trim();return B?B.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(B){const x=B.lastIndexOf(".");return x>=0?B.slice(x).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const B=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...B].join(",")}return o.accept}),h=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(B){if(d.value.length){const x=(B.type||"").toLowerCase(),b=u(B.name);return d.value.some(S=>S.includes("/")?x===S:S.startsWith(".")?b===S:b===`.${S}`)}if(o.accept){if(o.accept==="*/*")return!0;const x=o.accept.split(",").map(D=>D.trim().toLowerCase()),b=(B.type||"").toLowerCase(),S=u(B.name);return x.some(D=>{if(D.endsWith("/*")){const M=D.slice(0,-2);return b.startsWith(M)}return D.startsWith(".")?S===D:b===D})}return!0}function g(B){return B*1024*1024}async function y(B){return B?m(B)?o.minSizeMb!=null&&B.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:k}=nt(),p=Vs(),E=e.ref(!1);async function C(B){var x;if(o.uploadFn){try{E.value=!0;const b=await o.uploadFn(B);a.value=B,r("uploaded",b)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}return}if(!((x=o.endpoint)!=null&&x.apiUrl)){a.value=B;return}if(typeof k!="function"){l("useApi() must expose DCodeApi()");return}try{E.value=!0;const b=new FormData;b.append("doc",B);const S=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,M=await k("","",b,{_url:D,_method:S,withCredentials:!0,transformRequest:[(P,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),P)]}),N=(M==null?void 0:M.data)??M;a.value=B,r("uploaded",N)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}}async function w(B){var b;if(o.disabled)return;c();const x=await y(B);if(x){l(x);return}s.value=B,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await C(B):a.value=B}function _(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,x)=>(e.openBlock(),e.createElementBlock("div",yw,[a.value?E.value?(e.openBlock(),e.createElementBlock("div",xw,[...x[1]||(x[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(As,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:_},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock($r,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||E.value,onPicked:w,error:i.value,onError:x[0]||(x[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),kw=["for"],ww={key:0,class:"!ml-1 !text-destructive"},Cw={class:"relative w-full block box-border"},Ew={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Bw=["id","readonly","disabled","placeholder"],_w={class:"absolute inset-y-0 right-4 flex items-center z-10"},Sw={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},Aw={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Vw={key:1,class:"text-sm text-muted-foreground text-center"},Dw=["onClick","title"],Nw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},Mw={class:"flex items-center justify-center flex-1"},vw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Pw={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},Vd=e.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(t,{emit:n}){const o=t,r=n,a=Nt,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),h=e.ref(!1),m=e.ref(!1),g=e.ref(!1),y=e.shallowRef([]),k=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),E=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(j=>setTimeout(j,0));const R=Object.keys(a).filter(j=>!p.has(j)).filter(j=>/^[A-Z]/.test(j)).filter(j=>typeof a[j]=="function"||typeof a[j]=="object"&&a[j]).sort((j,ae)=>j.localeCompare(ae));y.value=R,m.value=!0,g.value=!1},C=e.computed(()=>!m.value||!u.value||!y.value.includes(u.value)?null:a[u.value]),w=e.ref(u.value),_=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!m.value)return[];const R=(f.value??"").trim().toLowerCase();return R?y.value.filter(j=>j.toLowerCase().includes(R)):y.value}),x=e.computed(()=>B.value.slice(0,k.value)),b=e.computed(()=>{const R=o.columns;return R<=2?"grid-cols-2":R===3?"grid-cols-3":R===4?"grid-cols-4":R===5?"grid-cols-5":R>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>C.value&&!d.value?"!pl-12":"!pl-3");const S=async()=>{var R;await e.nextTick(),(R=i.value)==null||R.focus()},D=async R=>{if(o.disabled)return;const j=R!==!1;if(h.value){h.value=!1;return}d.value=!0,await E(),j&&(f.value="",w.value=""),k.value=o.pageSize,await S()},M=()=>{d.value=!1,f.value="",w.value=u.value,k.value=o.pageSize},N=async()=>{o.disabled||(d.value?M():await D())};let P=null;const T=async R=>{if(o.disabled)return;r("update:modelValue",null),d.value||await D(!1),P&&clearTimeout(P);const j=w.value;P=setTimeout(()=>{f.value=j},300)},K=R=>{o.disabled||(r("update:modelValue",R),M(),queueMicrotask(()=>{var j;return(j=i.value)==null?void 0:j.blur()}))},$=()=>{o.disabled||(r("update:modelValue",null),r("clear"),h.value=!0,M(),queueMicrotask(()=>{var R;return(R=i.value)==null?void 0:R.focus()}))},H=R=>{if(R.key==="Escape"){R.preventDefault(),M();return}if(R.key==="Enter"&&d.value){const j=B.value[0];j&&(R.preventDefault(),K(j))}},ee=R=>{if(!d.value)return;const j=R.target;s.value&&!s.value.contains(j)&&M()},q=R=>{const j=R.target;j.scrollTop+j.clientHeight>=j.scrollHeight-24&&k.value<B.value.length&&(k.value=Math.min(k.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",ee),queueMicrotask(()=>{var R;i.value=((R=s.value)==null?void 0:R.querySelector("input"))??null}),u.value&&E()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ee),P&&clearTimeout(P)}),e.watch(u,R=>{d.value||(w.value=R)}),e.watch(()=>f.value,()=>{k.value=o.pageSize}),(R,j)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",ww,"*")):e.createCommentVNode("",!0)],8,kw)):e.createCommentVNode("",!0),e.createElementVNode("div",Cw,[C.value&&!d.value?(e.openBlock(),e.createElementBlock("div",Ew,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":j[0]||(j[0]=ae=>w.value=ae),readonly:_.value,disabled:o.disabled,placeholder:o.placeholder,class:e.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",[C.value&&!d.value?"pl-10":"pl-4",_.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:T,onKeydown:H},null,42,Bw),[[e.vModelText,w.value]]),e.createElementVNode("div",_w,[o.clearable&&u.value?(e.openBlock(),e.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:j[1]||(j[1]=e.withModifiers(()=>{},["prevent"])),onClick:$,title:"Clear"},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.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:j[2]||(j[2]=e.withModifiers(()=>{},["prevent"])),onClick:N,title:"Open"},[e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",Sw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:q},[g.value?(e.openBlock(),e.createElementBlock("div",Aw,[e.createVNode(e.unref(ce.Loader2),{class:"h-4 w-4 animate-spin"}),j[3]||(j[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(e.openBlock(),e.createElementBlock("div",Vw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ae?"ring-1 ring-primary":""]),onClick:Z=>K(ae),title:ae},[e.createElementVNode("div",Nw,[e.createElementVNode("div",Mw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[ae]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",vw,e.toDisplayString(ae),1)])],10,Dw))),128))],2)),m.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",Pw," Showing "+e.toDisplayString(x.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Tw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Ow={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},Fw={class:"relative overflow-auto p-0"},Ds=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:C=>r("update:modelValue",C)}),s=e.ref(null),i=e.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(C,w,_,B,x){const b=await new Promise((M,N)=>{const P=URL.createObjectURL(C),T=new Image;T.onload=()=>{URL.revokeObjectURL(P),M(T)},T.onerror=K=>{URL.revokeObjectURL(P),N(K)},T.src=P}),S=document.createElement("canvas");S.width=w,S.height=_;const D=S.getContext("2d");return D?(D.drawImage(b,0,0,w,_),await new Promise(M=>{S.toBlob(N=>M(N||C),B,x)})):C}function m(){if(!l||!i.value)return;const C=l.getPlugin("Dashboard"),w=l.getFile(i.value);!C||!w||requestAnimationFrame(()=>{try{C.openFileEditor(w)}catch{try{C.openFileEditor(i.value)}catch{}}})}async function g(C){if(l){l.cancelAll(),i.value=null;try{const w=l.addFile({name:C.name,type:C.type,data:C,source:"Local",isRemote:!1});i.value=String(w)}catch{}}}function y(){if(!s.value)return;l&&f(),l=new lu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const C=document.documentElement.classList.contains("dark");l.use(Ks,{target:s.value,inline:!0,height:480,theme:C?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const w=document.documentElement.classList.contains("dark"),_=l.getPlugin("Dashboard");_&&_.setOptions({theme:w?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(cu,{target:Ks,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",w=>{i.value=(w==null?void 0:w.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async w=>{const _=++d;try{const B=w.data,x=B.type||w.type||"image/jpeg";let b=B;if(o.outputWidth&&o.outputHeight&&(b=await h(B,o.outputWidth,o.outputHeight,x,o.quality)),c||_!==d)return;const S=w.name||"edited-image.jpg",D=new File([b],S,{type:x});await k(D,"UPPY_EDITOR_COMPLETE"),r("done",D),a.value=!1}catch{}})}async function k(C,w="CROP_RESULT"){const _=URL.createObjectURL(C);try{const B=await new Promise((x,b)=>{const S=new Image;S.onload=()=>x(S),S.onerror=b,S.src=_});console.group(w),console.log("file:",C),console.table({name:C.name,type:C.type,sizeBytes:C.size,sizeMB:+(C.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",_),console.groupEnd()}finally{URL.revokeObjectURL(_)}}e.watch(a,async C=>{c=!C,d++,C?(await e.nextTick(),y(),o.file&&await g(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async C=>{a.value&&C&&(await e.nextTick(),await g(C))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=C=>{C.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,C=>{C?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const E=e.ref(!1);return(C,w)=>a.value?(e.openBlock(),e.createElementBlock("div",Tw,[e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:w[0]||(w[0]=_=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.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:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ow,[w[6]||(w[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.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:e.normalizeStyle({opacity:E.value?1:.7}),onClick:w[1]||(w[1]=_=>a.value=!1),onMouseenter:w[2]||(w[2]=_=>E.value=!0),onMouseleave:w[3]||(w[3]=_=>E.value=!1)},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"}),w[5]||(w[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",Fw,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),zw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Iw=["src"],Rw=["disabled"],Lw=["disabled"],$w={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},jw={class:"flex gap-2"},Ww={class:"font-medium truncate"},Uw={class:"flex gap-2"},Hw={class:"font-medium"},qw={class:"flex gap-2"},Gw={class:"font-medium truncate"},Ns=wt(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.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=e.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)=>t.file?(e.openBlock(),e.createBlock(Es,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:e.withCtx(()=>[e.createVNode(_s,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ss,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",zw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Bs,{class:"pt-2"},{default:e.withCtx(()=>{var g,y,k;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Iw)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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]=p=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,Rw)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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]=p=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,Lw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",$w,[e.createElementVNode("div",jw,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Ww,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",Uw,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Hw,e.toDisplayString((y=i.value)==null?void 0:y.size),1)]),e.createElementVNode("div",qw,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Gw,e.toDisplayString((k=i.value)==null?void 0:k.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Xw={class:"space-y-3"},jr=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:$=>r("update:modelValue",$)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d($){c.value=$,r("error",$)}function u(){c.value=null}const f=e.computed(()=>{const $=(o.allowedTypes??"").trim();return $?$.split(/[,\s;]+/g).map(ee=>ee.trim().toLowerCase()).filter(Boolean).map(ee=>ee.includes("/")||ee.startsWith(".")?ee:`.${ee}`):[]});function h($){const H=$.lastIndexOf(".");return H>=0?$.slice(H).toLowerCase():""}const m=e.computed(()=>{if(f.value.length){const $=f.value.filter(ee=>ee.startsWith("."));return[...f.value.filter(ee=>ee.includes("/")),...$].join(",")}return o.accept||"image/*"}),g=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function y($){if(f.value.length){const ee=($.type||"").toLowerCase(),q=h($.name);return f.value.some(R=>R.includes("/")?ee===R:R.startsWith(".")?q===R:q===`.${R}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?($.type||"").toLowerCase().startsWith("image/"):!0}function k($){return $*1024*1024}async function p($){var H;return(H=$.type)!=null&&H.startsWith("image/")?await new Promise(ee=>{const q=URL.createObjectURL($),R=new Image;R.onload=()=>{URL.revokeObjectURL(q),ee({w:R.naturalWidth,h:R.naturalHeight})},R.onerror=()=>{URL.revokeObjectURL(q),ee(null)},R.src=q}):null}async function E($){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const ee=await p($);return ee?o.minWidth!=null&&ee.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&ee.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&ee.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&ee.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function C($){return $?y($)?o.minSizeMb!=null&&$.size<k(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&$.size>k(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await E($):`only Allowed: ${g.value}`:"File tidak valid"}function w($){o.disabled||(i.value=$,s.value=!0)}async function _($){if(o.disabled)return;u();const H=await C($);if(H){d(H);return}l.value=$,w($)}const{DCodeApi:B}=nt(),x=Vs(),b=e.ref(!1);e.ref(null);function S($,H){return!$||!H?null:$.replace(/\/+$/,"")+"/"+H.replace(/^\/+/,"")}function D($){var R;const H=($==null?void 0:$.data)??$,ee=(R=H==null?void 0:H.data)==null?void 0:R[0];if(!ee)return null;const q=S(ee.server,ee.url);return{...ee,fullUrl:q?encodeURI(q):null}}async function M($){var H;if(o.uploadFn){try{b.value=!0;const ee=await o.uploadFn($);a.value=$,r("uploaded",ee)}catch(ee){console.error("Upload Error",ee),x.error("Upload Failed",(ee==null?void 0:ee.message)||"Unknown error"),d((ee==null?void 0:ee.message)||"Upload Failed")}finally{b.value=!1}return}if(!((H=o.endpoint)!=null&&H.apiUrl)){a.value=$;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const ee=new FormData;ee.append("doc",$);const q=(o.endpoint.apiMethod||"POST").toUpperCase(),R=o.endpoint.apiUrl,j=await B("","",ee,{_url:R,_method:q,withCredentials:!0,transformRequest:[(Z,J)=>(J&&(delete J["Content-Type"],delete J["content-type"]),Z)]}),ae=(j==null?void 0:j.data)??j;D(ae),a.value=$,r("uploaded",ae)}catch(ee){console.error("Upload Error",ee),x.error("Upload Failed",(ee==null?void 0:ee.message)||"Unknown error"),d((ee==null?void 0:ee.message)||"Upload Failed")}finally{b.value=!1}}async function N($){var H;u(),o.uploadFn||(H=o.endpoint)!=null&&H.apiUrl?await M($):a.value=$,s.value=!1,i.value=null}function P(){s.value=!1,i.value=null}async function T(){if(!a.value)return;u();const $=o.editUseOriginal?l.value??a.value:a.value,H=await C($);if(H){d(H);return}w($)}function K(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,$=>{$&&!l.value&&(l.value=$),$||(l.value=null)},{immediate:!0}),($,H)=>(e.openBlock(),e.createElementBlock("div",Xw,[a.value?(e.openBlock(),e.createBlock(Ns,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.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"])):(e.openBlock(),e.createBlock($r,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:_,error:c.value,onError:H[0]||(H[0]=ee=>d(ee))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Ds,{modelValue:s.value,"onUpdate:modelValue":H[1]||(H[1]=ee=>s.value=ee),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:N,onCancel:P},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),ao=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Nt[o.icon]||null),a=e.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=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),Kw=["aria-busy"],Yw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Jw=["for"],Qw={key:0,class:"ml-1 text-destructive"},Zw=["id","disabled"],e1={class:"min-w-0 flex-1 text-left"},t1={key:0,class:"flex flex-wrap gap-1.5"},n1={class:"max-w-[220px] truncate"},o1=["onClick"],r1={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"},a1={key:1,class:"text-muted-foreground truncate"},s1={class:"flex items-center gap-2 shrink-0"},i1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},l1=["placeholder","onKeydown"],c1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},d1=["disabled","onClick"],u1={class:"truncate"},f1={key:0,class:"text-primary-600 dark:text-primary-400"},h1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},m1={key:0},p1={key:1},g1={key:1,class:"text-xs text-destructive"},Ms=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const v=o.required,Y=o["aria-required"];return v===""||v===!0||v==="true"||(Y==="true"||Y===!0)}),u=e.computed(()=>!!a.error);function f(v){return v?typeof a.itemTitle=="function"?a.itemTitle(v)??"":String((v==null?void 0:v[a.itemTitle])??""):""}function h(v){return v?typeof a.itemValue=="function"?a.itemValue(v):v==null?void 0:v[a.itemValue]:null}function m(v,Y){return h(v)??Y}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),y=e.computed(()=>{var v;return!!((v=a.endpoint)!=null&&v.apiUrl)||!!a.fetchItems}),k=e.ref([]),p=e.ref(!1),E=e.ref(!1),C=e.computed(()=>{var Y;const v=(Y=a.endpoint)==null?void 0:Y.apiOptions;if(v)return typeof v=="function"?v():v}),w=e.computed(()=>{var de,fe;const v=((de=a.endpoint)==null?void 0:de.apiUrl)??"",Y=(((fe=a.endpoint)==null?void 0:fe.apiMethod)??"GET").toUpperCase(),te=JSON.stringify(C.value??null);return`${Y} ${v} :: ${te}`}),_=e.computed(()=>y.value?k.value:a.items||[]);async function B(){var v;if(y.value&&!(!((v=a.endpoint)!=null&&v.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let Y;if(a.fetchItems){const te=await a.fetchItems(),de=(te==null?void 0:te.data)??te;Y=(de==null?void 0:de.data)??de}else{const{DCodeApi:te}=nt();if(typeof te!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const de={page:1,perPage:100,...C.value||{}},fe=await te("","",de,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),Se=(fe==null?void 0:fe.data)??fe;Y=(Se==null?void 0:Se.data)??Se}k.value=Array.isArray(Y)?Y:[],E.value=!0}catch(Y){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",Y),k.value=[]}finally{p.value=!1}}}e.watch(()=>w.value,()=>{k.value=[],E.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&y.value&&B()});const x=e.computed(()=>{const v=g.value;if(a.returnObject)return v;const Y=new Map;for(const te of _.value)Y.set(h(te),te);return v.map(te=>Y.get(te)??{[a.itemValue]:te,[a.itemTitle]:String(te)})}),b=e.computed(()=>a.maxChips===null?x.value:x.value.slice(0,a.maxChips));function S(v){const Y=g.value;if(a.returnObject){const te=h(v);return Y.some(de=>h(de)===te)}return Y.includes(h(v))}const D=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const v=Number(a.maxSelected);return Number.isFinite(v)&&v>0?v:null}),M=e.computed(()=>{const v=D.value;return v===null?!1:g.value.length>=v});function N(v){return!S(v)&&M.value}const P=e.computed(()=>{const v=g.value,Y=new Set;if(a.returnObject)for(const te of v)Y.add(h(te));else for(const te of v)Y.add(te);return Y}),T=e.computed(()=>{const v=P.value;return(_.value||[]).filter(Y=>!v.has(h(Y)))}),K=e.computed(()=>_.value.length===0?!1:T.value.length===0),$=e.ref(null),H=e.ref(null),ee=e.ref(null),q=e.ref(!1),R=e.ref(""),j=e.ref(0),ae=e.ref(0),{floatingStyles:Z}=Ea($,H,{whileElementsMounted:ya,placement:"bottom-start",middleware:[xa(8),wa(),ka({padding:8}),Ca({apply({rects:v,elements:Y}){Object.assign(Y.floating.style,{width:`${v.reference.width}px`,"--floating-width":`${v.reference.width}px`})}})]}),J=e.computed(()=>Z.value),le=e.computed(()=>{const v=Number(a.maxRows);return Number.isFinite(v)&&v>0?v:5});async function ue(){a.disabled||(q.value=!0,ae.value=0,requestAnimationFrame(()=>{ee.value&&(ee.value.scrollTop=0),j.value=0}),y.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!E.value)&&!p.value&&await B())}function Ce(){q.value=!1}function Be(){q.value?Ce():ue()}function me(v){var te,de;if(!q.value)return;const Y=v.target;(te=$.value)!=null&&te.contains(Y)||(de=H.value)!=null&&de.contains(Y)||Ce()}e.onMounted(()=>document.addEventListener("mousedown",me)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",me));function Q(v){if(a.disabled)return;if(N(v)){r("max");return}const Y=[...g.value];if(a.returnObject){const te=h(v);if(Y.some(fe=>h(fe)===te))return;r("update:modelValue",[...Y,v])}else{const te=h(v);if(Y.includes(te))return;r("update:modelValue",[...Y,te])}R.value="",ae.value=0,requestAnimationFrame(()=>{ee.value&&(ee.value.scrollTop=0),j.value=0})}function O(v){if(a.disabled)return;const Y=[...g.value];if(a.returnObject){const te=h(v);r("update:modelValue",Y.filter(de=>h(de)!==te))}else{const te=h(v);r("update:modelValue",Y.filter(de=>de!==te))}}function X(){a.disabled||(r("update:modelValue",[]),r("clear"),Ce())}const re=e.computed(()=>{const v=R.value.trim().toLowerCase(),Y=T.value;return v?Y.filter(te=>f(te).toLowerCase().includes(v)):Y}),be=e.computed(()=>re.value.length);e.watch(q,v=>{v||(R.value="")});const Ee=e.computed(()=>{if(K.value)return a.itemHeight;const v=be.value;return(v<=0?1:Math.min(v,le.value))*a.itemHeight}),Fe=e.computed(()=>a.virtual?be.value*a.itemHeight:0),Re=e.computed(()=>a.virtual?Math.ceil(Ee.value/a.itemHeight)+a.overscan:be.value),Ye=e.computed(()=>{if(!a.virtual)return 0;const v=Math.floor(j.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,v)}),Ne=e.computed(()=>a.virtual?Math.min(be.value,Ye.value+Re.value):be.value),it=e.computed(()=>a.virtual?Ye.value*a.itemHeight:0),dt=e.computed(()=>{const v=re.value;return a.virtual?v.slice(Ye.value,Ne.value):v});function I(v){const Y=v.target;j.value=Y.scrollTop}function U(v){return v===ae.value}function A(v){const Y=ee.value;if(!Y||!a.virtual)return;const te=v*a.itemHeight,de=te+a.itemHeight,fe=Y.scrollTop,Se=Y.scrollTop+Y.clientHeight;te<fe?Y.scrollTop=te:de>Se&&(Y.scrollTop=de-Y.clientHeight)}function F(v){const Y=Math.max(0,be.value-1);ae.value=Math.min(Y,Math.max(0,ae.value+v)),A(ae.value)}function G(){const v=re.value[ae.value];v&&Q(v)}const se=e.computed(()=>a.clearable&&!a.disabled&&x.value.length>0),ie=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":q.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(v,Y)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",Yw)):e.createCommentVNode("",!0),Y[3]||(Y[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",Qw,"*")):e.createCommentVNode("",!0)],8,Jw)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:$,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.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",ie.value]]),disabled:a.disabled,onClick:Be},[e.createElementVNode("div",e1,[x.value.length?(e.openBlock(),e.createElementBlock("div",t1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(te,de)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(te,de)}`,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"},[e.createElementVNode("span",n1,e.toDisplayString(f(te)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(fe=>O(te),["stop"]),"aria-label":"Remove"}," ✕ ",8,o1))]))),128)),a.maxChips!==null&&x.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",r1," +"+e.toDisplayString(x.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",a1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",s1,[se.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(X,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,Zw),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:H,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:e.normalizeStyle(J.value)},[a.searchable&&!K.value?(e.openBlock(),e.createElementBlock("div",i1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Y[0]||(Y[0]=te=>R.value=te),placeholder:a.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:[Y[1]||(Y[1]=e.withKeys(e.withModifiers(te=>F(1),["prevent"]),["down"])),Y[2]||(Y[2]=e.withKeys(e.withModifiers(te=>F(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(G,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Ce,["prevent"]),["esc"])]},null,40,l1),[[e.vModelText,R.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:ee,class:"relative overflow-auto",style:e.normalizeStyle({height:Ee.value+"px"}),onScroll:I},[K.value?(e.openBlock(),e.createElementBlock("div",c1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Fe.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${it.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(te,de)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(te,Ye.value+de)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[N(te)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",U(Ye.value+de)?"bg-neutral-50 dark:bg-neutral-800/60":"",S(te)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||N(te),onClick:fe=>Q(te)},[e.createElementVNode("span",u1,e.toDisplayString(f(te)),1),S(te)?(e.openBlock(),e.createElementBlock("span",f1,"✓")):e.createCommentVNode("",!0)],14,d1))),128))],6),be.value===0?(e.openBlock(),e.createElementBlock("div",h1,[p.value?(e.openBlock(),e.createElementBlock("span",m1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",p1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",g1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,Kw)),[[e.vShow,i.value]])}}),b1={class:"space-y-4"},y1={key:0,class:"flex flex-col gap-0.5"},x1=["for"],k1=["for"],w1={class:"text-[11px] text-gray-500 dark:text-gray-400"},C1={class:"flex items-center gap-2 flex-nowrap"},E1=["id","value","disabled","onKeydown","onInput","onPaste"],Wr=e.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(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=nt(),f=Vs(),h=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:h.value},(B,x)=>{var b;return((b=s.default)==null?void 0:b[x])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=B=>{B<0||B>=h.value||e.nextTick(()=>{var x;return(x=l.value[B])==null?void 0:x.focus()})},y=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function k(B){var x;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(B);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((x=s.endpoint)!=null&&x.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(),S=s.endpoint.apiUrl,D=await u("","",{otp:B},{_url:S,_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 p=(B,x)=>{c.value[B]=y(x);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&k(b)},E=(B,x)=>{const b=B.key,S=/^\d$/.test(b),D=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(B.preventDefault(),c.value[x]){p(x,"");return}x>0&&(p(x-1,""),g(x-1));return}if(b==="ArrowLeft"){B.preventDefault(),g(x-1);return}if(b==="ArrowRight"){B.preventDefault(),g(x+1);return}if(S||D){B.preventDefault(),p(x,b),x<h.value-1&&g(x+1);return}b.length===1&&B.preventDefault()},C=(B,x)=>{const b=B.target,S=b.value??"",D=y(S);b.value=D,p(x,D),D&&x<h.value-1&&g(x+1)},w=(B,x)=>{var N;B.preventDefault();const S=(((N=B.clipboardData)==null?void 0:N.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!S)return;let D=x;for(const P of S){if(D>=h.value)break;c.value[D]=P,D++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&k(M),g(Math.min(D,h.value-1))},_=B=>x=>{l.value[B]=(x==null?void 0:x.$el)??x};return(B,x)=>(e.openBlock(),e.createElementBlock("div",b1,[s.label||h.value?(e.openBlock(),e.createElementBlock("div",y1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,x1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,k1)),e.createElementVNode("p",w1," Ketik "+e.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:_(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:e.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:S=>E(S,b-1),onInput:S=>C(S,b-1),onPaste:S=>w(S,b-1)},null,42,E1))),128))])]))}}),B1={class:"w-full"},_1={key:0,class:"flex items-center justify-between mb-2"},S1={key:0,class:"text-sm font-medium text-gray-700"},A1={key:1,class:"text-sm text-gray-600"},V1={name:"DCodeProgress"},Dd=e.defineComponent({...V1,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(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.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=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",B1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",_1,[t.label?(e.openBlock(),e.createElementBlock("span",S1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",A1,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),D1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Nd=wt(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",D1,[e.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:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),N1={class:"grid gap-3"},M1={key:0,class:"ml-1 text-destructive"},v1={class:"flex flex-col"},P1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},T1={class:"relative flex-shrink-0 mt-0.5"},O1=["id","name","value","checked","disabled","required","onChange"],F1=["onClick"],z1=["for"],I1={key:0,class:"ml-1 text-red-500"},R1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},vs=e.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(t,{emit:n}){e.useAttrs();const{apiUrl:o}=nt(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var w,_;const C=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(C){i.value=!0,l.value=null;try{const B={page:1,perPage:100},x=((_=a.endpoint)==null?void 0:_.apiMethod)||a.apiMethod,b=await o(C,x,B);let S=b;a.dataPath?S=a.dataPath.split(".").reduce((M,N)=>M&&M[N]!=="undefined"?M[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(S=b.data),Array.isArray(S)?s.value=S:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(B){console.error("DCodeRadio fetch error:",B),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var C;((C=a.endpoint)!=null&&C.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const C=a.itemValue||a.model||"id",w=a.itemTitle||(a.label===""?"name":a.label);return w&&a.label!==""?[{[C]:C,[w]:w}]:[]}),u=C=>{if(typeof C!="object")return C;const w=a.itemValue||a.model||"id";return C[w]},f=C=>{if(typeof C!="object")return String(C);const w=a.itemTitle||"name";return C[w]},h=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),y=C=>C==null?a.modelValue===C:String(a.modelValue)===String(C),k=e.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"}})[a.size]),p=(C,w)=>{w.target.checked&&(r("update:modelValue",C),r("change",C))},E=C=>{!a.disabled&&!y(C)&&(r("update:modelValue",C),r("change",C))};return(C,w)=>(e.openBlock(),e.createElementBlock("div",N1,[t.label?(e.openBlock(),e.createBlock(Lo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",M1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",v1,[i.value?(e.openBlock(),e.createElementBlock("div",P1,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",k.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",T1,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${h.value}-${B}`,name:h.value,type:"radio",value:u(_),checked:y(u(_)),disabled:t.disabled,required:t.required&&B===0,onChange:x=>p(u(_),x),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,O1)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:x=>E(u(_))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${h.value}-${B}`,class:e.normalizeClass([k.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(_))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",I1,"*")):e.createCommentVNode("",!0)],10,z1)],8,F1)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",R1,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),L1={class:"grid gap-3"},$1={key:0,class:"ml-1 text-destructive"},j1={class:"flex flex-col"},W1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},U1=["onClick"],H1=["id","name","value","checked","disabled","required","onChange"],q1={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},G1=["for"],X1={key:0,class:"ml-1 text-red-500"},K1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Ps=e.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(t,{emit:n}){e.useAttrs();const{apiUrl:o}=nt(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,S=>{s.value=S},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var D,M;const S=((D=a.endpoint)==null?void 0:D.apiUrl)||a.apiUrl;if(S){l.value=!0,c.value=null;try{const N={page:1,perPage:100},P=((M=a.endpoint)==null?void 0:M.apiMethod)||a.apiMethod,T=await o(S,P,N);let K=T;a.dataPath?K=a.dataPath.split(".").reduce((H,ee)=>H&&H[ee]!=="undefined"?H[ee]: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(N){console.error("DCodeRadioCustom fetch error:",N),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var S;((S=a.endpoint)!=null&&S.apiUrl||a.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"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const S=a.itemValue||a.model||"id",D=a.itemTitle||(a.label===""?"name":a.label);return D&&a.label!==""?[{[S]:S,[D]:D}]:[]}),g=S=>{if(typeof S!="object")return S;const D=a.itemValue||a.model||"id";return S[D]},y=S=>{if(typeof S!="object")return String(S);const D=a.itemTitle||"name";return S[D]},k=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${k}`),E=e.computed(()=>!!a.error||!!c.value),C=e.computed(()=>a.error||c.value),w=S=>{const D=s.value;return S==null?D===S:String(D)===String(S)},_=e.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"}})[a.size]),B=e.computed(()=>a.icon&&Nt[a.icon]||null),x=(S,D)=>{D.target.checked&&(s.value=S,r("update:modelValue",S),r("change",S))},b=S=>{a.disabled||w(S)||(s.value=S,r("update:modelValue",S),r("change",S))};return(S,D)=>(e.openBlock(),e.createElementBlock("div",L1,[t.label?(e.openBlock(),e.createBlock(Lo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",$1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",j1,[l.value?(e.openBlock(),e.createElementBlock("div",W1,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(M,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",w(g(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",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:P=>!t.disabled&&b(g(M))},[e.createElementVNode("input",{id:t.id?`${t.id}-${N}`:`${p.value}-${N}`,name:p.value,type:"radio",value:g(M),checked:w(g(M)),disabled:t.disabled,required:t.required&&N===0,onChange:P=>x(g(M),P),class:"sr-only",tabindex:"-1"},null,40,H1),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",w(g(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"])},[B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",q1,[...D[1]||(D[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${N}`:`${p.value}-${N}`,class:e.normalizeClass([_.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",w(g(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(y(M))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",X1,"*")):e.createCommentVNode("",!0)],10,G1)],10,U1))),128))],2),E.value&&C.value?(e.openBlock(),e.createElementBlock("div",K1,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])]))}}),Y1={key:0,class:"ml-1 text-destructive"},J1={class:"relative w-full"},Q1={key:0,class:"mb-2 flex items-center justify-between"},Z1={class:"text-sm text-muted-foreground"},eC={class:"text-sm font-medium text-foreground"},tC={class:"text-sm text-muted-foreground"},nC={class:"relative"},oC=["id","value","min","max","step","disabled","placeholder"],rC={key:1,class:"relative mt-2"},aC={class:"text-xs text-muted-foreground mt-1"},sC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},iC={name:"DCodeSlider"},Ur=e.defineComponent({...iC,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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const _={sm:"h-2",md:"h-2.5",lg:"h-3"},B={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",_[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=e.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"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const _=a.max-a.min;return(a.modelValue-a.min)/_*100}),y=_=>{const B=_.target,x=parseFloat(B.value);r("update:modelValue",x),r("input",x)},k=_=>{const B=_.target,x=parseFloat(B.value);r("change",x)},p=()=>{i.value=!0},E=()=>{i.value=!1},C=_=>{const B=a.max-a.min;return(_-a.min)/B*100},w=e.computed(()=>{const _={sm:16,md:20,lg:24};return`
66
+ `.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Tk(t,n=Md){e.watch(t,o=>Pk(o,n),{immediate:!0})}const Ok={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Fk=["for"],zk={key:0,class:"ml-1 text-destructive"},Ik=["disabled","onClick"],Rk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Lk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],$k={class:"h-full p-2 flex flex-col gap-3 w-32"},jk=["onClick"],Wk={class:"flex items-center justify-end gap-2 w-full p-2"},Uk=["disabled","onClick"],Hk={key:1,class:"text-xs text-destructive"},Hr=e.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(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const T=o.required,P=o["aria-required"];return T===""||T===!0||T==="true"||P==="true"||P===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:T=>{a("update:modelValue",T),a("change",T)}}),u=e.computed(()=>r.locale==="en"?Cd:vk),f=e.computed(()=>r.range?2:!1),h=e.computed(()=>{if(!r.range)return!1;const T={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(T.maxRange=r.autoRangeDays,T.autoRange=r.autoRangeDays),T}),m=T=>{const P=new Date(T);return P.setHours(0,0,0,0),P},g=T=>{const P=new Date(T);return P.setHours(23,59,59,999),P},b=(T,P)=>{const K=new Date(T);return K.setDate(K.getDate()+P),K},x=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(b(new Date,r.maxDaysAhead))}),E=e.ref(null),w=e.ref(null),C=T=>{w.value={month:T.month,year:T.year}},_=e.ref(!1);let B=null;e.onMounted(()=>{const T=document.documentElement,P=()=>_.value=T.classList.contains("dark");P(),B=new MutationObserver(P),B.observe(T,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Tk(e.toRef(r,"tone"));const k=T=>{const P=new Date(T),K=P.getDay(),L=P.getDate()-K+(K===0?-6:1);return P.setDate(L),m(P)},y=T=>{const P=k(T);return P.setDate(P.getDate()+6),g(P)},A=T=>{const P=new Date(T);return P.setDate(1),m(P)},V=T=>{const P=new Date(T);return P.setMonth(P.getMonth()+1),P.setDate(0),g(P)},M=e.computed(()=>{if(!r.range)return[];const T=new Date,P=m(T),K=k(T),L=y(T),G=A(T),Q=V(T),X=(R,H)=>{let ae=R;r.disablePast&&ae<P&&(ae=P);let Z=H;if(r.autoRangeDays&&r.autoRangeDays>0){const J=g(b(ae,r.autoRangeDays-1));Z>J&&(Z=J)}return Z<ae&&(Z=g(new Date(ae))),[ae,Z]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:X(K,L)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:X(G,Q)}]}),D=async T=>{var H,ae;const P=r.modelType||"yyyy-MM-dd";if(T.length===0){d.value=null;return}if(T.length<2)return;const K=Dd(T[0],P),L=Dd(T[1],P);d.value=[K,L],await e.nextTick();const G=T[0],Q=G.getMonth(),X=G.getFullYear();w.value&&w.value.month===Q&&w.value.year===X||(H=E.value)==null||H.setMonthYear({month:Q,year:X}),(ae=E.value)==null||ae.openMenu()};return(T,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Ok)):e.createCommentVNode("",!0),P[2]||(P[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",zk,"*")):e.createCommentVNode("",!0)],8,Fk)):e.createCommentVNode("",!0),e.createVNode(e.unref(hu.VueDatePicker),{ref_key:"dpRef",ref:E,modelValue:d.value,"onUpdate:modelValue":P[1]||(P[1]=K=>d.value=K),dark:_.value,range:h.value,"multi-calendars":f.value,disabled:t.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":t.modelType,formats:{input:t.displayFormat},"min-date":x.value,"max-date":p.value,"preset-ranges":M.value,floating:{placement:t.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},e.createSlots({"dp-input":e.withCtx(({value:K,onInput:L,onEnter:G,onTab:Q,onBlur:X,onFocus:R,onKeypress:H,onPaste:ae,toggleMenu:Z})=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 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":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.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:J=>Z()},[e.createVNode(e.unref(le.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Ik),P[4]||(P[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Rk,e.toDisplayString(t.prependInner),1),P[3]||(P[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:K,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.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",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:J=>Z(),onFocus:J=>R(),onBlur:J=>X(),onInput:J=>L(J),onKeydown:[e.withKeys(J=>G(J),["enter"]),e.withKeys(J=>Q(J),["tab"])],onKeypress:J=>H(J),onPaste:J=>ae()},null,42,Lk)],2)]),"action-buttons":e.withCtx(({selectDate:K,selectionDisabled:L})=>[e.createElementVNode("div",Wk,[e.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:P[0]||(P[0]=G=>{var Q;return(Q=E.value)==null?void 0:Q.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:L,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:G=>K()},e.toDisplayString(t.selectLabel),9,Uk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",$k,[M.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(M.value,K=>(e.openBlock(),e.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:L=>D(K.range)},e.toDisplayString(K.label),9,jk))),128)):e.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?(e.openBlock(),e.createElementBlock("p",Hk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),qk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Gk=e.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(t,{emit:n}){const o=t,r=n,a=et.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.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"}),e.createVNode(e.unref(we.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Fe)("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:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(we.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:e.withCtx(()=>[e.createVNode(e.unref(le.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Xk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(Fe)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Kk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(Fe)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Yk={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},Jk={class:"flex items-center gap-3"},Qk={class:"flex flex-col"},Zk={key:0,class:"flex items-center gap-2"},ew={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},tw={class:"flex justify-end gap-3 flex-wrap"},lo=Et(e.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(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?It[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(qk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Gk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",Yk,[e.createElementVNode("div",Jk,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",Qk,[e.createVNode(e.unref(Kk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(Xk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",Zk,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",ew,[e.createElementVNode("div",tw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),co=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&It[o.icon]||null),a=e.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=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),nw={class:"flex flex-col gap-3 w-full"},ow={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},rw={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},aw={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-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},sw={class:"text-sm font-medium text-slate-500"},iw={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"},lw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},cw=["onClick"],dw=["for","onDrop"],uw={class:"text-xs text-slate-500 dark:text-slate-400"},fw={key:2,class:"text-xs text-slate-400"},hw=["id","disabled","accept","onChange"],As=e.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","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=vt.useI18n(),i=e.computed(()=>{const p=o.endpoint;if(!(p!=null&&p.apiUrl))return null;let E=p.apiUrl;if(!E.startsWith("http")&&o.baseUrl){const w=o.baseUrl.replace(/\/$/,""),C=E.startsWith("/")?E:`/${E}`;E=`${w}${C}`}return E}),l=e.computed(()=>{const p=c.value.length;return p<=1?"grid-cols-1":p===2?"grid-cols-1 md:grid-cols-2":p===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":p===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),h=async()=>{var p;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((p=o.endpointReference)!=null&&p.apiUrl)){f.value=!1;return}try{const{apiUrl:E}=st(),w=await E(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(E){console.error("Failed to fetch dynamic document list",E)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),h()}),e.watch(()=>o.modelValue,p=>{Array.isArray(p)&&JSON.stringify(p)!==JSON.stringify(d.value)&&(d.value=JSON.parse(JSON.stringify(p)))},{deep:!0}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiUrl},(p,E)=>{p!==E&&h()}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiMethod},(p,E)=>{p!==E&&h()}),e.watch(()=>o.items,p=>{c.value=p??[],f.value=!1},{deep:!0,immediate:!0});const m=p=>{const E=p[o.itemValue]||p.id||p.typeDocument;return d.value.find(w=>w.typeDocument===E||w.idDocumentType===E||w[o.itemValue]===E)||null},g=async(p,E,w)=>{var k,y;const C=w.target,_=(k=C.files)==null?void 0:k[0];if(!_)return;const B=p[o.itemValue]||p.id||p.typeDocument;if(p[o.itemTitle]||p.name||p.filename,!i.value){const A=[...d.value],V=A.findIndex(D=>D.typeDocument===B||D.idDocumentType===B),M={id:null,idDocument:null,idDocumentType:B,filename:_.name,document:_.name,typeDocument:B};V>-1?A[V]={...A[V],...M}:A.push(M),d.value=A,r("update:modelValue",A);return}u.value.add(E);try{const{apiUrl:A}=st(),V=new FormData;V.append("doc",_),V.append("typeDocument",String(B));const M=await A(i.value,((y=o.endpoint)==null?void 0:y.apiMethod)||"POST",V),D=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,T=(D==null?void 0:D.url)||(D==null?void 0:D.document)||_.name,P=(D==null?void 0:D.id)||null,K=(D==null?void 0:D.filename)||(D==null?void 0:D.name)||_.name,L=[...d.value],G=L.findIndex(X=>X.typeDocument===B||X.idDocumentType===B),Q={...D||{},id:P,idDocument:P,idDocumentType:B,filename:K,document:T,typeDocument:B};G>-1?L[G]={...L[G],...Q}:L.push(Q),d.value=L,r("update:modelValue",L),r("uploaded",D),r("success",D)}catch(A){console.error("Upload failed",A)}finally{u.value.delete(E),C.value=""}},b=p=>{const E=p[o.itemValue]||p.id||p.typeDocument,w=d.value.filter(C=>C.typeDocument!==E&&C.idDocumentType!==E);d.value=w,r("update:modelValue",w)},x=(p,E,w)=>{var B,k;w.preventDefault();const C=(k=(B=w.dataTransfer)==null?void 0:B.files)==null?void 0:k[0];if(!C)return;g(p,E,{target:{files:[C],value:""}})};return(p,E)=>(e.openBlock(),e.createElementBlock("div",nw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(co,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",ow,[e.createVNode(co,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",rw,[e.createVNode(e.unref(le.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",aw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",sw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(w,C)=>{var _;return e.openBlock(),e.createElementBlock("div",{key:C,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[e.createVNode(co,{text:w[t.itemTitle]||w.name||w.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),m(w)?(e.openBlock(),e.createElementBlock("div",iw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",lw,e.toDisplayString(((_=m(w))==null?void 0:_.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:B=>b(w)},[e.createVNode(e.unref(le.X),{class:"w-4 h-4"})],8,cw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${C}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.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:E[0]||(E[0]=e.withModifiers(()=>{},["prevent"])),onDrop:B=>!t.disabled&&!u.value.has(C)&&x(w,C,B)},[u.value.has(C)?(e.openBlock(),e.createBlock(e.unref(le.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(le.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",uw,e.toDisplayString(u.value.has(C)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",fw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${C}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(C),accept:t.typeFile,onChange:B=>g(w,C,B)},null,40,hw)],42,dw))])}),128))],2)]))}}),vd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>It[n.icon]??It.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(jt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),mw=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)(e.unref(gw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),pw=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),gw=cr("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"}}),Vs=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)(e.unref(bw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),bw=cr("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"}}),Ds=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ns=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ms=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),vs=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(Fe)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),yw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},xw={class:"flex flex-wrap items-center justify-center gap-2"},kw=["accept","multiple"],qr=Et(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var k;o.disabled||(k=a.value)==null||k.click()}function f(k){const y=k/1024,A=y/1024;return A>=1?`${A.toFixed(2)} MB`:y>=1?`${y.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 y=(o.maxSizeMb??2)*1024*1024;return k.size>y?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(k){l.value=k.name,c.value=k.size}function g(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const A=k[0],V=h(A);if(V){i.value=V,r("error",V);return}o.showSelected&&m(A),r("picked",A);return}const y=[];for(const A of k){const V=h(A);if(V){i.value=V,r("error",V);return}y.push(A)}y.length&&(o.showSelected&&m(y[0]),r("picked:multiple",y))}function b(k){const y=k.target,A=Array.from(y.files??[]);g(A),y.value=""}function x(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function E(){s.value=!1}function w(k){var V,M;if(o.disabled)return;s.value=!1;const y=Array.from(((V=k.dataTransfer)==null?void 0:V.files)??[]),A=(M=o.accept)!=null&&M.includes("image/")?y.filter(D=>D.type.startsWith("image/")):y;g(A)}const C=e.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const _=e.ref(!1),B=e.computed(()=>{if(o.disabled||!_.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,y)=>(e.openBlock(),e.createBlock(e.unref(Ds),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Ms),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(vs),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(Ns),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.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",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:e.withModifiers(x,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(E,["prevent"]),onDrop:e.withModifiers(w,["prevent"]),onMouseenter:y[0]||(y[0]=A=>_.value=!0),onMouseleave:y[1]||(y[1]=A=>_.value=!1)},[e.createElementVNode("div",yw,[y[2]||(y[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),y[3]||(y[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",xw,[e.createVNode(e.unref(Vs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(C.value),1)]),_:1}),e.createVNode(e.unref(Vs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(Vs),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:b},null,40,kw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(mw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(pw),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),ww={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Cw=["src"],Ew={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"},Bw={class:"space-y-0.5"},_w={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Sw={class:"text-xs opacity-70"},Aw=["disabled"],Vw={key:1},Dw=["disabled"],Nw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Mw={class:"flex gap-2"},vw={class:"font-medium truncate"},Pw={class:"flex gap-2"},Tw={class:"font-medium"},Ow={class:"flex gap-2"},Fw={class:"font-medium truncate"},Ps=Et(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,b=g/1024;return b>=1?`${b.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.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=e.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,g)=>t.file?(e.openBlock(),e.createBlock(Ds,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Ms,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(vs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",ww,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ns,{class:"pt-2"},{default:e.withCtx(()=>{var b,x,p,E,w;return[e.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-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=C=>c.value=!0),onMouseleave:g[3]||(g[3]=C=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Cw)):(e.openBlock(),e.createElementBlock("div",Ew,[e.createVNode(e.unref(le.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Bw,[e.createElementVNode("p",_w,e.toDisplayString((b=l.value)==null?void 0:b.name),1),e.createElementVNode("p",Sw,e.toDisplayString((x=l.value)==null?void 0:x.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=C=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,Aw)):(e.openBlock(),e.createElementBlock("div",Vw)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=C=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,Dw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",Nw,[e.createElementVNode("div",Mw,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",vw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",Pw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Tw,e.toDisplayString((E=l.value)==null?void 0:E.size),1)]),e.createElementVNode("div",Ow,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Fw,e.toDisplayString((w=l.value)==null?void 0:w.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function Ts(){const t=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:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const zw={class:"space-y-3"},Iw={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=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:B=>r("update:modelValue",B)}),s=e.ref(null),i=e.ref(null);function l(B){i.value=B,r("error",B)}function c(){i.value=null}const d=e.computed(()=>{const B=(o.allowedTypes??"").trim();return B?B.split(/[,\s;]+/g).map(y=>y.trim().toLowerCase()).filter(Boolean).map(y=>y.includes("/")||y.startsWith(".")?y:`.${y}`):[]});function u(B){const k=B.lastIndexOf(".");return k>=0?B.slice(k).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const B=d.value.filter(y=>y.startsWith("."));return[...d.value.filter(y=>y.includes("/")),...B].join(",")}return o.accept}),h=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(B){if(d.value.length){const k=(B.type||"").toLowerCase(),y=u(B.name);return d.value.some(A=>A.includes("/")?k===A:A.startsWith(".")?y===A:y===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(V=>V.trim().toLowerCase()),y=(B.type||"").toLowerCase(),A=u(B.name);return k.some(V=>{if(V.endsWith("/*")){const M=V.slice(0,-2);return y.startsWith(M)}return V.startsWith(".")?A===V:y===V})}return!0}function g(B){return B*1024*1024}async function b(B){return B?m(B)?o.minSizeMb!=null&&B.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:x}=st(),p=Ts(),E=e.ref(!1);async function w(B){var k;if(o.uploadFn){try{E.value=!0;const y=await o.uploadFn(B);a.value=B,r("uploaded",y)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{E.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){a.value=B;return}if(typeof x!="function"){l("useApi() must expose DCodeApi()");return}try{E.value=!0;const y=new FormData;y.append("doc",B);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),V=o.endpoint.apiUrl,M=await x("","",y,{_url:V,_method:A,withCredentials:!0,transformRequest:[(T,P)=>(P&&(delete P["Content-Type"],delete P["content-type"]),T)]}),D=(M==null?void 0:M.data)??M;a.value=B,r("uploaded",D)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{E.value=!1}}async function C(B){var y;if(o.disabled)return;c();const k=await b(B);if(k){l(k);return}s.value=B,o.uploadFn||(y=o.endpoint)!=null&&y.apiUrl?await w(B):a.value=B}function _(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,k)=>(e.openBlock(),e.createElementBlock("div",zw,[a.value?E.value?(e.openBlock(),e.createElementBlock("div",Iw,[...k[1]||(k[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(Ps,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:_},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(qr,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||E.value,onPicked:C,error:i.value,onError:k[0]||(k[0]=y=>l(y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Rw=["for"],Lw={key:0,class:"!ml-1 !text-destructive"},$w={class:"relative w-full block box-border"},jw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Ww=["id","readonly","disabled","placeholder"],Uw={class:"absolute inset-y-0 right-4 flex items-center z-10"},Hw={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},qw={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Gw={key:1,class:"text-sm text-muted-foreground text-center"},Xw=["onClick","title"],Kw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},Yw={class:"flex items-center justify-center flex-1"},Jw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Qw={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},Td=e.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(t,{emit:n}){const o=t,r=n,a=It,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),h=e.ref(!1),m=e.ref(!1),g=e.ref(!1),b=e.shallowRef([]),x=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),E=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(H=>setTimeout(H,0));const R=Object.keys(a).filter(H=>!p.has(H)).filter(H=>/^[A-Z]/.test(H)).filter(H=>typeof a[H]=="function"||typeof a[H]=="object"&&a[H]).sort((H,ae)=>H.localeCompare(ae));b.value=R,m.value=!0,g.value=!1},w=e.computed(()=>!m.value||!u.value||!b.value.includes(u.value)?null:a[u.value]),C=e.ref(u.value),_=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!m.value)return[];const R=(f.value??"").trim().toLowerCase();return R?b.value.filter(H=>H.toLowerCase().includes(R)):b.value}),k=e.computed(()=>B.value.slice(0,x.value)),y=e.computed(()=>{const R=o.columns;return R<=2?"grid-cols-2":R===3?"grid-cols-3":R===4?"grid-cols-4":R===5?"grid-cols-5":R>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>w.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var R;await e.nextTick(),(R=i.value)==null||R.focus()},V=async R=>{if(o.disabled)return;const H=R!==!1;if(h.value){h.value=!1;return}d.value=!0,await E(),H&&(f.value="",C.value=""),x.value=o.pageSize,await A()},M=()=>{d.value=!1,f.value="",C.value=u.value,x.value=o.pageSize},D=async()=>{o.disabled||(d.value?M():await V())};let T=null;const P=async R=>{if(o.disabled)return;r("update:modelValue",null),d.value||await V(!1),T&&clearTimeout(T);const H=C.value;T=setTimeout(()=>{f.value=H},300)},K=R=>{o.disabled||(r("update:modelValue",R),M(),queueMicrotask(()=>{var H;return(H=i.value)==null?void 0:H.blur()}))},L=()=>{o.disabled||(r("update:modelValue",null),r("clear"),h.value=!0,M(),queueMicrotask(()=>{var R;return(R=i.value)==null?void 0:R.focus()}))},G=R=>{if(R.key==="Escape"){R.preventDefault(),M();return}if(R.key==="Enter"&&d.value){const H=B.value[0];H&&(R.preventDefault(),K(H))}},Q=R=>{if(!d.value)return;const H=R.target;s.value&&!s.value.contains(H)&&M()},X=R=>{const H=R.target;H.scrollTop+H.clientHeight>=H.scrollHeight-24&&x.value<B.value.length&&(x.value=Math.min(x.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",Q),queueMicrotask(()=>{var R;i.value=((R=s.value)==null?void 0:R.querySelector("input"))??null}),u.value&&E()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Q),T&&clearTimeout(T)}),e.watch(u,R=>{d.value||(C.value=R)}),e.watch(()=>f.value,()=>{x.value=o.pageSize}),(R,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",Lw,"*")):e.createCommentVNode("",!0)],8,Rw)):e.createCommentVNode("",!0),e.createElementVNode("div",$w,[w.value&&!d.value?(e.openBlock(),e.createElementBlock("div",jw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":H[0]||(H[0]=ae=>C.value=ae),readonly:_.value,disabled:o.disabled,placeholder:o.placeholder,class:e.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[w.value&&!d.value?"pl-10":"pl-4",_.value?"cursor-pointer select-none":""]]),onClick:V,onFocus:V,onInput:P,onKeydown:G},null,42,Ww),[[e.vModelText,C.value]]),e.createElementVNode("div",Uw,[o.clearable&&u.value?(e.openBlock(),e.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:H[1]||(H[1]=e.withModifiers(()=>{},["prevent"])),onClick:L,title:"Clear"},[e.createVNode(e.unref(le.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.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:H[2]||(H[2]=e.withModifiers(()=>{},["prevent"])),onClick:D,title:"Open"},[e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",Hw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:X},[g.value?(e.openBlock(),e.createElementBlock("div",qw,[e.createVNode(e.unref(le.Loader2),{class:"h-4 w-4 animate-spin"}),H[3]||(H[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(e.openBlock(),e.createElementBlock("div",Gw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",y.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ae?"ring-1 ring-primary":""]),onClick:Z=>K(ae),title:ae},[e.createElementVNode("div",Kw,[e.createElementVNode("div",Yw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[ae]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",Jw,e.toDisplayString(ae),1)])],10,Xw))),128))],2)),m.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",Qw," Showing "+e.toDisplayString(k.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Zw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},e1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},t1={class:"relative overflow-auto p-0"},Os=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.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,_,B,k){const y=await new Promise((M,D)=>{const T=URL.createObjectURL(w),P=new Image;P.onload=()=>{URL.revokeObjectURL(T),M(P)},P.onerror=K=>{URL.revokeObjectURL(T),D(K)},P.src=T}),A=document.createElement("canvas");A.width=C,A.height=_;const V=A.getContext("2d");return V?(V.drawImage(y,0,0,C,_),await new Promise(M=>{A.toBlob(D=>M(D||w),B,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 g(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 mu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const w=document.documentElement.classList.contains("dark");l.use(ti,{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"),_=l.getPlugin("Dashboard");_&&_.setOptions({theme:C?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(pu,{target:ti,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.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 _=++d;try{const B=C.data,k=B.type||C.type||"image/jpeg";let y=B;if(o.outputWidth&&o.outputHeight&&(y=await h(B,o.outputWidth,o.outputHeight,k,o.quality)),c||_!==d)return;const A=C.name||"edited-image.jpg",V=new File([y],A,{type:k});await x(V,"UPPY_EDITOR_COMPLETE"),r("done",V),a.value=!1}catch{}})}async function x(w,C="CROP_RESULT"){const _=URL.createObjectURL(w);try{const B=await new Promise((k,y)=>{const A=new Image;A.onload=()=>k(A),A.onerror=y,A.src=_});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:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",_),console.groupEnd()}finally{URL.revokeObjectURL(_)}}e.watch(a,async w=>{c=!w,d++,w?(await e.nextTick(),b(),o.file&&await g(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async w=>{a.value&&w&&(await e.nextTick(),await g(w))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=w=>{w.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,w=>{w?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const E=e.ref(!1);return(w,C)=>a.value?(e.openBlock(),e.createElementBlock("div",Zw,[e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:C[0]||(C[0]=_=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",e1,[C[6]||(C[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.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:e.normalizeStyle({opacity:E.value?1:.7}),onClick:C[1]||(C[1]=_=>a.value=!1),onMouseenter:C[2]||(C[2]=_=>E.value=!0),onMouseleave:C[3]||(C[3]=_=>E.value=!1)},[e.createVNode(e.unref(le.X),{class:"h-4 w-4"}),C[5]||(C[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",t1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),n1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},o1=["src"],r1=["disabled"],a1=["disabled"],s1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},i1={class:"flex gap-2"},l1={class:"font-medium truncate"},c1={class:"flex gap-2"},d1={class:"font-medium"},u1={class:"flex gap-2"},f1={class:"font-medium truncate"},Fs=Et(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.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=e.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)=>t.file?(e.openBlock(),e.createBlock(Ds,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Ms,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(vs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",n1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ns,{class:"pt-2"},{default:e.withCtx(()=>{var g,b,x;return[e.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-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,o1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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]=p=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,r1)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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]=p=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,a1)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",s1,[e.createElementVNode("div",i1,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",l1,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",c1,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",d1,e.toDisplayString((b=i.value)==null?void 0:b.size),1)]),e.createElementVNode("div",u1,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",f1,e.toDisplayString((x=i.value)==null?void 0:x.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),h1={class:"space-y-3"},Gr=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:L=>r("update:modelValue",L)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(L){c.value=L,r("error",L)}function u(){c.value=null}const f=e.computed(()=>{const L=(o.allowedTypes??"").trim();return L?L.split(/[,\s;]+/g).map(Q=>Q.trim().toLowerCase()).filter(Boolean).map(Q=>Q.includes("/")||Q.startsWith(".")?Q:`.${Q}`):[]});function h(L){const G=L.lastIndexOf(".");return G>=0?L.slice(G).toLowerCase():""}const m=e.computed(()=>{if(f.value.length){const L=f.value.filter(Q=>Q.startsWith("."));return[...f.value.filter(Q=>Q.includes("/")),...L].join(",")}return o.accept||"image/*"}),g=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function b(L){if(f.value.length){const Q=(L.type||"").toLowerCase(),X=h(L.name);return f.value.some(R=>R.includes("/")?Q===R:R.startsWith(".")?X===R:X===`.${R}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(L.type||"").toLowerCase().startsWith("image/"):!0}function x(L){return L*1024*1024}async function p(L){var G;return(G=L.type)!=null&&G.startsWith("image/")?await new Promise(Q=>{const X=URL.createObjectURL(L),R=new Image;R.onload=()=>{URL.revokeObjectURL(X),Q({w:R.naturalWidth,h:R.naturalHeight})},R.onerror=()=>{URL.revokeObjectURL(X),Q(null)},R.src=X}):null}async function E(L){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const Q=await p(L);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(L){return L?b(L)?o.minSizeMb!=null&&L.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&L.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await E(L):`only Allowed: ${g.value}`:"File tidak valid"}function C(L){o.disabled||(i.value=L,s.value=!0)}async function _(L){if(o.disabled)return;u();const G=await w(L);if(G){d(G);return}l.value=L,C(L)}const{DCodeApi:B}=st(),k=Ts(),y=e.ref(!1);e.ref(null);function A(L,G){return!L||!G?null:L.replace(/\/+$/,"")+"/"+G.replace(/^\/+/,"")}function V(L){var R;const G=(L==null?void 0:L.data)??L,Q=(R=G==null?void 0:G.data)==null?void 0:R[0];if(!Q)return null;const X=A(Q.server,Q.url);return{...Q,fullUrl:X?encodeURI(X):null}}async function M(L){var G;if(o.uploadFn){try{y.value=!0;const Q=await o.uploadFn(L);a.value=L,r("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{y.value=!1}return}if(!((G=o.endpoint)!=null&&G.apiUrl)){a.value=L;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{y.value=!0;const Q=new FormData;Q.append("doc",L);const X=(o.endpoint.apiMethod||"POST").toUpperCase(),R=o.endpoint.apiUrl,H=await B("","",Q,{_url:R,_method:X,withCredentials:!0,transformRequest:[(Z,J)=>(J&&(delete J["Content-Type"],delete J["content-type"]),Z)]}),ae=(H==null?void 0:H.data)??H;V(ae),a.value=L,r("uploaded",ae)}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{y.value=!1}}async function D(L){var G;u(),o.uploadFn||(G=o.endpoint)!=null&&G.apiUrl?await M(L):a.value=L,s.value=!1,i.value=null}function T(){s.value=!1,i.value=null}async function P(){if(!a.value)return;u();const L=o.editUseOriginal?l.value??a.value:a.value,G=await w(L);if(G){d(G);return}C(L)}function K(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,L=>{L&&!l.value&&(l.value=L),L||(l.value=null)},{immediate:!0}),(L,G)=>(e.openBlock(),e.createElementBlock("div",h1,[a.value?(e.openBlock(),e.createBlock(Fs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:P,onRemove:K,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(qr,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:_,error:c.value,onError:G[0]||(G[0]=Q=>d(Q))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Os,{modelValue:s.value,"onUpdate:modelValue":G[1]||(G[1]=Q=>s.value=Q),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:D,onCancel:T},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),m1=["aria-busy"],p1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},g1=["for"],b1={key:0,class:"ml-1 text-destructive"},y1=["id","disabled"],x1={class:"min-w-0 flex-1 text-left"},k1={key:0,class:"flex flex-wrap gap-1.5"},w1={class:"max-w-[220px] truncate"},C1=["onClick"],E1={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"},B1={key:1,class:"text-muted-foreground truncate"},_1={class:"flex items-center gap-2 shrink-0"},S1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},A1=["placeholder","onKeydown"],V1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},D1=["disabled","onClick"],N1={class:"truncate"},M1={key:0,class:"text-primary-600 dark:text-primary-400"},v1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},P1={key:0},T1={key:1},O1={key:1,class:"text-xs text-destructive"},zs=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const N=o.required,I=o["aria-required"];return N===""||N===!0||N==="true"||(I==="true"||I===!0)}),u=e.computed(()=>!!a.error);function f(N){return N?typeof a.itemTitle=="function"?a.itemTitle(N)??"":String((N==null?void 0:N[a.itemTitle])??""):""}function h(N){return N?typeof a.itemValue=="function"?a.itemValue(N):N==null?void 0:N[a.itemValue]:null}function m(N,I){return h(N)??I}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),b=e.computed(()=>{var N;return!!((N=a.endpoint)!=null&&N.apiUrl)||!!a.fetchItems}),x=e.ref([]),p=e.ref(!1),E=e.ref(!1),w=e.computed(()=>{var I;const N=(I=a.endpoint)==null?void 0:I.apiOptions;if(N)return typeof N=="function"?N():N}),C=e.computed(()=>{var ne,ee;const N=((ne=a.endpoint)==null?void 0:ne.apiUrl)??"",I=(((ee=a.endpoint)==null?void 0:ee.apiMethod)??"GET").toUpperCase(),W=JSON.stringify(w.value??null);return`${I} ${N} :: ${W}`}),_=e.computed(()=>b.value?x.value:a.items||[]);async function B(){var N;if(b.value&&!(!((N=a.endpoint)!=null&&N.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let I;if(a.fetchItems){const W=await a.fetchItems(),ne=(W==null?void 0:W.data)??W;I=(ne==null?void 0:ne.data)??ne}else{const{DCodeApi:W}=st();if(typeof W!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const ne={page:1,perPage:100,...w.value||{}},ee=await W("","",ne,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),fe=(ee==null?void 0:ee.data)??ee;I=(fe==null?void 0:fe.data)??fe}x.value=Array.isArray(I)?I:[],E.value=!0}catch(I){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",I),x.value=[]}finally{p.value=!1}}}e.watch(()=>C.value,()=>{x.value=[],E.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&b.value&&B()});const k=e.computed(()=>{const N=g.value;if(a.returnObject)return N;const I=new Map;for(const W of _.value)I.set(h(W),W);return N.map(W=>I.get(W)??{[a.itemValue]:W,[a.itemTitle]:String(W)})}),y=e.computed(()=>a.maxChips===null?k.value:k.value.slice(0,a.maxChips));function A(N){const I=g.value;if(a.returnObject){const W=h(N);return I.some(ne=>h(ne)===W)}return I.includes(h(N))}const V=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const N=Number(a.maxSelected);return Number.isFinite(N)&&N>0?N:null}),M=e.computed(()=>{const N=V.value;return N===null?!1:g.value.length>=N});function D(N){return!A(N)&&M.value}const T=e.computed(()=>{const N=g.value,I=new Set;if(a.returnObject)for(const W of N)I.add(h(W));else for(const W of N)I.add(W);return I}),P=e.computed(()=>{const N=T.value;return(_.value||[]).filter(I=>!N.has(h(I)))}),K=e.computed(()=>_.value.length===0?!1:P.value.length===0),L=e.ref(null),G=e.ref(null),Q=e.ref(null),X=e.ref(!1),R=e.ref(""),H=e.ref(0),ae=e.ref(0),{floatingStyles:Z}=Va(L,G,{whileElementsMounted:Ea,placement:"bottom-start",middleware:[Ba(8),Sa(),_a({padding:8}),Aa({apply({rects:N,elements:I}){Object.assign(I.floating.style,{width:`${N.reference.width}px`,"--floating-width":`${N.reference.width}px`})}})]}),J=e.computed(()=>Z.value),ie=e.computed(()=>{const N=Number(a.maxRows);return Number.isFinite(N)&&N>0?N:5});async function de(){a.disabled||(X.value=!0,ae.value=0,requestAnimationFrame(()=>{Q.value&&(Q.value.scrollTop=0),H.value=0}),b.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!E.value)&&!p.value&&await B())}function Ee(){X.value=!1}function Ne(){X.value?Ee():de()}function ye(N){var W,ne;if(!X.value)return;const I=N.target;(W=L.value)!=null&&W.contains(I)||(ne=G.value)!=null&&ne.contains(I)||Ee()}e.onMounted(()=>document.addEventListener("mousedown",ye)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",ye));function te(N){if(a.disabled)return;if(D(N)){r("max");return}const I=[...g.value];if(a.returnObject){const W=h(N);if(I.some(ee=>h(ee)===W))return;r("update:modelValue",[...I,N])}else{const W=h(N);if(I.includes(W))return;r("update:modelValue",[...I,W])}R.value="",ae.value=0,requestAnimationFrame(()=>{Q.value&&(Q.value.scrollTop=0),H.value=0})}function O(N){if(a.disabled)return;const I=[...g.value];if(a.returnObject){const W=h(N);r("update:modelValue",I.filter(ne=>h(ne)!==W))}else{const W=h(N);r("update:modelValue",I.filter(ne=>ne!==W))}}function Y(){a.disabled||(r("update:modelValue",[]),r("clear"),Ee())}const se=e.computed(()=>{const N=R.value.trim().toLowerCase(),I=P.value;return N?I.filter(W=>f(W).toLowerCase().includes(N)):I}),xe=e.computed(()=>se.value.length);e.watch(X,N=>{N||(R.value="")});const Ae=e.computed(()=>{if(K.value)return a.itemHeight;const N=xe.value;return(N<=0?1:Math.min(N,ie.value))*a.itemHeight}),Re=e.computed(()=>a.virtual?xe.value*a.itemHeight:0),Ve=e.computed(()=>a.virtual?Math.ceil(Ae.value/a.itemHeight)+a.overscan:xe.value),je=e.computed(()=>{if(!a.virtual)return 0;const N=Math.floor(H.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,N)}),Oe=e.computed(()=>a.virtual?Math.min(xe.value,je.value+Ve.value):xe.value),at=e.computed(()=>a.virtual?je.value*a.itemHeight:0),ut=e.computed(()=>{const N=se.value;return a.virtual?N.slice(je.value,Oe.value):N});function St(N){const I=N.target;H.value=I.scrollTop}function At(N){return N===ae.value}function q(N){const I=Q.value;if(!I||!a.virtual)return;const W=N*a.itemHeight,ne=W+a.itemHeight,ee=I.scrollTop,fe=I.scrollTop+I.clientHeight;W<ee?I.scrollTop=W:ne>fe&&(I.scrollTop=ne-I.clientHeight)}function ce(N){const I=Math.max(0,xe.value-1);ae.value=Math.min(I,Math.max(0,ae.value+N)),q(ae.value)}function v(){const N=se.value[ae.value];N&&te(N)}const U=e.computed(()=>a.clearable&&!a.disabled&&k.value.length>0),$=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":X.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(N,I)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",p1)):e.createCommentVNode("",!0),I[3]||(I[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",b1,"*")):e.createCommentVNode("",!0)],8,g1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:L,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.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-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",$.value]]),disabled:a.disabled,onClick:Ne},[e.createElementVNode("div",x1,[k.value.length?(e.openBlock(),e.createElementBlock("div",k1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(W,ne)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(W,ne)}`,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"},[e.createElementVNode("span",w1,e.toDisplayString(f(W)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(ee=>O(W),["stop"]),"aria-label":"Remove"}," ✕ ",8,C1))]))),128)),a.maxChips!==null&&k.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",E1," +"+e.toDisplayString(k.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",B1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",_1,[U.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(Y,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,y1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:G,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(J.value)},[a.searchable&&!K.value?(e.openBlock(),e.createElementBlock("div",S1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":I[0]||(I[0]=W=>R.value=W),placeholder:a.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[I[1]||(I[1]=e.withKeys(e.withModifiers(W=>ce(1),["prevent"]),["down"])),I[2]||(I[2]=e.withKeys(e.withModifiers(W=>ce(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(v,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Ee,["prevent"]),["esc"])]},null,40,A1),[[e.vModelText,R.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:Q,class:"relative overflow-auto",style:e.normalizeStyle({height:Ae.value+"px"}),onScroll:St},[K.value?(e.openBlock(),e.createElementBlock("div",V1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Re.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${at.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(W,ne)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(W,je.value+ne)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[D(W)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",At(je.value+ne)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(W)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||D(W),onClick:ee=>te(W)},[e.createElementVNode("span",N1,e.toDisplayString(f(W)),1),A(W)?(e.openBlock(),e.createElementBlock("span",M1,"✓")):e.createCommentVNode("",!0)],14,D1))),128))],6),xe.value===0?(e.openBlock(),e.createElementBlock("div",v1,[p.value?(e.openBlock(),e.createElementBlock("span",P1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",T1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",O1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,m1)),[[e.vShow,i.value]])}}),F1={class:"space-y-4"},z1={key:0,class:"flex flex-col gap-0.5"},I1=["for"],R1=["for"],L1={class:"text-[11px] text-gray-500 dark:text-gray-400"},$1={class:"flex items-center gap-2 flex-nowrap"},j1=["id","value","disabled","onKeydown","onInput","onPaste"],Xr=e.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(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=st(),f=Ts(),h=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:h.value},(B,k)=>{var y;return((y=s.default)==null?void 0:y[k])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=B=>{B<0||B>=h.value||e.nextTick(()=>{var k;return(k=l.value[B])==null?void 0:k.focus()})},b=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function x(B){var k;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const y=await s.submitFn(B);i("success",y)}catch(y){console.error("OTP Submit Error",y),f.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.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 y=(s.endpoint.apiMethod||"POST").toUpperCase(),A=s.endpoint.apiUrl,V=await u("","",{otp:B},{_url:A,_method:y,withCredentials:!0}),M=(V==null?void 0:V.data)??V;i("success",M)}catch(y){console.error("OTP Submit Error",y),f.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(B,k)=>{c.value[B]=b(k);const y=c.value.join("");i("updateOtp",y),i("update:modelValue",y),y.length===h.value&&x(y)},E=(B,k)=>{const y=B.key,A=/^\d$/.test(y),V=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(B.preventDefault(),c.value[k]){p(k,"");return}k>0&&(p(k-1,""),g(k-1));return}if(y==="ArrowLeft"){B.preventDefault(),g(k-1);return}if(y==="ArrowRight"){B.preventDefault(),g(k+1);return}if(A||V){B.preventDefault(),p(k,y),k<h.value-1&&g(k+1);return}y.length===1&&B.preventDefault()},w=(B,k)=>{const y=B.target,A=y.value??"",V=b(A);y.value=V,p(k,V),V&&k<h.value-1&&g(k+1)},C=(B,k)=>{var D;B.preventDefault();const A=(((D=B.clipboardData)==null?void 0:D.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let V=k;for(const T of A){if(V>=h.value)break;c.value[V]=T,V++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&x(M),g(Math.min(V,h.value-1))},_=B=>k=>{l.value[B]=(k==null?void 0:k.$el)??k};return(B,k)=>(e.openBlock(),e.createElementBlock("div",F1,[s.label||h.value?(e.openBlock(),e.createElementBlock("div",z1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,I1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,R1)),e.createElementVNode("p",L1," Ketik "+e.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",$1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,y=>(e.openBlock(),e.createElementBlock("input",{key:y,id:y===1?a.value:void 0,ref_for:!0,ref:_(y-1),value:c.value[y-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.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[y-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>E(A,y-1),onInput:A=>w(A,y-1),onPaste:A=>C(A,y-1)},null,42,j1))),128))])]))}}),W1={class:"w-full"},U1={key:0,class:"flex items-center justify-between mb-2"},H1={key:0,class:"text-sm font-medium text-gray-700"},q1={key:1,class:"text-sm text-gray-600"},G1={name:"DCodeProgress"},Od=e.defineComponent({...G1,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(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.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=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",W1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",U1,[t.label?(e.openBlock(),e.createElementBlock("span",H1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",q1,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),X1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Fd=Et(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",X1,[e.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:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),K1={class:"grid gap-3"},Y1={key:0,class:"ml-1 text-destructive"},J1={class:"flex flex-col"},Q1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},Z1={class:"relative flex-shrink-0 mt-0.5"},eC=["id","name","value","checked","disabled","required","onChange"],tC=["onClick"],nC=["for"],oC={key:0,class:"ml-1 text-red-500"},rC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Is=e.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(t,{emit:n}){e.useAttrs();const{apiUrl:o}=st(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var C,_;const w=((C=a.endpoint)==null?void 0:C.apiUrl)||a.apiUrl;if(w){i.value=!0,l.value=null;try{const B={page:1,perPage:100},k=((_=a.endpoint)==null?void 0:_.apiMethod)||a.apiMethod,y=await o(w,k,B);let A=y;a.dataPath?A=a.dataPath.split(".").reduce((M,D)=>M&&M[D]!=="undefined"?M[D]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(A=y.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(B){console.error("DCodeRadio fetch error:",B),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var w;((w=a.endpoint)!=null&&w.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const w=a.itemValue||a.model||"id",C=a.itemTitle||(a.label===""?"name":a.label);return C&&a.label!==""?[{[w]:w,[C]:C}]:[]}),u=w=>{if(typeof w!="object")return w;const C=a.itemValue||a.model||"id";return w[C]},f=w=>{if(typeof w!="object")return String(w);const C=a.itemTitle||"name";return w[C]},h=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),b=w=>w==null?a.modelValue===w:String(a.modelValue)===String(w),x=e.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"}})[a.size]),p=(w,C)=>{C.target.checked&&(r("update:modelValue",w),r("change",w))},E=w=>{!a.disabled&&!b(w)&&(r("update:modelValue",w),r("change",w))};return(w,C)=>(e.openBlock(),e.createElementBlock("div",K1,[t.label?(e.openBlock(),e.createBlock(Uo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Y1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",J1,[i.value?(e.openBlock(),e.createElementBlock("div",Q1,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),C[0]||(C[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",x.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",Z1,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${h.value}-${B}`,name:h.value,type:"radio",value:u(_),checked:b(u(_)),disabled:t.disabled,required:t.required&&B===0,onChange:k=>p(u(_),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,eC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>E(u(_))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${h.value}-${B}`,class:e.normalizeClass([x.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(_))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",oC,"*")):e.createCommentVNode("",!0)],10,nC)],8,tC)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",rC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),aC={class:"grid gap-3"},sC={key:0,class:"ml-1 text-destructive"},iC={class:"flex flex-col"},lC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},cC=["onClick"],dC=["id","name","value","checked","disabled","required","onChange"],uC={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},fC=["for"],hC={key:0,class:"ml-1 text-red-500"},mC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Rs=e.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(t,{emit:n}){e.useAttrs();const{apiUrl:o}=st(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,A=>{s.value=A},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var V,M;const A=((V=a.endpoint)==null?void 0:V.apiUrl)||a.apiUrl;if(A){l.value=!0,c.value=null;try{const D={page:1,perPage:100},T=((M=a.endpoint)==null?void 0:M.apiMethod)||a.apiMethod,P=await o(A,T,D);let K=P;a.dataPath?K=a.dataPath.split(".").reduce((G,Q)=>G&&G[Q]!=="undefined"?G[Q]:void 0,P):typeof P=="object"&&!Array.isArray(P)&&P.data&&(K=P.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(D){console.error("DCodeRadioCustom fetch error:",D),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var A;((A=a.endpoint)!=null&&A.apiUrl||a.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"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const A=a.itemValue||a.model||"id",V=a.itemTitle||(a.label===""?"name":a.label);return V&&a.label!==""?[{[A]:A,[V]:V}]:[]}),g=A=>{if(typeof A!="object")return A;const V=a.itemValue||a.model||"id";return A[V]},b=A=>{if(typeof A!="object")return String(A);const V=a.itemTitle||"name";return A[V]},x=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${x}`),E=e.computed(()=>!!a.error||!!c.value),w=e.computed(()=>a.error||c.value),C=A=>{const V=s.value;return A==null?V===A:String(V)===String(A)},_=e.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"}})[a.size]),B=e.computed(()=>a.icon&&It[a.icon]||null),k=(A,V)=>{V.target.checked&&(s.value=A,r("update:modelValue",A),r("change",A))},y=A=>{a.disabled||C(A)||(s.value=A,r("update:modelValue",A),r("change",A))};return(A,V)=>(e.openBlock(),e.createElementBlock("div",aC,[t.label?(e.openBlock(),e.createBlock(Uo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",sC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",iC,[l.value?(e.openBlock(),e.createElementBlock("div",lC,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),V[0]||(V[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(M,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",C(g(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",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:T=>!t.disabled&&y(g(M))},[e.createElementVNode("input",{id:t.id?`${t.id}-${D}`:`${p.value}-${D}`,name:p.value,type:"radio",value:g(M),checked:C(g(M)),disabled:t.disabled,required:t.required&&D===0,onChange:T=>k(g(M),T),class:"sr-only",tabindex:"-1"},null,40,dC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",C(g(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"])},[B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",uC,[...V[1]||(V[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${D}`:`${p.value}-${D}`,class:e.normalizeClass([_.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",C(g(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(b(M))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",hC,"*")):e.createCommentVNode("",!0)],10,fC)],10,cC))),128))],2),E.value&&w.value?(e.openBlock(),e.createElementBlock("div",mC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(w.value),1)])):e.createCommentVNode("",!0)])]))}}),pC={key:0,class:"ml-1 text-destructive"},gC={class:"relative w-full"},bC={key:0,class:"mb-2 flex items-center justify-between"},yC={class:"text-sm text-muted-foreground"},xC={class:"text-sm font-medium text-foreground"},kC={class:"text-sm text-muted-foreground"},wC={class:"relative"},CC=["id","value","min","max","step","disabled","placeholder"],EC={key:1,class:"relative mt-2"},BC={class:"text-xs text-muted-foreground mt-1"},_C={key:1,class:"flex items-center gap-1 text-sm text-destructive"},SC={name:"DCodeSlider"},Kr=e.defineComponent({...SC,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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const _={sm:"h-2",md:"h-2.5",lg:"h-3"},B={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",_[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=e.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"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const _=a.max-a.min;return(a.modelValue-a.min)/_*100}),b=_=>{const B=_.target,k=parseFloat(B.value);r("update:modelValue",k),r("input",k)},x=_=>{const B=_.target,k=parseFloat(B.value);r("change",k)},p=()=>{i.value=!0},E=()=>{i.value=!1},w=_=>{const B=a.max-a.min;return(_-a.min)/B*100},C=e.computed(()=>{const _={sm:16,md:20,lg:24};return`
67
67
  input[type="range"]::-webkit-slider-thumb {
68
68
  ${h.value}
69
69
  width: ${_[a.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(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(Lo),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Y1,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",J1,[t.showValue?(e.openBlock(),e.createElementBlock("div",Q1,[e.createElementVNode("span",Z1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",eC,e.toDisplayString(m.value),1),e.createElementVNode("span",tC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",nC,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${g.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:y,onChange:k,onMousedown:p,onMouseup:E,onTouchstart:p,onTouchend:E},null,42,oC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",rC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,x=>(e.openBlock(),e.createElementBlock("div",{key:x.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${C(x.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",aC,e.toDisplayString(x.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",sC,[B[1]||(B[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),lC={class:"grid gap-3"},cC={key:0,class:"ml-1 text-destructive"},dC={class:"inline-flex items-center gap-3"},uC=["id","name","aria-checked","aria-label","disabled"],fC={key:0,class:"absolute inset-0 flex items-center justify-center"},hC={class:"relative z-10 flex items-center gap-2"},mC=["id","name","aria-checked","aria-label","disabled"],pC={key:0,class:"absolute inset-0 flex items-center justify-center"},gC={name:"DCodeSwitch"},Hr=e.defineComponent({...gC,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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.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=e.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=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.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=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(e.openBlock(),e.createElementBlock("div",lC,[t.title?(e.openBlock(),e.createBlock(Lo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",cC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",dC,[e.createVNode(e.unref(Ji),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(Ki),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(Qi),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",fC,[...h[0]||(h[0]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,uC)]),_:1}),e.createVNode(e.unref(Yi),{side:"top","side-offset":8,class:e.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",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",hC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",pC,[...h[1]||(h[1]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,mC))]),_:1})])]))}}),bC=["aria-busy"],yC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},xC=["for"],kC={key:0,class:"ml-1 text-destructive"},wC={class:"relative w-full group"},CC=["id","value"],EC={key:0,class:"absolute top-1 right-2"},BC={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"},_C={key:1,class:"text-xs text-destructive"},so=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const Q=o.required,O=o["aria-required"];return Q===""||Q===!0||Q==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:Q,class:O,id:X,required:re,"aria-required":be,...Ee}=o;return Ee}),f=e.computed(()=>{const Q=o.maxlength;let O=Number.NaN;return typeof Q=="number"?O=Q:typeof Q=="string"&&(O=Number.parseInt(Q,10)),Number.isFinite(O)&&O>0?O:-1}),h=Q=>f.value>0?Q.slice(0,f.value):Q,m=e.computed(()=>{const Q=a.modelValue;return Q==null||String(Q).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),y=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,Q=>{const O=String(Q??"");O!==y.value&&(y.value=O)});const k=e.ref(!1),p=e.ref(!1),E=Q=>Q.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const X=O.toLowerCase();return X.charAt(0).toUpperCase()+X.slice(1)}).join(""),C=Q=>{const O=Q.toLowerCase(),X=O.search(new RegExp("\\p{L}","u"));return X<0?O:O.slice(0,X)+O.charAt(X).toUpperCase()+O.slice(X+1)},w=Q=>{switch(a.textCase){case"uppercase":return Q.toUpperCase();case"lowercase":return Q.toLowerCase();case"titlecase":return E(Q);case"sentencecase":return C(Q);case"none":default:return Q}},_=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=Q=>{if(!Q)return null;const O=Array.isArray(Q)?Q.join(""):Q;return O?new Set(O):null},x=e.computed(()=>B(a.allowChars)),b=(Q,O)=>(Q.lastIndex=0,Q.test(O)),S=Q=>{if(Q===`
96
- `)return a.valueType!=="number";if(a.valueType==="free")return!0;const O=Q===" ",X=/\d/.test(Q),re=new RegExp("\\p{L}","u").test(Q),be=new RegExp("\\p{N}","u").test(Q);return a.valueType==="number"?X:a.valueType==="letter"?re||a.allowSpaces&&O:a.valueType==="letternumber"?re||be||a.allowSpaces&&O:!0},D=Q=>{let O="";for(const X of Q){const re=!!x.value&&x.value.has(X);a.pattern&&!re&&!b(a.pattern,X)||!re&&!S(X)||(O+=X)}return O},M=Q=>{const O=D(Q),X=a.applyTextCaseToValue?w(O):O;return h(X)};let N=null;const P=Q=>{if(Q==="")return null;if(a.valueType==="number"&&a.returnNumber){const O=Q.replaceAll(`
97
- `,""),X=Number(O);return Number.isFinite(X)?X:null}return Q},T=Q=>{y.value=Q,r("update:modelValue",P(Q))},K=(Q,O)=>{const X=h(O);p.value=!0,Q.value=X,T(X),queueMicrotask(()=>p.value=!1)},$=(Q,O)=>{const X=Q.selectionStart??Q.value.length,re=Q.selectionEnd??Q.value.length;if(f.value>0){const be=Q.value.length-(re-X),Ee=f.value-be;if(Ee<=0)return;O=O.slice(0,Ee)}Q.setRangeText(O,X,re,"end"),K(Q,M(Q.value))},H=Q=>{var re;if(!N||k.value||p.value||!((re=Q.inputType)!=null&&re.startsWith("insert")))return;const O=Q.data;if(O==null)return;const X=M(O);X!==O&&(Q.preventDefault(),X.length>0&&$(N,X))},ee=Q=>{var re;if(!N||k.value||p.value)return;const O=((re=Q.clipboardData)==null?void 0:re.getData("text"))??"",X=M(O);X!==O&&(Q.preventDefault(),X.length>0&&$(N,X))},q=async Q=>{if(!N||k.value||p.value)return;const O=Q.target,X=O.value??"",re=M(X);if(re===X){const be=O.selectionStart??re.length,Ee=O.selectionEnd??re.length;K(O,re),await e.nextTick();try{O.setSelectionRange(be,Ee)}catch{}T(re)}else{const be=O.selectionStart??re.length,Ee=O.selectionEnd??re.length;K(O,re),await e.nextTick();try{O.setSelectionRange(be,Ee)}catch{}}},R=()=>k.value=!0,j=()=>{if(k.value=!1,!N)return;const Q=N.value??"",O=M(Q);O===Q?T(O):K(N,O)};e.onMounted(()=>{if(N=document.getElementById(c.value),!N)return;N.addEventListener("beforeinput",H),N.addEventListener("paste",ee),N.addEventListener("input",q),N.addEventListener("compositionstart",R),N.addEventListener("compositionend",j);const Q=N.value??"",O=M(Q);O===Q?T(O):K(N,O)}),e.onBeforeUnmount(()=>{N&&(N.removeEventListener("beforeinput",H),N.removeEventListener("paste",ee),N.removeEventListener("input",q),N.removeEventListener("compositionstart",R),N.removeEventListener("compositionend",j),N=null)});const ae=()=>{y.value="",N&&(N.value=""),r("update:modelValue",null),r("clear")},Z=e.computed(()=>y.value.length),J=e.computed(()=>a.showCharCount?f.value>0:!1),le=e.computed(()=>J.value&&Z.value>0),ue=e.computed(()=>`${Z.value} / ${f.value}`),Ce=e.computed(()=>!!a.error),Be=e.computed(()=>{const Q=o.rows,O=typeof Q=="number"?Q:Number.parseInt(String(Q??""),10);return Number.isFinite(O)&&O>0?O:3}),me=e.computed(()=>({height:`${Be.value*24+16}px`}));return(Q,O)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",yC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(me.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",kC,"*")):e.createCommentVNode("",!0)],8,xC)):e.createCommentVNode("",!0),e.createElementVNode("div",wC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:y.value},u.value,{style:`text-transform: ${_.value}; padding-right: ${g.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",Ce.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,CC),g.value?(e.openBlock(),e.createElementBlock("div",EC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ae}," ✕ ")])):e.createCommentVNode("",!0),le.value&&!Ce.value?(e.openBlock(),e.createElementBlock("p",BC,e.toDisplayString(ue.value),1)):e.createCommentVNode("",!0)]),Ce.value?(e.openBlock(),e.createElementBlock("p",_C,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,bC)),[[e.vShow,i.value]])}}),Md=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.AvatarRoot),{class:e.normalizeClass(e.unref(ve)(e.unref(SC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),vd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Pd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),SC=Ma("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"}}}),qr=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ke.Separator),e.mergeProps(e.unref(o),{class:e.unref(ve)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),AC={class:"bg-card text-card-foreground"},VC={class:"pb-6 px-3"},DC={key:0,class:"flex justify-center p-8"},NC={key:1,class:"p-8 text-center text-red-500"},MC={key:2,class:"relative"},vC={class:"space-y-6"},PC={class:"rounded-xl border bg-card text-card-foreground shadow"},TC={class:"p-4"},OC={class:"flex items-center justify-between gap-3"},FC={class:"font-medium"},zC={class:"text-xs text-muted-foreground"},IC={class:"mt-1 text-sm text-muted-foreground"},RC={class:"text-foreground"},LC={class:"text-foreground"},$C={class:"mt-1 text-xs text-muted-foreground"},jC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},WC={class:"flex items-center justify-between gap-3"},UC={class:"font-medium"},HC={class:"text-xs text-muted-foreground"},qC={class:"mt-2 text-sm text-muted-foreground"},GC={class:"flex flex-wrap items-center justify-between gap-3"},XC={class:"flex items-center gap-3"},KC={class:"leading-tight"},YC={class:"text-sm font-medium"},JC={class:"text-xs text-muted-foreground"},QC={class:"flex items-center gap-2"},ZC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},eE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},tE=["src"],nE={class:"flex-1"},oE={class:"flex items-center justify-between gap-3"},rE={class:"font-medium"},aE={class:"text-xs text-muted-foreground"},sE={class:"mt-1 text-sm text-muted-foreground"},iE={class:"text-left sm:text-center"},lE={class:"text-xs text-muted-foreground"},cE={class:"text-left sm:text-center"},dE={class:"text-xs text-muted-foreground"},uE={class:"text-left sm:text-center"},fE={class:"text-xs text-muted-foreground"},hE={class:"flex items-center justify-between gap-3"},mE={class:"font-medium"},pE={class:"text-xs text-muted-foreground"},gE={class:"mt-2 text-sm text-muted-foreground"},bE={class:"mt-3 flex items-center gap-3"},yE={class:"text-sm font-medium"},xE={class:"flex items-start justify-between gap-3"},kE={class:"font-medium"},wE={class:"mt-3 grid gap-2 text-sm"},CE={class:"flex items-center justify-between gap-3"},EE={class:"flex items-center gap-2 text-muted-foreground"},BE={class:"font-medium"},_E={class:"flex items-center justify-between gap-3"},SE={class:"flex items-center gap-2 text-muted-foreground"},AE={class:"font-medium"},VE={class:"flex items-center justify-between gap-3"},DE={class:"flex items-center gap-2 text-muted-foreground"},NE={class:"font-medium"},ME={class:"flex items-center justify-between"},vE={class:"flex items-center gap-2"},PE={class:"flex items-start justify-between gap-3"},TE={class:"flex items-center gap-2"},OE={class:"font-medium"},FE={class:"mt-2 text-sm text-muted-foreground"},zE={key:0,class:"mt-1 text-sm text-muted-foreground"},IE={class:"flex flex-wrap items-center justify-between gap-3"},RE={class:"flex items-center gap-2"},LE={class:"text-xs text-muted-foreground"},Td=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=Je.useBreakpoints(Je.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.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{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:ce.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ce.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ce.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ce.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ce.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ce.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ce.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=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),y=e.resolveComponent("RefreshCcw"),k=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",AC,[h[8]||(h[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",VC,[a.value?(e.openBlock(),e.createElementBlock("div",DC,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",NC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",MC,[h[7]||(h[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",vC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",PC,[e.createElementVNode("div",TC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",OC,[e.createElementVNode("p",FC,e.toDisplayString(p.title),1),e.createElementVNode("p",zC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",IC,[e.createElementVNode("span",RC,e.toDisplayString(p.from),1),e.createVNode(e.unref(ce.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",LC,e.toDisplayString(p.to),1)]),e.createElementVNode("p",$C,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",jC,[e.createVNode(e.unref(ce.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",WC,[e.createElementVNode("p",UC,e.toDisplayString(p.title),1),e.createElementVNode("p",HC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",qC,e.toDisplayString(p.desc),1),e.createVNode(e.unref(qr),{class:"my-4"}),e.createElementVNode("div",GC,[e.createElementVNode("div",XC,[e.createVNode(e.unref(Md),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Pd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(vd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",KC,[e.createElementVNode("p",YC,e.toDisplayString(p.personName),1),e.createElementVNode("p",JC,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",QC,[e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",ZC,[e.createElementVNode("div",eE,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,tE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",nE,[e.createElementVNode("div",oE,[e.createElementVNode("p",rE,e.toDisplayString(p.title),1),e.createElementVNode("p",aE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",sE,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",iE,[h[1]||(h[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",lE,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",cE,[h[2]||(h[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",dE,e.toDisplayString(p.price),1)]),e.createElementVNode("div",uE,[h[3]||(h[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",fE,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",hE,[e.createElementVNode("p",mE,e.toDisplayString(p.title),1),e.createElementVNode("p",pE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",gE,e.toDisplayString(p.desc),1),e.createElementVNode("div",bE,[e.createVNode(e.unref(Md),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Pd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(vd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",yE,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",xE,[e.createElementVNode("p",kE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",wE,[e.createElementVNode("div",CE,[e.createElementVNode("div",EE,[e.createVNode(e.unref(ce.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",BE,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",_E,[e.createElementVNode("div",SE,[e.createVNode(e.unref(ce.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",AE,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",VE,[e.createElementVNode("div",DE,[e.createVNode(e.unref(ce.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",NE,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(qr),{class:"my-4"}),e.createElementVNode("div",ME,[e.createElementVNode("div",vE,[e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(y,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",PE,[e.createElementVNode("div",TE,[e.createVNode(k,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",OE,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",FE,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",zE,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(qr),{class:"my-4"}),e.createElementVNode("div",IE,[e.createElementVNode("div",RE,[e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Tt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",LE,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),$E={class:"dcode-upload-file"},jE={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"},WE={key:0,class:"text-xs text-gray-500 mt-1"},UE=["accept"],HE={key:1,class:"text-xs text-red-600 mt-1"},Od=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",$E,[t.label?(e.openBlock(),e.createBlock(ao,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",jE,[e.createVNode(e.unref(ce.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",WE,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,UE)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",HE,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),qE=["onClick"],GE={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},XE={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},KE={key:1},YE={key:0,class:"text-white"},JE={key:1},QE={key:2},ZE=["disabled","onClick"],eB={key:1,class:"mr-2 text-sm font-bold opacity-70"},tB={class:"whitespace-normal text-sm text-center leading-tight"},nB={class:"flex flex-col flex-1 min-w-0"},oB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},rB={class:"text-sm text-muted-foreground"},aB={class:"px-1"},sB=["disabled"],iB=["type"],lB=["disabled"],Ts=wt(e.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(t,{emit:n}){const o=t,r=n,a=nt(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var x;if(typeof o.modelValue=="string"){const b=(x=o.tabs)==null?void 0:x.findIndex(S=>S.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(x){var b;if(i.value=x,typeof o.modelValue=="string"){const S=(b=o.tabs)==null?void 0:b[x];S?r("update:modelValue",S.key):r("update:modelValue",x)}else r("update:modelValue",x)}}),c=e.computed(()=>{var x;return((x=o.tabs)==null?void 0:x.length)??0}),d=e.computed(()=>{var x;return(x=o.tabs)==null?void 0:x[l.value]});function u(x){return c.value<=0?0:Math.min(Math.max(x,0),c.value-1)}function f(x){return x?typeof x=="string"?Nt[x]||null:x:null}const h=e.reactive({});function m(x){return h[x.key]||(h[x.key]={loaded:!1,loading:!1,data:null,error:null}),h[x.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function y(x){const b=x.endpoint||{};return{apiModule:x.apiModule||b.apiModule,apiAction:x.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:x.apiParams}}function k(x){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[x];return!(!b||b.disabled)}async function p(x){if(typeof x.tab.fetchData=="function"){const T=await x.tab.fetchData(),K=(T==null?void 0:T.data)??T;return(K==null?void 0:K.data)??K}const b=y(x.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=g();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 N=(M==null?void 0:M.data)??M;return(N==null?void 0:N.data)??N}async function E(x,{force:b=!1}={}){const S=u(x),D=o.tabs[S];if(!D)return;const M=m(D);if(!(o.cache&&M.loaded&&!b)&&!M.loading){M.loading=!0,M.error=null;try{const N=await p({tabIndex:S,tab:D});M.data=N,M.loaded=!0,r("loaded",{tabIndex:S,tab:D,data:N})}catch(N){const P=typeof(N==null?void 0:N.message)=="string"&&N.message||typeof N=="string"&&N||"Failed to load tab data.";M.error=P,r("error",{tabIndex:S,tab:D,message:P})}finally{M.loading=!1}}}function C(x){const b=u(x);k(b)&&b!==l.value&&(l.value=b)}function w(x=l.value){return E(x,{force:!0})}function _(){const x=u(l.value-1);x!==l.value&&(l.value=x)}function B(){const x=u(l.value+1);x!==l.value&&(l.value=x)}return e.watch(()=>o.tabs,x=>{for(const b of x??[])m(b)},{immediate:!0}),e.watch(()=>l.value,async x=>{var S;const b=(S=o.tabs)==null?void 0:S[x];b&&r("change",{tabIndex:x,tab:b}),await E(x)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async x=>{x&&await E(l.value)},{immediate:!0}),(x,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(S,D)=>(e.openBlock(),e.createElementBlock("div",{key:S.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[D<l.value?"wizard-num-done":"",D===l.value?"wizard-num-active":D>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&S.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(S.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!S.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",KE,[D<l.value?(e.openBlock(),e.createElementBlock("span",YE,"✓")):(e.openBlock(),e.createElementBlock("span",JE,e.toDisplayString(D+1),1))])):(e.openBlock(),e.createElementBlock("span",QE))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",D===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(S.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(S,D)=>(e.openBlock(),e.createElementBlock("div",{key:S.key,onClick:M=>C(D),style:e.normalizeStyle({zIndex:t.tabs.length-D}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[D>0?"pl-8":"",D===l.value?"wizard-step-active":D<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&S.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(S.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",GE,e.toDisplayString(D+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",XE,e.toDisplayString(S.title),1)],2),D<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[D===l.value?"wizard-svg-active":D<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,qE))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(S,D)=>(e.openBlock(),e.createElementBlock("button",{key:S.key,type:"button",disabled:!k(D),onClick:M=>C(D),class:e.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",e.unref(ve)("border-b border-r",!t.isVertical&&D===t.tabs.length-1&&"border-r-0",D===l.value?"wizard-btn-active":"wizard-btn-pending",!k(D)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&S.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(S.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",eB,e.toDisplayString(D+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",tB,e.toDisplayString(S.title),1)],10,ZE))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(qr),{key:0})),e.createElementVNode("div",nB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var S,D,M,N;return[(e.openBlock(),e.createElementBlock("div",{key:((S=d.value)==null?void 0:S.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(D=h[d.value.key])!=null&&D.loading?e.renderSlot(x.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",oB,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(x.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(M=h[d.value.key])==null?void 0:M.data,loaded:(N=h[d.value.key])==null?void 0:N.loaded,reload:w},()=>[e.createElementVNode("div",rB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",aB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:_,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,sB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:B,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,iB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.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"},[t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,lB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),cB={class:"permission-menu w-full space-y-4"},dB={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},uB={class:"flex items-center justify-between"},fB={class:"flex items-center gap-3 flex-1"},hB=["onClick"],mB={key:1,class:"w-7"},pB={key:2,class:"flex-shrink-0"},gB={class:"text-lg font-semibold flex-1"},bB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},yB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},xB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},kB=["checked","disabled","onChange"],wB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},CB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},EB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},BB={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},_B={class:"flex items-center justify-between"},SB={class:"flex items-center gap-3 flex-1"},AB={key:0,class:"flex-shrink-0"},VB={class:"text-base font-semibold flex-1"},DB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},NB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},MB=["checked","onChange"],vB={class:"text-xs font-medium"},PB={key:0,class:"p-3"},TB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},OB=["checked","disabled","onChange"],FB={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Os=wt(e.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(t,{expose:n,emit:o}){const{t:r}=zt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(D=!0)=>{(N=>{N.forEach(P=>{P.permission.forEach(T=>{const K=`${P.id}-${T.id}-parent`,$=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has(K)||l.value.set(K,$||(D?P.checked??!1:!1))}),P.detail&&P.detail.length>0&&P.detail.forEach(T=>{T.permission.forEach(K=>{const $=`${T.id}-${K.id}-child`,H=K.code==="VIEW"||K.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,H||(D?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(D=>{const M=D.menuId,N=D.actionsIds;i.value.forEach(P=>{P.id===M&&N.forEach(T=>{const K=`${M}-${T}-parent`;l.value.set(K,!0)}),P.detail&&P.detail.length>0&&P.detail.forEach(T=>{T.id===M&&N.forEach(K=>{const $=`${M}-${K}-child`;l.value.set($,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.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),g=(D,M,N=!1)=>{const P=`${D}-${M}-${N?"child":"parent"}`;return l.value.get(P)??!1},y=()=>{const D=B();s("update:modelValue",D.permissions)},k=(D,M,N,P=!1)=>{const T=N.target.checked,K=`${D}-${M}-${P?"child":"parent"}`;l.value.set(K,T),s("permission-change",D,M,T,!P),y()},p=D=>D.permission.filter(E),E=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",C=(D,M,N)=>{const P=N.target.checked;M.permission.forEach(T=>{if(E(T)){const $=`${M.id}-${T.id}-child`;l.value.set($,!0);return}const K=`${M.id}-${T.id}-child`;l.value.set(K,P)}),l.value=new Map(l.value),s("menu-check",M.id,P),y()},w=(D,M=!1)=>{const N=M?D.permission:p(D);return!N||N.length===0?!1:N.every(P=>{const T=`${D.id}-${P.id}-${M?"child":"parent"}`;return l.value.get(T)??!1})},_=()=>{const D={};return i.value.forEach(M=>{var N;D[M.id]={name:M.name,parentPermissions:M.permission.map(P=>({id:P.id,name:P.name,checked:g(M.id,P.id,!1)})),children:((N=M.detail)==null?void 0:N.map(P=>({id:P.id,name:P.name,permissions:P.permission.map(T=>({id:T.id,name:T.name,checked:g(P.id,T.id,!0)}))})))||[]}}),D},B=()=>{const D=[],M=(N,P=!1)=>{const T=[];N.permission.forEach(K=>{const $=`${N.id}-${K.id}-${P?"child":"parent"}`;(l.value.get($)??!1)&&T.push(K.id)}),T.length>0&&D.push({menuId:N.id,actionsIds:T})};return i.value.forEach(N=>{M(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{M(P,!0)})}),{permissions:D}};return n({getCurrentStates:_,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const D=[],M=(N,P=!1)=>{const T=N.permission.map($=>{const H=`${N.id}-${$.id}-${P?"child":"parent"}`,ee=l.value.get(H)??!1;return{id:$.id,name:$.name,checked:ee}}),K=T.filter($=>$.checked).map($=>$.id);D.push({menuId:N.id,menuName:N.name,actionsIds:K,actions:T})};return i.value.forEach(N=>{M(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{M(P,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,M)=>(e.openBlock(),e.createElementBlock("div",cB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createElementBlock("div",{key:N.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(N)}])},[e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createElementVNode("div",fB,[f(N)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:P=>h(N.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(N.id)?(e.openBlock(),e.createBlock(e.unref(ce.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(ce.ChevronRight),{key:1,class:"w-5 h-5"}))],8,hB)):(e.openBlock(),e.createElementBlock("div",mB)),t.showIcons&&N.icon?(e.openBlock(),e.createElementBlock("span",pB,[e.createElementVNode("i",{class:e.normalizeClass([N.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",gB,e.toDisplayString(N.name),1)])])]),N.permission&&N.permission.length>0&&!f(N)?(e.openBlock(),e.createElementBlock("div",bB,[e.createElementVNode("h4",yB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",xB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(N),P=>(e.openBlock(),e.createElementBlock("label",{key:P.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"},[e.createElementVNode("input",{type:"checkbox",checked:E(P)||g(N.id,P.id,!1),disabled:E(P),onChange:T=>k(N.id,P.id,T,!1),class:e.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",E(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,kB),e.createElementVNode("span",wB,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[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:e.withCtx(()=>[f(N)&&m(N.id)?(e.openBlock(),e.createElementBlock("div",CB,[e.createElementVNode("h4",EB,[M[0]||(M[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.detail,P=>(e.openBlock(),e.createElementBlock("div",{key:P.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"},[e.createElementVNode("div",BB,[e.createElementVNode("div",_B,[e.createElementVNode("div",SB,[t.showIcons&&P.icon?(e.openBlock(),e.createElementBlock("span",AB,[e.createElementVNode("i",{class:e.normalizeClass([P.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",VB,e.toDisplayString(P.name),1),P.path?(e.openBlock(),e.createElementBlock("span",DB,e.toDisplayString(P.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",NB,[e.createElementVNode("input",{type:"checkbox",checked:w(P,!0),onChange:T=>C(N,P,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,MB),e.createElementVNode("span",vB,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),P.permission&&P.permission.length>0?(e.openBlock(),e.createElementBlock("div",PB,[e.createElementVNode("div",TB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.permission,T=>(e.openBlock(),e.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"},[e.createElementVNode("input",{type:"checkbox",checked:E(T)||g(P.id,T.id,!0),disabled:E(T),onChange:K=>k(P.id,T.id,K,!0),class:e.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",E(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,OB),e.createElementVNode("span",FB,e.toDisplayString(T.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-5f742a90"]]),zB={class:"space-y-4"},IB={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},RB={key:0,class:"text-danger-500"},LB={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},$B={class:"text-neutral-600 dark:text-neutral-400"},jB={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},WB={class:"text-neutral-500 dark:text-neutral-400"},UB={key:3,class:"space-y-3"},HB={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},qB={class:"flex items-center gap-3"},GB={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},XB={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},KB={class:"flex items-center gap-2 text-sm font-medium"},YB={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},JB={class:"p-4"},QB={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},ZB={class:"ml-2 flex-1 min-w-0"},e_=["for"],t_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},n_={key:4,class:"mt-1 text-xs text-danger-600"},Fs=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=zt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(E=>({menuId:E.menuId,module:E.module,label:E.label||E.module,permissions:E.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const E={};return p.forEach(C=>{const w=C.key,_=w&&w.includes(".")?w.split(".")[0]:"other";E[_]||(E[_]={menuId:0,module:_,label:_,permissions:[]}),E[_].permissions.push({id:C.id,key:C.key,label:C.label,description:C.description})}),Object.values(E)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const E=[],C=(w,_="")=>{const B=_?`${_}.${w.name}`:w.name,x=B.toLowerCase().replace(/\s+/g,"_"),b=[];if(w.detail&&Array.isArray(w.detail)&&w.detail.forEach(S=>{b.push(S.id)}),w.permission&&w.permission.length>0){const S=w.permission.map(D=>({id:D.id,key:`${x}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${w.name}`,description:`Permission to ${D.name.toLowerCase()} ${w.name.toLowerCase()}`}));E.push({menuId:w.id,module:x,label:w.name,permissions:S,subMenuIds:b.length>0?b:void 0})}w.detail&&Array.isArray(w.detail)&&w.detail.forEach(S=>{C(S,B)})};return p.forEach(w=>C(w)),E}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const E=u(p);i.value=E;const C={},w=[],_={};E.forEach(x=>{x.permissions.forEach(b=>{const S=typeof b.id=="string"?parseInt(b.id):b.id;_[S]=x.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(x=>{w.push(x.menuId),x.actionsIds&&Array.isArray(x.actionsIds)&&x.actionsIds.forEach(b=>B.add(b))}),E.forEach(x=>x.permissions.forEach(b=>{const S=typeof b.id=="string"?parseInt(b.id):b.id;C[S]=B.has(S)})),l.value=C,c.value=w,d.value=_}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(E=>{const C=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[C]}).length,m=p=>p.permissions.every(E=>{const C=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[C]}),g=p=>{const E=h(p);return E>0&&E<p.permissions.length},y=e.ref(!1),k=(p,E)=>{y.value=!0,p.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),p.permissions.forEach(_=>{const B=typeof _.id=="string"?parseInt(_.id):_.id;l.value[B]=E});let C=o.modelValue?[...o.modelValue]:[],w=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(w=[...w,...p.subMenuIds],p.subMenuIds.forEach(_=>{const B=i.value.find(x=>x.menuId===_);B&&B.permissions.forEach(x=>{const b=typeof x.id=="string"?parseInt(x.id):x.id;l.value[b]=E})})),E?w.forEach(_=>{const B=i.value.find(x=>x.menuId===_);if(B){const x=B.permissions.map(S=>typeof S.id=="string"?parseInt(S.id):S.id),b=C.findIndex(S=>S.menuId===_);b!==-1?C[b]={menuId:_,actionsIds:x}:C.push({menuId:_,actionsIds:x})}}):C=C.filter(_=>!w.includes(_.menuId)),c.value=C.map(_=>_.menuId),console.log("Full Result:",JSON.stringify(C,null,2)),r("update:modelValue",C),setTimeout(()=>{y.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const E=new Set,C=[];p.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(_=>E.add(_))}),Object.keys(l.value).forEach(w=>{const _=parseInt(w);l.value[_]=E.has(_)}),c.value=C}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,E)=>{if(y.value)return;if(Object.keys(p).map(w=>parseInt(w)).filter(w=>p[w]!==(E==null?void 0:E[w])).length>0){let w=o.modelValue?[...o.modelValue]:[];const _={};Object.keys(p).forEach(B=>{const x=parseInt(B);if(p[x]){const b=d.value[x];console.log(`Permission ${x} belongs to Menu ${b}`),b!==void 0&&(_[b]||(_[b]=[]),_[b].push(x))}}),Object.keys(_).forEach(B=>{const x=parseInt(B),b=_[x],S=w.findIndex(D=>D.menuId===x);S!==-1?w[S]={menuId:x,actionsIds:b}:w.push({menuId:x,actionsIds:b})}),w=w.filter(B=>_[B.menuId]&&_[B.menuId].length>0),c.value=w.map(B=>B.menuId),console.log("Result:",JSON.stringify(w,null,2)),r("update:modelValue",w)}},{deep:!0}),e.onMounted(f),(p,E)=>(e.openBlock(),e.createElementBlock("div",zB,[t.label?(e.openBlock(),e.createElementBlock("label",IB,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",RB,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",LB,[e.createVNode(e.unref(ce.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",$B,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",jB,[e.createElementVNode("p",WB,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",UB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,C=>(e.openBlock(),e.createElementBlock("div",{key:C.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"},[e.createElementVNode("div",HB,[e.createElementVNode("div",qB,[e.createVNode(rn,{modelValue:m(C),indeterminate:g(C),"onUpdate:modelValue":w=>k(C,!!w),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",GB,e.toDisplayString(C.label||C.module),1),e.createElementVNode("div",XB,e.toDisplayString(h(C))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(C.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",KB,[e.createElementVNode("div",YB,e.toDisplayString(h(C))+"/"+e.toDisplayString(C.permissions.length),1)])]),e.createElementVNode("div",JB,[e.createElementVNode("div",QB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.permissions,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(rn,{modelValue:l.value[typeof w.id=="string"?parseInt(w.id):w.id],"onUpdate:modelValue":_=>l.value[typeof w.id=="string"?parseInt(w.id):w.id]=_,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",ZB,[e.createElementVNode("label",{for:`perm-${w.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(w.label||w.key),9,e_),w.description?(e.openBlock(),e.createElementBlock("p",t_,e.toDisplayString(w.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",n_,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),o_=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},r_=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),a_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):r_(t),s_={key:0,class:"fixed inset-0 z-[100] flex justify-end"},i_={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},l_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},c_={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},d_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},u_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},f_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},h_=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(He,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",s_,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",i_,[e.createElementVNode("div",l_,[e.createElementVNode("div",null,[e.createElementVNode("h3",c_,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",d_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(He,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",u_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",f_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),m_={key:0},p_=["value","name"],Fd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=zt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Gn,DCodeAutoComplete:er,DCodeDatePicker:Lr,DCodeTextarea:so,DCodeTextArea:so,DCodeCheckbox:rn,DCodeSwitch:Hr,DCodeOtpInput:Wr,DCodeImageField:jr,DCodeSlider:Ur},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.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,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",m_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,p_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),g_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=Je.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(ve)("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)),[[e.vModelText,e.unref(a)]])}}),b_=e.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(t,{emit:n}){const o=t,r=n,a=Je.reactiveOmit(o,"class"),s=ke.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),y_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(ve)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),x_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(ve)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(ce.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),k_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class","size"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(ve)(e.unref(qn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),w_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=Je.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(ve)(e.unref(qn)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),C_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class","size"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(ve)(e.unref(qn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),E_=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class","size"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(ve)(e.unref(qn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),B_=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class","size"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(ve)(e.unref(qn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),__=e.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(t,{emit:n}){const o=t,r=n,a=ke.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),S_=e.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(t,{emit:n}){const o=t,r=n,a=Je.reactiveOmit(o,"class"),s=ke.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ke.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("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",t.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:e.withCtx(()=>[e.createVNode(e.unref(N_)),e.createVNode(e.unref(ke.SelectViewport),{class:e.normalizeClass(e.unref(ve)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(D_))]),_:3},16,["class"])]),_:3}))}}),A_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},V_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(ve)("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:e.withCtx(()=>[e.createElementVNode("span",A_,[e.createVNode(e.unref(ke.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(ke.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),D_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(ve)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronDown))])]),_:3},16,["class"]))}}),N_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(ve)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronUp))])]),_:3},16,["class"]))}}),M_=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Je.reactiveOmit(n,"class"),r=ke.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(ve)("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:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(ke.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),v_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(ke.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),jo={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},io={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},pt={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},P_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},T_={dangerouslyHTMLString:!1,multiple:!0,position:jo.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},O_={rtl:!1,newestOnTop:!1,toastClassName:""},zd={...T_,...O_};pt.DEFAULT;var Oe=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Oe||{}),zs=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(zs||{});const F_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},z_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},I_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},R_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Id="Toastify--animate Toastify__none-enter";function Rd(t,n=!1){var o;let r=F_;if(!t||typeof t=="string")switch(t){case"flip":r=R_;break;case"zoom":r=I_;break;case"slide":r=z_;break}else r=t;if(n)r.enter=Id;else if(r.enter===Id){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function L_(t){return t.containerId||String(t.position)}const Gr="will-unmount";function $_(t=jo.TOP_RIGHT){return!!document.querySelector(`.${Oe.CSS_NAMESPACE}__toast-container--${t}`)}function j_(t=jo.TOP_RIGHT){return`${Oe.CSS_NAMESPACE}__toast-container--${t}`}function W_(t,n,o=!1){const r=[`${Oe.CSS_NAMESPACE}__toast-container`,`${Oe.CSS_NAMESPACE}__toast-container--${t}`,o?`${Oe.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return co(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function U_(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Oe.CSS_NAMESPACE,l=j_(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Gr)),f=c||document.createElement("div"),h=document.createElement("div");h.className=W_(o,r,a),h.dataset.testid=`${Oe.CSS_NAMESPACE}__toast-container--${o}`,h.id=L_(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=Oe.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Is(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",Is,!1);try{Wo[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Wo[a],delete ct[a]}catch{}}const Wo=e.reactive({});function H_(t,n){const o=document.getElementById(String(n));o&&(Wo[o.id]=t)}function Rs(t,n=!0){const o=String(t);if(!Wo[o])return;const r=document.getElementById(o);r&&r.classList.add(Gr),n?(G_(t),r&&r.addEventListener("animationend",Is,!1)):Is(o),Dt.items=Dt.items.filter(a=>a.containerId!==t)}function q_(t){for(const n in Wo)Rs(n,t);Dt.items=[]}function Ld(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...Rd(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function G_(t){for(const n in ct)if(n===t)for(const o of ct[n]||[])Ld(o)}function X_(t){const n=lo().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function Ls(t){return document.getElementById(t)}function K_(t){const n=Ls(t.containerId);return n&&n.classList.contains(Gr)}function $d(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function Y_(t){return t?Dt.items.filter(n=>n.containerId===t).length>0:Dt.items.length>0}function J_(){if(Dt.items.length>0){const t=Dt.items.shift();Xr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const ct=e.reactive({}),Dt=e.reactive({items:[]});function lo(){const t=e.toRaw(ct);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function Q_(t){return lo().find(n=>n.toastId===t)}function Xr(t,n={}){if(K_(n)){const o=Ls(n.containerId);o&&o.addEventListener("animationend",$s.bind(null,t,n),!1)}else $s(t,n)}function $s(t,n={}){const o=Ls(n.containerId);o&&o.removeEventListener("animationend",$s.bind(null,t,n),!1);const r=ct[n.containerId]||[],a=r.length>0;if(!a&&!$_(n.position)){const s=U_(n),i=e.createApp(C2,n);n.useHandler&&n.useHandler(i),i.mount(s),H_(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?Et.update(n):Et.add(t,n)})}const Et={add(t,n){const{containerId:o=""}=n;o&&(ct[o]=ct[o]||[],ct[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=ct[o])==null||r.unshift(n):(a=ct[o])==null||a.push(n),n.onOpen&&n.onOpen($d(n))},n.delay||0))},remove(t){if(t){const n=X_(t);if(n){const o=ct[n];let r=o.find(a=>a.toastId===t);ct[n]=o.filter(a=>a.toastId!==t),!ct[n].length&&!Y_(n)&&Rs(n,!1),J_(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose($d(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){ct[n]=ct[n]||[];const o=ct[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};Et.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{We(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Rs(t,n):q_(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",Et.dismissCallback,!1),setTimeout(()=>{Et.remove(o)}))},dismiss(t){if(t){const n=lo();for(const o of n)if(o.toastId===t){Ld(o,r=>{r.addEventListener("animationend",Et.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=lo();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",Et.dismissCallback,!1),Et.remove(t));break}}}},Z_=e.reactive({useHandler:void 0}),jd=e.reactive({}),Kr=e.reactive({});function Wd(){return Math.random().toString(36).substring(2,9)}function e2(t){return typeof t=="number"&&!isNaN(t)}function js(t){return typeof t=="string"}function co(t){return typeof t=="function"}function Yr(...t){return e.mergeProps(...t)}function Jr(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function t2(t={}){jd[`${Oe.CSS_NAMESPACE}-default-options`]=t}function Ud(){return jd[`${Oe.CSS_NAMESPACE}-default-options`]||zd}function n2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var Qr=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(Qr||{});const Hd={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:jo.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:io.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:pt.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}},o2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:pt.DEFAULT},theme:{type:String,required:!1,default:io.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}},r2=e.defineComponent({name:"ProgressBar",props:o2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${Oe.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Oe.CSS_NAMESPACE}__progress-bar--controlled`:`${Oe.CSS_NAMESPACE}__progress-bar--animated`,`${Oe.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Oe.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Oe.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),a2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:io.AUTO},type:{type:String,required:!1,default:io.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Oe.CSS_NAMESPACE}__close-button ${Oe.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.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)])])}}),Zr=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function s2(t){return e.createVNode(Zr,e.mergeProps(t,{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 i2(t){return e.createVNode(Zr,e.mergeProps(t,{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 l2(t){return e.createVNode(Zr,e.mergeProps(t,{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 c2(t){return e.createVNode(Zr,e.mergeProps(t,{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 d2(){return e.createVNode("div",{class:`${Oe.CSS_NAMESPACE}__spinner`},null)}const ea={info:i2,warning:s2,success:l2,error:c2,spinner:d2},u2=t=>t in ea;function f2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return ea.spinner();if(r!==!1){if(Jr(r))a=e.toRaw(r);else if(co(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?ea.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):js(r)||e2(r)?a=r:u2(n)&&(a=ea[n](i));return a}}const h2=()=>{};function m2(t,n,o=Oe.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function p2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(Qr.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Oe.COLLAPSE_DURATION}),i=s.done||h2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:k,onMouseleave:y}:{});function u(){const E=l.value.split(" ");h().addEventListener(zs.ENTRANCE_ANIMATION_END,y,{once:!0});const C=_=>{const B=h();_.target===B&&(B.dispatchEvent(new Event(zs.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",C),B.removeEventListener("animationcancel",C),a.value===Qr.Enter&&_.type!=="animationcancel"&&B.classList.remove(...E))},w=()=>{const _=h();_.classList.add(...E),_.addEventListener("animationend",C),_.addEventListener("animationcancel",C)};t.pauseOnFocusLoss&&m(),w()}function f(){if(!h())return;const E=()=>{const w=h();w.removeEventListener("animationend",E),s.collapse?m2(w,i,s.collapseDuration):i()},C=()=>{const w=h();a.value=Qr.Exit,w&&(w.className+=` ${c.value}`,w.addEventListener("animationend",E))};o.value||(r.value?E():setTimeout(C))}function h(){return t.toastRef.value}function m(){document.hasFocus()||k(),window.addEventListener("focus",y),window.addEventListener("blur",k)}function g(){window.removeEventListener("focus",y),window.removeEventListener("blur",k)}function y(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function k(){n.value=!1}function p(E){E&&(E.stopPropagation(),E.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const E=lo();o.value=E.findIndex(C=>C.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?k():y())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function g2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const b2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Hd,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>f2(t)),s=e.computed(()=>[`${Oe.CSS_NAMESPACE}__toast`,`${Oe.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Oe.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Oe.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=p2({toastRef:n,loading:o,done:()=>{Et.remove(t.toastId)},...Rd(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(g2(f)){const h=[];return f.title!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Oe.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Oe.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Oe.CSS_NAMESPACE}__toast-text`},[h])}return Jr(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):co(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${Oe.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Oe.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Oe.CSS_NAMESPACE}--animate-icon ${Oe.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Jr(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):co(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(a2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Jr(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):co(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(r2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),ta="vue3-toastify:url-change";let na=0,Uo;function y2(){if(!(typeof window>"u")&&Kr.lastUrl!==window.location.href){Kr.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Ud().clearOnUrlChange!==!1,n=Object.values(ct).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&Et.dismiss(o.toastId);Dt.items=Dt.items.filter(o=>!t(o.toastProps))}}function x2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(ta)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ta)),a},()=>{t.pushState=n,t.replaceState=o}}function k2(){if(typeof window>"u"||Uo)return;const t=x2(),n=()=>y2();window.addEventListener(ta,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Uo=()=>{t(),window.removeEventListener(ta,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Uo=void 0}}function w2(){Uo&&(Uo(),Kr.lastUrl="")}const C2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Hd,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>ct[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(na+=1,k2())}),e.onUnmounted(()=>{typeof window<"u"&&na>0&&(na-=1,na===0&&w2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(b2,e.mergeProps({key:s},a),null)})])}});let Ws=!1;const qd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Gd(){const t=[];return lo().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Gr)&&t.push(n)}),t}function E2(t){const n=Gd().length,o=t??0;return o>0&&n+Dt.items.length>=o}function B2(t){E2(t.limit)&&!t.updateId&&Dt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function kn(t,n,o={}){if(Ws)return;o=Yr(Ud(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Wd()),o={...o,...o.type==="loading"?qd:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=n2()),B2(o),Kr.lastUrl=window.location.href,o.multiple?Dt.items.length?o.updateId&&Xr(t,o):Xr(t,o):(Ws=!0,We.clearAll(void 0,!1),setTimeout(()=>{Xr(t,o)},0),setTimeout(()=>{Ws=!1},390)),o.toastId}const We=(t,n)=>kn(t,pt.DEFAULT,n);We.info=(t,n)=>kn(t,pt.DEFAULT,{...n,type:pt.INFO}),We.error=(t,n)=>kn(t,pt.DEFAULT,{...n,type:pt.ERROR}),We.warning=(t,n)=>kn(t,pt.DEFAULT,{...n,type:pt.WARNING}),We.warn=We.warning,We.success=(t,n)=>kn(t,pt.DEFAULT,{...n,type:pt.SUCCESS}),We.loading=(t,n)=>kn(t,pt.DEFAULT,Yr(n,qd)),We.dark=(t,n)=>kn(t,pt.DEFAULT,Yr(n,{theme:io.DARK})),We.remove=t=>{t?Et.dismiss(t):Et.clear()},We.clearAll=(t,n)=>{e.nextTick(()=>{Et.clear(t,n)})},We.isActive=t=>{let n=!1;return n=Gd().findIndex(o=>o.toastId===t)>-1,n},We.update=(t,n={})=>{setTimeout(()=>{const o=Q_(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Wd()},i=s.render||a;delete s.render,kn(i,s.type,s)}},0)},We.done=t=>{We.update(t,{isLoading:!1,progress:1})},We.promise=_2;function _2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=js(n)?We.loading(n,d):We.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,g,y)=>{if(g==null){We.remove(c);return}const k={type:m,...u,...a,data:y},p=js(g)?{render:g}:g;return c?We.update(c,{...k,...p,isLoading:!1}):We(p.render,{...k,...p,isLoading:!1}),y},h=co(t)?t():t;return h.then(m=>{f("success",r,m)}).catch(m=>{f("error",o,m)}),h}We.POSITION=jo,We.THEME=io,We.TYPE=pt,We.TRANSITIONS=P_;const S2={install(t,n={}){Z_.useHandler=n.useHandler||(()=>{}),A2(n)}};typeof window<"u"&&(window.Vue3Toastify=S2);function A2(t={}){const n=Yr(zd,t);t2(n)}const V2={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:[]},D2={key:0,class:"inline-block"},Us=wt(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?Nt[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return f[n.size]||f.sm}),s=e.computed(()=>{const f={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return ve(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>ve("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,h)=>r.value?(e.openBlock(),e.createElementBlock("div",D2,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]),N2={class:"dcode-card animate-slide-up"},M2={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"},v2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},P2={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]"},T2={class:"relative w-full sm:w-64"},O2={key:0,class:"relative"},F2={class:"flex flex-col h-full"},z2={key:0,class:"flex-1 overflow-y-auto py-4"},I2={class:"grid grid-cols-1 gap-4 px-1"},R2={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"},L2={class:"flex justify-end gap-2 w-full"},$2={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},j2={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},W2={class:"dcode-table w-full"},U2={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},H2=["onClick"],q2={key:0,class:"flex items-center justify-center w-full"},G2={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},X2={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},K2={key:0,class:"px-3 py-0.5"},Y2={key:1},J2=["colspan"],Q2={class:"flex flex-col items-center gap-2"},Z2={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},eS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},tS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},nS={key:0,class:"flex items-center justify-center"},oS={key:0,class:"px-3 py-0.5 !text-center"},rS={key:0,class:"flex items-center justify-center gap-1.5"},aS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},sS=["colspan"],iS={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"},lS={class:"flex items-center gap-4"},cS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},dS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},uS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},fS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},hS={class:"flex-shrink-0"},mS={class:"space-y-4"},pS={class:"text-gray-600 dark:text-gray-400"},gS={class:"grid grid-cols-1 gap-4 py-4 px-1"},bS={class:"flex items-end gap-2"},uo=e.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(t,{expose:n,emit:o}){var tu,nu,ou,ru,au,su;const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=nt(),{locale:l}=zt.useI18n();let c={query:{},params:{},path:""};try{const V=En.useRoute();V?c=V:(ou=(nu=(tu=s==null?void 0:s.appContext)==null?void 0:tu.config)==null?void 0:nu.globalProperties)!=null&&ou.$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:V=>{console.warn("Router push() logic called from fallback:",V),typeof V=="string"&&V.startsWith("/")&&(window.location.href=V)}};try{const V=En.useRouter();V?d=V:(su=(au=(ru=s==null?void 0:s.appContext)==null?void 0:ru.config)==null?void 0:au.globalProperties)!=null&&su.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),h=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),y=e.ref(!1),k=e.ref(0),p=e.ref({}),E=e.ref([]),C=e.ref(null),w=e.ref(!0),_=e.ref([]),B=e.ref([]),x=e.ref([]),b=e.ref(!1),S=e.ref(!1),D=e.ref({}),M=e.ref(null),N=e.ref(null),P=e.ref(null),T=e.ref([]),K=e.computed(()=>{if(A.value.length===0)return!1;const V=A.value.map(L=>{const oe=Q.value.find(W=>W.type==="CHECKBOX"),z=(oe==null?void 0:oe.keyCheckbox)||"id";return L[z]}).filter(L=>L!=null);return V.length===0?!1:V.every(L=>T.value.includes(L))}),$=e.computed(()=>{if(A.value.length===0)return!1;const V=Q.value.find(W=>W.type==="CHECKBOX"),L=(V==null?void 0:V.keyCheckbox)||"id",oe=A.value.map(W=>W[L]).filter(W=>W!=null),z=oe.filter(W=>T.value.includes(W)).length;return z>0&&z<oe.length}),H=V=>{const L=Q.value.find(W=>W.type==="CHECKBOX"),oe=(L==null?void 0:L.keyCheckbox)||"id",z=V[oe];return z!==void 0&&T.value.includes(z)},ee=V=>{const L=Q.value.find(W=>W.type==="CHECKBOX"),oe=(L==null?void 0:L.keyCheckbox)||"id",z=A.value.map(W=>W[oe]).filter(W=>W!=null);if(V){const W=new Set([...T.value,...z]);T.value=Array.from(W)}else T.value=T.value.filter(W=>!z.includes(W))},q=(V,L)=>{const oe=Q.value.find(ne=>ne.type==="CHECKBOX"),z=(oe==null?void 0:oe.keyCheckbox)||"id",W=V[z];W!=null&&(L?T.value.includes(W)||T.value.push(W):T.value=T.value.filter(ne=>ne!==W))};e.watch(T,V=>{var oe;a("update:selection",V);const L=K.value||V.length>1;(oe=B.value)!=null&&oe.length&&B.value.forEach(z=>{var W;(W=z.fieldActionGlobal)!=null&&W.length&&z.fieldActionGlobal.forEach(ne=>{var Te,tt;const we=z.endpoint||((Te=z.propsActionGlobal)==null?void 0:Te.endpointPropAction)||z.propsActionGlobal,ze=(tt=we==null?void 0:we.keyParam)==null?void 0:tt[0];(ze&&ne.model===ze||!ze&&/^(id|ids|idAuditTrail)/i.test(ne.model))&&L&&ne.model&&(D.value[ne.model]=V)})})},{deep:!0});const R=V=>Array.from({length:V}).map((L,oe)=>{const z={id:oe+1,no:oe+1};return Q.value.forEach(W=>{W.key!=="no"&&W.key!=="action"&&W.type!=="ACTION"&&W.type!=="action"&&(W.type==="CHECKBOX"?z[W.keyCheckbox||"id"]=oe+1:W.type==="BADGE"||W.type==="badge"||W.condition?z[W.key]=W.condition&&W.condition.length>0?W.condition[0].value:"Active":z[W.key]=`Data ${W.label} ${oe+1}`)}),z}),j=V=>V&&typeof V=="string"&&V.trim()?V:void 0,ae=e.computed(()=>{var V,L,oe,z;return j((L=(V=C.value)==null?void 0:V.endpoint)==null?void 0:L.apiModule)||j((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiModule)||r.apiModule}),Z=e.computed(()=>{var V,L,oe,z;return j((L=(V=C.value)==null?void 0:V.endpoint)==null?void 0:L.apiAction)||j((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiAction)||r.apiAction}),J=e.computed(()=>{var V,L,oe,z;return j((L=(V=C.value)==null?void 0:V.endpoint)==null?void 0:L.apiMethod)||j((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiMethod)||r.apiMethod||"POST"}),le=e.computed(()=>{var V,L,oe,z;return j((L=(V=C.value)==null?void 0:V.endpoint)==null?void 0:L.apiUrl)||j((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiUrl)||r.apiUrl}),ue=e.computed(()=>r.permissionBase||""),Ce=e.computed(()=>!x.value||x.value.length===0?[]:[...x.value].sort((V,L)=>(V.seq||0)-(L.seq||0))),Be=V=>{var ne,we,ze;const L=(V==null?void 0:V.column)||((ne=V==null?void 0:V.props)==null?void 0:ne.column)||((we=V==null?void 0:V.propsFieldGlobal)==null?void 0:we.column)||((ze=V==null?void 0:V.propsFieldCustom)==null?void 0:ze.column);if(!L)return"col-span-1";const oe=L.toLowerCase(),W={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"}[oe]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${V==null?void 0:V.model}: type=${L}, returned=${W}`),W},me=()=>{let V=null;if(r.tableConfig&&(V=r.tableConfig),V){C.value=V,V.headers&&(E.value=V.headers.map(z=>{var we,ze,_e,Te,tt,Xe,Ge,qt,jn,ia;if(z.key==="action"||((we=z.custom)==null?void 0:we.type)==="ACTION"||((ze=z.custom)==null?void 0:ze.type)==="action"){const Cn=((_e=z.custom)==null?void 0:_e.actionCustom)||((Te=z.custom)==null?void 0:Te.action);return Cn&&(_.value=Cn.map(an=>{const lt=an.propsActionCustom||an.props||{},la=an.propCustomMessage||{};return{permission:an.permission,label:l.value==="id"?lt.labelID:lt.labelEN,tooltip:l.value==="id"?lt.tooltipID||lt.labelID:lt.tooltipEN||lt.labelEN,icon:lt.icon,variant:lt.variant||"ghost",bgColor:lt.bgColor,action:lt.actionType||lt.key,route:lt.route,path:lt.path,endpoint:lt.endpointPropAction,requiredCondition:an.requiredCondition||!1,propCustomCondition:an.propCustomCondition||[],openDialog:an.openDialog||!1,fieldActionCustom:(an.fieldActionCustom||[]).map(ca=>{const Xs=ca.propsFieldCustom||ca.propsFieldGlobal||ca.props||{};return{...ca,props:{...Xs,endpoint:Xs.endpointComponent||Xs.endpoint}}}),requireConfirm:an.requireConfirm||lt.requireConfirm||!1,confirmTitle:l.value==="id"?la.titleID||lt.confirmTitleID||"Konfirmasi":la.titleEN||lt.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?la.messageID||lt.confirmMessageID||"Apakah Anda yakin?":la.messageEN||lt.confirmMessageEN||"Are you sure?"}})),null}let W;const ne=((tt=z.custom)==null?void 0:tt.conditionBadge)||((Xe=z.custom)==null?void 0:Xe.condition);return(((Ge=z.custom)==null?void 0:Ge.type)==="BADGE"||((qt=z.custom)==null?void 0:qt.type)==="badge")&&ne&&(W=ne.map(Cn=>({value:Cn.value,label:l.value==="id"?Cn.labelID:Cn.labelEN,color:Cn.color,variant:Cn.variant}))),{key:z.key,label:l.value==="id"?z.labelID:z.labelEN,width:z.width,align:z.align,sortable:!0,type:(jn=z.custom)==null?void 0:jn.type,condition:W,keyCheckbox:(ia=z.custom)==null?void 0:ia.keyCheckbox}}).filter(z=>z!==null));const L=V.filters||V.filter;L&&Array.isArray(L)&&(x.value=L.map(z=>({...z,props:z.propsFilters||z.props||{}})),x.value.forEach(z=>{p.value[z.model]=""}));const oe=V.actionGlobal||V.action;console.log("[DEBUG] loadConfig rawActions:",oe),oe&&Array.isArray(oe)?(B.value=oe.map(z=>{const W=z.propsActionGlobal||z.props||{};return{key:W.key,permission:z.permission,label:l.value==="id"?W.labelID||"Action":W.labelEN||"Action",tooltip:l.value==="id"?W.tooltipID||W.labelID:W.tooltipEN||W.labelEN,icon:W.icon,variant:W.variant||"default",bgColor:W.bgColor,textColor:W.textColor,route:W.route,path:W.path,endpoint:W.endpointPropAction||z.endpoint,openDialog:z.openDialog||!1,fieldActionGlobal:(z.fieldActionGlobal||z.field||[]).map(ne=>{const we=ne.propsFieldGlobal||ne.props||{};return{...ne,props:{...we,endpoint:we.endpointComponent||we.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),V.pagination!==void 0&&(w.value=V.pagination)}};e.watch(()=>r.tableConfig,()=>{me()},{deep:!0,immediate:!0});const Q=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?E.value:r.columns||[]),O=e.computed(()=>r.hasActions||_.value.length>0),X=e.computed(()=>r.dummyMode?!1:ae.value||le.value?y.value:r.loading),re=e.computed(()=>!!ae.value||!!le.value),be=e.computed(()=>[]),Ee=V=>{if(console.log("[DEBUG] hasAction called:",{actionCode:V,permissionChecker:!!r.permissionChecker,effectivePath:ue.value}),r.menuPermissions&&r.menuPermissions.length>0){const L=c.path,oe=r.menuPermissions.find(z=>L.startsWith(z.path));if(oe&&oe.actions){const z=oe.actions.find(W=>W.code===V.toUpperCase());return z?z.checked:!1}return!1}if(r.permissionChecker){const L=r.permissionChecker(ue.value,V);return console.log("[DEBUG] permissionChecker result:",L),L}return be.value.some(L=>L.code===V)},Fe=(V,L)=>{if(!V.visibilityCondition)return!0;const{field:oe,operator:z,value:W}=V.visibilityCondition,ne=ie(L,oe);switch(z){case"equals":return ne===W;case"notEquals":return ne!==W;case"in":return Array.isArray(W)&&W.includes(ne);case"notIn":return Array.isArray(W)&&!W.includes(ne);case"greaterThan":return ne>W;case"lessThan":return ne<W;case"contains":return String(ne).includes(String(W));default:return!0}},Re=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const V=B.value.filter(L=>{if(r.ignorePermissions)return!0;if(!L.permission)return console.log("[DEBUG] Action no permission, showing:",L.label),!0;if(r.checkPermission){const z=r.checkPermission(L.permission);return console.log("[DEBUG] Parent checkPermission result:",z),z}if(r.permissions){const z=r.permissions.includes(L.permission);return console.log("[DEBUG] Parent permissions check result:",z),z}const oe=Ee(L.permission);return console.log("[DEBUG] Internal permission check:",{label:L.label,permission:L.permission,hasPerm:oe}),oe});return console.log("[DEBUG] Filtered header actions:",V.length),V}),Ye=e.computed(()=>_.value.length===0?_.value:_.value.filter(V=>r.ignorePermissions||!V.permission?!0:r.checkPermission?r.checkPermission(V.permission):r.permissions?r.permissions.includes(V.permission):Ee(V.permission))),Ne=V=>Ye.value.filter(L=>Fe(L,V)),it=(V,L)=>{var W,ne;if(V.requiredCondition&&((W=V.propCustomCondition)==null?void 0:W.length)>0){const we=ie(L,"status"),ze=V.propCustomCondition.find(_e=>_e.value===we);if(ze)return ze.bgColor||V.bgColor||"primary"}if(!V.dynamicColor||!V.colorCondition)return V.bgColor||"primary";const oe=ie(L,V.colorCondition.field),z=(ne=V.colorCondition.conditions)==null?void 0:ne.find(we=>we.value===oe);return(z==null?void 0:z.bgColor)||V.bgColor||"primary"},dt=V=>{const L=(V||"left").toLowerCase();return L==="center"?"justify-center":L==="right"?"justify-end":"justify-start"},I={ToggleLeft:ce.ToggleLeft,SquarePen:ce.SquarePen,Trash2:ce.Trash2,Eye:ce.Eye,CheckCircle:ce.CheckCircle,Plus:ce.Plus,Download:ce.Download,RefreshCw:ce.RefreshCw,Search:ce.Search,SlidersHorizontal:ce.SlidersHorizontal},U=V=>V?Nt[V]?Nt[V]:I[V]||null:null,A=e.computed(()=>r.dummyMode?Q.value.length>0?R(10):[]:re.value?g.value.map((V,L)=>({...V,no:(f.value-1)*h.value+L+1})):te.value),F=e.computed(()=>r.dummyMode?10:re.value?k.value:v.value.length),G=e.computed(()=>F.value===0?0:(f.value-1)*h.value+1),se=e.computed(()=>{const V=f.value*h.value;return V>F.value?F.value:V}),ie=(V,L)=>{if(!(!V||!L))return L in V?V[L]:L.split(".").reduce((oe,z)=>oe&&oe[z],V)},v=e.computed(()=>{if(re.value)return[];if(!u.value)return r.data;const V=u.value.toLowerCase();return r.data.filter(L=>Q.value.some(oe=>{const z=ie(L,oe.key);return z==null?!1:String(z).toLowerCase().includes(V)}))}),Y=e.computed(()=>re.value?[]:m.value.key?[...v.value].sort((L,oe)=>{const z=ie(L,m.value.key),W=ie(oe,m.value.key);if(z===W)return 0;let ne=0;return typeof z=="number"&&typeof W=="number"?ne=z-W:ne=String(z).localeCompare(String(W)),m.value.direction==="asc"?ne:-ne}):v.value),te=e.computed(()=>{if(re.value)return[];const V=(f.value-1)*h.value,L=V+h.value;return Y.value.slice(V,L).map((oe,z)=>({...oe,no:V+z+1}))}),de=e.computed(()=>re.value?Object.values(p.value).some(V=>!!V):!!u.value),fe=[10,25,50,100],Se=()=>{re.value&&(p.value={...p.value,keyword:u.value},f.value=1,Ue())};let Pe;const et=()=>{r.enableQuickSearch&&(clearTimeout(Pe),Pe=setTimeout(()=>{Se()},500))};let xe;const rt=()=>{clearTimeout(xe),xe=setTimeout(()=>{re.value&&Ue()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&re.value&&et()});const Ue=async()=>{if(!r.dummyMode&&re.value&&!(!ae.value&&!le.value))try{y.value=!0;const V={page:f.value,perPage:h.value,...p.value,...r.apiParams};u.value&&(V.keyword=u.value),Object.keys(V).forEach(oe=>{(V[oe]===""||V[oe]===null||V[oe]===void 0)&&delete V[oe]});let L;ae.value?L=await i(ae.value,Z.value,V):le.value&&(L=await i(le.value,J.value,V)),Ve(L)}catch(V){console.error("DataTable fetch error",V),y.value=!1}},Ve=V=>{console.log("DataTable handleResponseData:",V),V&&(r.dynamicColumns&&V.columns&&Array.isArray(V.columns)&&(E.value=V.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}))),V.data&&Array.isArray(V.data)?(g.value=V.data,V.totalData?k.value=V.totalData:V.maxPage?k.value=V.maxPage*h.value:k.value=V.data.length*(V.maxPage||1)):Array.isArray(V)?(g.value=V,k.value=V.length):V.users?(g.value=V.users,k.value=V.users.length):V.items&&Array.isArray(V.items)?(g.value=V.items,k.value=V.total||V.totalItems||V.items.length):V.list&&Array.isArray(V.list)?(g.value=V.list,k.value=V.total||V.list.length):V.rows&&Array.isArray(V.rows)?(g.value=V.rows,k.value=V.count||V.total||V.rows.length):V.result&&Array.isArray(V.result)?(g.value=V.result,k.value=V.total||V.count||V.result.length):(console.warn("DataTable: Unknown response format",V),g.value=[],k.value=0)),y.value=!1};e.onUnmounted(()=>{clearTimeout(Pe),clearTimeout(xe)});const gt=()=>{Object.keys(p.value).forEach(V=>{p.value[V]=""}),u.value="",f.value=1,Ue()},Bt=()=>{f.value=1,Ue()},_t=(V,L)=>{const oe=ie(V,L.key);let z={variant:"secondary",class:"",label:oe};if(L.condition){const W=L.condition.find(ne=>{const we=(ze,_e)=>typeof ze=="string"&&typeof _e=="string"?ze.toLowerCase().trim()===_e.toLowerCase().trim():ze==_e;return typeof oe=="object"&&oe!==null?we(ne.value,oe.code)||we(ne.value,oe.id):we(ne.value,oe)});if(W){if(W.variant&&(z.variant=W.variant),z.label=W.label||(typeof oe=="object"?oe.name||oe.code:oe),W.color){const ne=W.color.toLowerCase(),we=z.variant==="outline",ze={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"},_e={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"},Te={danger:"destructive",secondary:"secondary",primary:"default"};we?_e[ne]&&(z.class=_e[ne]):Te[ne]?z.variant=Te[ne]:ze[ne]&&(z.class=ze[ne])}}else z.label=typeof oe=="object"?(oe==null?void 0:oe.name)||(oe==null?void 0:oe.code)||"-":oe}else z.label=typeof oe=="object"?(oe==null?void 0:oe.name)||(oe==null?void 0:oe.code)||"-":oe;return z},Ft=V=>{m.value.key===V?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=V,m.value.direction="asc"),a("update:sort",m.value)},Qe=V=>{V!==f.value&&(f.value=V,re.value&&Ue(),a("update:page",V))},wn=V=>{h.value=V,f.value=1,re.value&&Ue()},Ho=V=>{const L=Math.random()*15+75;if(V.width){const oe=parseInt(String(V.width));return oe<100?`${Math.floor(oe*(Math.random()*.2+.7))}px`:`${L}%`}return`${L}%`},$n=()=>{u.value="",p.value={},f.value=1,Ue()},Qd=V=>{var L;if(console.log("[DEBUG] handleHeaderAction called:",V),V.route){if(V.path){const oe=V.route.startsWith("/")?V.route:"/"+V.route;sessionStorage.setItem(`layout_${oe}`,V.path)}d==null||d.push(V.route)}else if(V.openDialog){N.value=V,P.value=null,D.value={};const oe=V.fieldActionGlobal||V.field||[];oe.length&&oe.forEach(z=>{var we;const W=V.endpoint||((we=V.propsActionGlobal)==null?void 0:we.endpointPropAction)||V.propsActionGlobal,ne=W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null;ne&&z.model===ne||!ne&&/^(id|ids|idAuditTrail)/i.test(z.model)?D.value[z.model]=T.value:D.value[z.model]||(D.value[z.model]="")}),S.value=!0}else a("action",{action:((L=V.propsActionCustom)==null?void 0:L.key)||V.key||"create",row:null,selection:T.value})},bA=async(V,L)=>{var oe,z,W,ne;if(V.requireConfirm){M.value={button:V,row:L},b.value=!0;return}if(V.openDialog){N.value=V,P.value=L,D.value={};const we=Q.value.find(Te=>Te.type==="CHECKBOX"),ze=(we==null?void 0:we.keyCheckbox)||"id";V.fieldActionCustom&&V.fieldActionCustom.forEach(Te=>{/^(id|ids|idAuditTrail)/i.test(Te.model)?D.value[Te.model]=[L[ze]]:V.action==="showToken"&&Te.model==="token"?D.value[Te.model]=L.token!==void 0?L.token:"":L[Te.model]!==void 0?D.value[Te.model]=L[Te.model]:D.value[Te.model]=""});const _e=V.endpoint||((oe=V.propsActionGlobal)==null?void 0:oe.endpointPropAction)||((z=V.propsActionCustom)==null?void 0:z.endpointPropAction)||((W=V.props)==null?void 0:W.endpointPropAction);if(((ne=_e==null?void 0:_e.apiMethod)==null?void 0:ne.toUpperCase())==="GET"&&_e.apiUrl){y.value=!0;const{apiUrl:Te}=nt(),tt={};_e.keyParam&&Array.isArray(_e.keyParam)&&_e.keyParam.forEach((Xe,Ge)=>{const qt=_e.model&&Ge===0?_e.model:Xe;L[Xe]!==void 0&&(tt[qt]=L[Xe])}),Object.keys(tt).length===0&&L.id&&(tt.id=L.id),Te(_e.apiUrl,"GET",tt).then(Xe=>{let Ge=Xe;if(Xe&&Xe.data!==void 0?Ge=Xe.data:Xe&&Xe.result!==void 0&&(Ge=Xe.result),Ge!=null){if(typeof Ge=="string")D.value.hasOwnProperty("token")&&(D.value.token=Ge);else if(typeof Ge=="object"&&(Ge.item&&(Ge=Ge.item),Array.isArray(Ge)&&(Ge=Ge[0]||{}),Object.keys(Ge).forEach(qt=>{D.value[qt]=Ge[qt]}),!D.value.token)){const qt=Object.keys(Ge).find(jn=>jn.toLowerCase().includes("token"));if(qt)D.value.token=Ge[qt];else{const jn=Object.values(Ge).filter(ia=>typeof ia=="string");jn.length===1&&(D.value.token=jn[0])}}}S.value=!0}).catch(Xe=>{console.error("Fetch Data Failed",Xe)}).finally(()=>{y.value=!1});return}S.value=!0;return}Zd(V,L)},Zd=(V,L)=>{if(V.route){if(V.path){const W=V.route.startsWith("/")?V.route:"/"+V.route;sessionStorage.setItem(`layout_${W}`,V.path)}let oe=V.route;oe.includes(":")?oe=oe.replaceAll(/:([a-zA-Z0-9_]+)/g,(W,ne)=>L[ne]||L.id||ne):L.id&&(oe=`${oe.replace(/\/$/,"")}/${L.id}`);const z={};V.path&&(z.code=V.path),d==null||d.push({path:oe,query:z})}else if(V.endpoint&&V.endpoint.apiUrl){y.value=!0;const{apiUrl:oe}=nt(),z=V.endpoint.apiUrl,W=V.endpoint.apiMethod||"POST",ne={};V.endpoint.keyParam&&Array.isArray(V.endpoint.keyParam)&&V.endpoint.keyParam.forEach((we,ze)=>{const _e=V.endpoint.model&&ze===0?V.endpoint.model:we;L[we]!==void 0&&(ne[_e]=L[we])}),Object.keys(ne).length===0&&L.id&&(ne.id=L.id),oe(z,W,ne).then(()=>{Ue(),a("action",{action:V.action||"success",row:L})}).catch(we=>{console.error("Action Failed",we)}).finally(()=>{y.value=!1})}else a("action",{action:V.action,row:L})},yA=()=>{M.value&&(Zd(M.value.button,M.value.row),eu())},xA=()=>{var V,L,oe;if(N.value){const z=N.value,W=z.endpoint||((V=z.propsActionGlobal)==null?void 0:V.endpointPropAction)||z.propsActionGlobal;let ne=(W==null?void 0:W.model)||(W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null);if(!ne){const Te=(z.fieldActionGlobal||z.fieldActionCustom||z.field||[]).find(tt=>/^(id|ids|idAuditTrail)/i.test(tt.model));ne=Te?Te.model:"ids"}let we=null,ze=!1;if(P.value){const _e=Q.value.find(Xe=>Xe.type==="CHECKBOX"),Te=(_e==null?void 0:_e.keyCheckbox)||"id",tt=P.value[Te];W!=null&&W.apiUrl&&(we={...D.value},we[ne]||(we[ne]=[tt]),ze=!0)}else W!=null&&W.apiUrl&&(we={...D.value},we[ne]||(we[ne]=T.value||[]),ze=!0);if(ze&&we&&(W!=null&&W.apiUrl)){if(((L=W==null?void 0:W.apiMethod)==null?void 0:L.toUpperCase())==="GET"){S.value=!1,P.value||(T.value=[]);return}const{apiUrl:_e}=nt(),Te=W.apiUrl,tt=W.apiMethod||"POST";_e(Te,tt,we).then(()=>{S.value=!1,P.value||(T.value=[]),Ue(),a("action",{action:"success",row:null})}).catch(Xe=>{console.error("Action Failed",Xe)})}else if(P.value){const _e=Q.value.find(Ge=>Ge.type==="CHECKBOX"),Te=(_e==null?void 0:_e.keyCheckbox)||"id",tt=P.value[Te],Xe={...D.value};Xe[ne]||(Xe[ne]=[tt]),a("action",{action:N.value.action,row:Xe}),S.value=!1}else{const _e={...D.value};_e[ne]||(_e[ne]=T.value);const Te={action:((oe=N.value.propsActionGlobal)==null?void 0:oe.key)||N.value.key,row:_e,selection:T.value};a("action",Te),S.value=!1}}},kA=V=>{const L=D.value[V];L&&a_(String(L)).then(()=>{We.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(oe=>{console.error("Failed to copy",oe)})},eu=()=>{b.value=!1,M.value=null},wA=e.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),CA=e.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");n({fetchData:Ue,filters:p,resetFilters:gt,handleRefresh:$n});const sa=e.ref(""),EA=V=>{if(!V)return"";const L=V.endpoint||V.endpointGlobal||{};return JSON.stringify({url:L.apiUrl||V.apiUrl,module:L.apiModule||V.apiModule,action:L.apiAction||V.apiAction,method:L.apiMethod||V.apiMethod,params:V.apiParams,socket:L.socket||V.socketEndpoint,socketParams:V.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){me();const V=EA(r.tableConfig);V!==sa.value&&(!sa.value&&re.value?(sa.value=V,Ue()):(sa.value=V,re.value&&rt()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{re.value&&Ue()}),e.watch(()=>r.apiParams,()=>{re.value&&Ue()},{deep:!0}),e.watch(()=>B.value,V=>{console.log("[DEBUG] headerActions changed:",V.length,"items");const L=Re.value;console.log("[DEBUG] visibleHeaderActions evaluated:",L.length,"items")},{deep:!0}),e.onMounted(()=>{me(),re.value&&(r.tableConfig||(y.value=!0,Ue()))}),(V,L)=>{var oe;return e.openBlock(),e.createElementBlock("div",N2,[e.createElementVNode("div",M2,[e.createElementVNode("div",v2,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",P2,[e.createElementVNode("div",T2,[e.createVNode(e.unref(ce.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(g_),{modelValue:u.value,"onUpdate:modelValue":L[0]||(L[0]=z=>u.value=z),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:e.withKeys(Se,["enter"])},null,8,["modelValue"])]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",O2,[e.createVNode(h_,null,{trigger:e.withCtx(()=>[e.createVNode(He,{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:e.withCtx(()=>[e.createElementVNode("div",L2,[e.renderSlot(V.$slots,"filter-footer",{fetch:Ue,reset:gt})])]),default:e.withCtx(()=>[L[8]||(L[8]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",F2,[e.renderSlot(V.$slots,"filter-form",{filters:p.value},()=>[x.value.length>0?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("div",I2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(z,W)=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(Be(z))},[e.createVNode(Fd,{field:z,modelValue:p.value[z.model],"onUpdate:modelValue":ne=>p.value[z.model]=ne},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",R2,[e.createVNode(He,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:gt,disabled:X.value},null,8,["disabled"]),e.createVNode(He,{onClick:Bt,disabled:X.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",$2)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(He,{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:$n,disabled:X.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(ce.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":X.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(z,W)=>(e.openBlock(),e.createBlock(He,{key:W,icon:z.icon,text:z.label,tooltip:z.tooltip,variant:z.variant,"bg-color":z.bgColor,"text-color":z.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:ne=>Qd(z)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(V.$slots,"header-actions")],2)])]),e.createElementVNode("div",j2,[e.createElementVNode("table",W2,[e.createElementVNode("thead",U2,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,z=>(e.openBlock(),e.createElementBlock("th",{key:z.key,class:e.normalizeClass([z.align?`text-${z.align.toLowerCase()}`:"",z.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:e.normalizeStyle(z.width?{width:z.width}:{}),onClick:W=>z.sortable&&Ft(z.key)},[z.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",q2,[e.createVNode(rn,{"model-value":K.value,indeterminate:$.value,"onUpdate:modelValue":L[1]||(L[1]=W=>ee(!!W)),onClick:L[2]||(L[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",dt(z.align)])},[e.createElementVNode("span",null,e.toDisplayString(z.label),1)],2))],14,H2))),128)),O.value?(e.openBlock(),e.createElementBlock("th",G2,[...L[9]||(L[9]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",X2,[X.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value,z=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${z}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,W=>{var ne,we;return e.openBlock(),e.createElementBlock("td",{key:W.key,class:e.normalizeClass([W.align?`text-${W.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.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(W.type??"")||W.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((ne=W.align)==null?void 0:ne.toLowerCase())==="center"?"mx-auto":"",((we=W.align)==null?void 0:we.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(W.type??"")||W.condition?void 0:Ho(W),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",K2,[...L[10]||(L[10]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):A.value.length===0?(e.openBlock(),e.createElementBlock("tr",Y2,[e.createElementVNode("td",{colspan:Q.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",Q2,[e.createVNode(e.unref(du.Vue3Lottie),{animationData:e.unref(V2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",Z2,e.toDisplayString(de.value?"No search results":"No data"),1),e.createElementVNode("p",eS,e.toDisplayString(de.value?"Try changing keywords":"No data added"),1)])])],8,J2)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(A.value,(z,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[e.createElementVNode("tr",tS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,ne=>(e.openBlock(),e.createElementBlock("td",{key:ne.key,class:e.normalizeClass([ne.align?`text-${ne.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(V.$slots,`cell-${ne.key}`,{row:z,value:ie(z,ne.key)},()=>[ne.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",nS,[e.createVNode(rn,{"model-value":H(z),"onUpdate:modelValue":we=>q(z,!!we),onClick:L[3]||(L[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):ne.type==="badge"||ne.type==="BADGE"||ne.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[ne.align?`justify-${ne.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(Us,{variant:_t(z,ne).variant,class:e.normalizeClass([_t(z,ne).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_t(z,ne).label),1)]),_:2},1032,["variant","class"])],2)):ne.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*h.value+W+1),1)],64)):ne.type==="date"||ne.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(ie(z,ne.key)?e.unref(o_)(ie(z,ne.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(ne.format?ne.format(ie(z,ne.key)):ie(z,ne.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",oS,[e.renderSlot(V.$slots,"actions",{row:z,buttons:Ne(z),getButtonColor:it,getIconComponent:U},()=>[Ne(z).length>0?(e.openBlock(),e.createElementBlock("div",rS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne(z),(ne,we)=>(e.openBlock(),e.createElementBlock("div",{key:we,class:"group relative"},[e.createVNode(He,{tooltip:ne.tooltip||ne.label,icon:ne.icon,size:"icon",rounded:ne.rounded||"sm",borderStyle:ne.borderStyle||"none",variant:ne.variant||"ghost","bg-color":it(ne,z),onClick:ze=>bA(ne,z)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),V.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",aS,[e.createElementVNode("td",{colspan:Q.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(V.$slots,"expanded-row",{row:z,index:W})],8,sS)])):e.createCommentVNode("",!0)],64))),128))])])]),!X.value&&A.value.length>0&&t.showPagination&&w.value?(e.openBlock(),e.createElementBlock("div",iS,[e.createElementVNode("div",lS,[e.createVNode(e.unref(__),{"model-value":String(h.value),"onUpdate:modelValue":L[4]||(L[4]=z=>wn(Number(z)))},{default:e.withCtx(()=>[e.createVNode(e.unref(M_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(v_),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(S_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(fe,z=>e.createVNode(e.unref(V_),{key:z,value:String(z)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),L[15]||(L[15]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",cS,[L[11]||(L[11]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",dS,e.toDisplayString(G.value),1),L[12]||(L[12]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",uS,e.toDisplayString(se.value),1),L[13]||(L[13]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",fS,e.toDisplayString(F.value),1),L[14]||(L[14]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",hS,[e.createVNode(e.unref(b_),{total:F.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":Qe,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(y_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:z})=>[e.createVNode(e.unref(k_),{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:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(B_),{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:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z,(W,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[W.type==="page"?(e.openBlock(),e.createBlock(e.unref(w_),{key:ne,value:W.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Tt),{class:"w-8 h-8 p-0 text-sm",variant:W.value===f.value?"default":"outline",disabled:W.value===f.value,onClick:we=>Qe(W.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(W.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(x_),{key:W.type,index:ne},null,8,["index"]))],64))),256)),e.createVNode(e.unref(E_),{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:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(C_),{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:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(ro,{modelValue:b.value,"onUpdate:modelValue":L[5]||(L[5]=z=>b.value=z),title:wA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(He,{variant:"outline",onClick:eu,text:"Cancel"}),e.createVNode(He,{variant:"default",onClick:yA,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",mS,[e.createElementVNode("p",pS,e.toDisplayString(CA.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(ro,{modelValue:S.value,"onUpdate:modelValue":L[7]||(L[7]=z=>S.value=z),title:((oe=N.value)==null?void 0:oe.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(He,{variant:"outline",onClick:L[6]||(L[6]=z=>S.value=!1),text:"Cancel"}),e.createVNode(He,{variant:"default",onClick:xA,text:"Save"})]),default:e.withCtx(()=>{var z,W;return[e.createElementVNode("div",gS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((z=N.value)==null?void 0:z.fieldActionCustom)||((W=N.value)==null?void 0:W.fieldActionGlobal)||[],(ne,we)=>{var ze,_e,Te;return e.openBlock(),e.createElementBlock(e.Fragment,{key:we},[ne.isHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Be(ne))},[e.createElementVNode("div",bS,[e.createVNode(Fd,{class:"flex-1 w-full",field:ne,modelValue:D.value[ne.model],"onUpdate:modelValue":tt=>D.value[ne.model]=tt},null,8,["field","modelValue","onUpdate:modelValue"]),ne.isCopyable||(ze=ne.props)!=null&&ze.isCopyable||((_e=N.value)==null?void 0:_e.action)==="showToken"||((Te=N.value)==null?void 0:Te.action)==="copyToken"?(e.openBlock(),e.createBlock(He,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:tt=>kA(ne.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function yS(){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 xS={class:"flex flex-col gap-3 w-full"},kS={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"},wS={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"},CS={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"},ES={class:"text-sm font-medium text-slate-500"},BS={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"},_S={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},SS=["onClick"],AS=["for","onDrop"],VS={class:"text-xs text-slate-500 dark:text-slate-400"},DS={key:2,class:"text-xs text-slate-400"},NS=["id","disabled","accept","onChange"],MS=e.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","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=zt.useI18n(),i=e.computed(()=>{const p=o.endpoint;if(!(p!=null&&p.apiUrl))return null;let E=p.apiUrl;if(!E.startsWith("http")&&o.baseUrl){const C=o.baseUrl.replace(/\/$/,""),w=E.startsWith("/")?E:`/${E}`;E=`${C}${w}`}return E}),l=e.computed(()=>{const p=c.value.length;return p<=1?"grid-cols-1":p===2?"grid-cols-1 md:grid-cols-2":p===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":p===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),h=async()=>{var p;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((p=o.endpointReference)!=null&&p.apiUrl)){f.value=!1;return}try{const{apiUrl:E}=nt(),C=await E(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let w=(C==null?void 0:C.data)||C;Array.isArray(w)||(w=[w]),c.value=w}catch(E){console.error("Failed to fetch dynamic document list",E)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),h()}),e.watch(()=>o.modelValue,p=>{Array.isArray(p)&&JSON.stringify(p)!==JSON.stringify(d.value)&&(d.value=JSON.parse(JSON.stringify(p)))},{deep:!0}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiUrl},(p,E)=>{p!==E&&h()}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiMethod},(p,E)=>{p!==E&&h()}),e.watch(()=>o.items,p=>{c.value=p??[],f.value=!1},{deep:!0,immediate:!0});const m=p=>{const E=p[o.itemValue]||p.id||p.typeDocument;return d.value.find(C=>C.typeDocument===E||C.idDocumentType===E||C[o.itemValue]===E)||null},g=async(p,E,C)=>{var x,b;const w=C.target,_=(x=w.files)==null?void 0:x[0];if(!_)return;const B=p[o.itemValue]||p.id||p.typeDocument;if(p[o.itemTitle]||p.name||p.filename,!i.value){const S=[...d.value],D=S.findIndex(N=>N.typeDocument===B||N.idDocumentType===B),M={id:null,idDocument:null,idDocumentType:B,filename:_.name,document:_.name,typeDocument:B};D>-1?S[D]={...S[D],...M}:S.push(M),d.value=S,r("update:modelValue",S);return}u.value.add(E);try{const{apiUrl:S}=nt(),D=new FormData;D.append("doc",_),D.append("typeDocument",String(B));const M=await S(i.value,((b=o.endpoint)==null?void 0:b.apiMethod)||"POST",D),N=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,P=(N==null?void 0:N.url)||(N==null?void 0:N.document)||_.name,T=(N==null?void 0:N.id)||null,K=(N==null?void 0:N.filename)||(N==null?void 0:N.name)||_.name,$=[...d.value],H=$.findIndex(q=>q.typeDocument===B||q.idDocumentType===B),ee={...N||{},id:T,idDocument:T,idDocumentType:B,filename:K,document:P,typeDocument:B};H>-1?$[H]={...$[H],...ee}:$.push(ee),d.value=$,r("update:modelValue",$),r("uploaded",N),r("success",N)}catch(S){console.error("Upload failed",S)}finally{u.value.delete(E),w.value=""}},y=p=>{const E=p[o.itemValue]||p.id||p.typeDocument,C=d.value.filter(w=>w.typeDocument!==E&&w.idDocumentType!==E);d.value=C,r("update:modelValue",C)},k=(p,E,C)=>{var B,x;C.preventDefault();const w=(x=(B=C.dataTransfer)==null?void 0:B.files)==null?void 0:x[0];if(!w)return;g(p,E,{target:{files:[w],value:""}})};return(p,E)=>(e.openBlock(),e.createElementBlock("div",xS,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(ao,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",kS,[e.createVNode(ao,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),e.createElementVNode("div",wS,[e.createVNode(e.unref(ce.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",CS,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",ES,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(C,w)=>{var _;return e.openBlock(),e.createElementBlock("div",{key:w,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"},[e.createVNode(ao,{text:C[t.itemTitle]||C.name||C.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(C)?(e.openBlock(),e.createElementBlock("div",BS,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",_S,e.toDisplayString(((_=m(C))==null?void 0:_.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:B=>y(C)},[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"})],8,SS))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${w}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.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(w)?"pointer-events-none opacity-70":""]]),onDragover:E[0]||(E[0]=e.withModifiers(()=>{},["prevent"])),onDrop:B=>!t.disabled&&!u.value.has(w)&&k(C,w,B)},[u.value.has(w)?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(ce.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",VS,e.toDisplayString(u.value.has(w)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",DS,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${w}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(w),accept:t.typeFile,onChange:B=>g(C,w,B)},null,40,NS)],42,AS))])}),128))],2)]))}}),vS={key:0},PS=["value","name"],TS={key:2,class:"text-xs text-neutral-400 italic"},Hs=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=zt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Gn,DCodeAutoComplete:er,DCodeDatePicker:Lr,DCodeTextarea:so,DCodeTextArea:so,DCodeCheckbox:rn,DCodeSwitch:Hr,DCodeOtpInput:Wr,DCodeImageField:jr,DCodeSlider:Ur,DCodeRadio:vs,DCodeRadioCustom:Ps,DCodeDynamicUploadList:MS,DCodeMultiSelect:Ms,DCodeCurrencyField:Cs,DCodePermissionMenu:Os,DCodeTreePermissions:Fs,DCodeCardCheckboxList:ws,DCodeBeforeAfter:va,DCodeListLabels:Pa},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props||r.field.propsFieldGlobal||{},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=r.required!==void 0?r.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),r.error&&(f.error=r.error),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(g=>{r.formData&&r.formData[g]!=null&&(m[g]=r.formData[g])}),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),r.options&&r.options.length>0&&(f.options=r.options,f.items=r.options),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",vS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,PS)])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",TS," Unknown field: "+e.toDisplayString(t.field.component),1))}});var oa={exports:{}},OS=oa.exports,Xd;function FS(){return Xd||(Xd=1,(function(t,n){(function(o,r){t.exports=r()})(OS,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(k){return r.apply(k,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,h,m;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.filter(function(k){return r.truthy(r.apply(f,k))}):[];if(l==="map")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.map(function(k){return r.apply(f,k)}):[];if(l==="reduce")return h=r.apply(c[0],i),f=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(h)?h.reduce(function(k,p){return r.apply(f,{current:p,accumulator:k})},m):m;if(l==="all"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(!r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="none"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!0;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="some"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!0;return!1}}if(c=c.map(function(k){return r.apply(k,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),y=a;for(d=0;d<g.length;d++){if(!y.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");y=y[g[d]]}return y.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(oa)),oa.exports}var zS=FS();const ra=ji(zS),IS={class:"w-full space-y-6"},RS={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},LS={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},$S={key:0,class:"px-4 py-3"},jS={class:"text-sm font-semibold text-white"},WS={class:"px-4 py-3 flex items-center gap-2"},US={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},HS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},qS={key:2,class:"w-full"},GS={class:"space-y-6 mt-4"},XS={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},KS={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},YS={key:1,class:"text-xs text-neutral-500"},JS={key:0,class:"flex items-center gap-2"},QS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},ZS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},eA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},tA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},nA=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model"],setup(t,{emit:n}){ra.add_operation("length",I=>I==null?0:typeof I=="string"||Array.isArray(I)?I.length:typeof I=="number"?String(I).length:typeof I=="object"?Object.keys(I).length:0),ra.add_operation("==",(I,U)=>I!==null&&typeof I=="object"&&"_isLogicValue"in I?I.id==U||I.code==U:U!==null&&typeof U=="object"&&"_isLogicValue"in U?U.id==I||U.code==I:I==U),ra.add_operation("!=",(I,U)=>I!==null&&typeof I=="object"&&"_isLogicValue"in I?!(I.id==U||I.code==U):U!==null&&typeof U=="object"&&"_isLogicValue"in U?!(U.id==I||U.code==I):I!=U);const o=t,r=n,{t:a,locale:s}=zt.useI18n(),i=e.computed(()=>s.value),l=En.useRouter(),c=e.ref(!1),d=e.ref(null),u=e.computed(()=>o.schema||d.value),f=e.reactive({}),h=e.reactive({}),m=e.reactive({}),g=e.reactive({}),y=e.reactive({}),k=e.reactive({visible:!1,title:"",message:"",action:null}),p=I=>{var U,A,F;return((U=I.propsForm)==null?void 0:U.key)||((A=I.propsTable)==null?void 0:A.key)||((F=I.propsWizard)==null?void 0:F.key)||I.id||"unknown-section"},E=I=>{var F;const U=((F=I.propsWizard)==null?void 0:F.propsSteps)||[],A=i.value==="en";return U.map((G,se)=>{var v;let ie=[];if(Array.isArray(G.sectionsWizard))ie=G.sectionsWizard;else if(G.sectionsWizard&&typeof G.sectionsWizard=="object"){const Y=G.sectionsWizard;ie=[{type:Y.type||(Y.fields?"FORM":Y.isDataTable?"TABLE":"UNKNOWN"),...Y}]}return{key:G.key||`step-${se}`,title:A?G.titleEN:G.titleID,description:A?G.descriptionEN:G.descriptionID,icon:G.icon||void 0,sections:ie,actions:((v=G.propsComponent)==null?void 0:v.actionComponent)||G.actionComponent||[]}})},C=I=>I?[...I].sort((U,A)=>(U.seq||0)-(A.seq||0)):[],w=(I,U)=>{const A=I.props||I.propsFieldGlobal;if(!A)return null;const F=U==null?"":String(U);if(F==="")return null;if(A.minLength&&F.length<A.minLength)return i.value==="id"?`Minimal ${A.minLength} karakter`:`Minimum ${A.minLength} characters`;if(A.maxLength&&F.length>A.maxLength)return i.value==="id"?`Maksimal ${A.maxLength} karakter`:`Maximum ${A.maxLength} characters`;if(A.regex)try{if(!new RegExp(A.regex).test(F))return A.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${I.model}:`,A.regex)}return null},_=(I,U)=>{var F,G;f[I]=U;let A=null;(G=(F=u.value)==null?void 0:F.sections)==null||G.forEach(se=>{var Y,te;const v=(((Y=se.propsForm)==null?void 0:Y.fields)||se.fields||[]).find(de=>de.model===I);v&&(A=v),((te=se.type)==null?void 0:te.toUpperCase())==="WIZARD"&&E(se).forEach(fe=>{fe.sections.forEach(Se=>{var xe;const et=(Se.fields||((xe=Se.propsForm)==null?void 0:xe.fields)||[]).find(rt=>rt.model===I);et&&(A=et)})})}),A&&(y[I]=w(A,U)),r("update:model",q())},B=(I,U)=>{var v,Y;if(U==null)return U;let A=null;if((Y=(v=u.value)==null?void 0:v.sections)==null||Y.forEach(te=>{var Se,Pe,et;const fe=(((Se=te.propsForm)==null?void 0:Se.fields)||te.fields||((Pe=te.sectionsWizard)==null?void 0:Pe.fields)||[]).find(xe=>xe.model===I);fe&&(A=fe),te.type==="WIZARD"&&(((et=te.propsWizard)==null?void 0:et.propsSteps)||[]).forEach(rt=>{(Array.isArray(rt.sectionsWizard)?rt.sectionsWizard:[rt.sectionsWizard].filter(Boolean)).forEach(Ve=>{if(Ve.fields){const gt=Ve.fields.find(Bt=>Bt.model===I);gt&&(A=gt)}})})}),!A)return U;const F=S[A.key];if(!F||!Array.isArray(F))return U;const G=A.props||{},se=G.itemValue||G.model||"id",ie=F.find(te=>String(te[se])===String(U));return ie&&ie.code?{id:U,code:ie.code,_isLogicValue:!0}:ie&&ie.value?ie.value:U},x=e.computed(()=>{const I={};for(const U in f){const A=f[U];A!==null&&typeof A=="object"&&!Array.isArray(A)?I[U]=(A==null?void 0:A.code)??(A==null?void 0:A.id)??(A==null?void 0:A.value)??(A==null?void 0:A.key)??String(A):I[U]=B(U,A)}return I}),b=(I,U,A="LOGIC")=>{if(I==null)return!0;if(typeof I=="boolean")return I;if(typeof I=="object")try{const F=ra.apply(I,U);return A.includes("FILTER")&&console.log(`[${A}] Evaluating rule:`,JSON.stringify(I),"with data vars:",JSON.stringify(U),"=> Result:",F),F}catch(F){return console.error(`[${A}] JsonLogic error:`,F,"Rule:",I),!1}try{return!!new Function("formData",`return ${I};`)(U)}catch(F){return console.error(`[${A}] String logic error:`,F,"Rule:",I),!1}},S=e.reactive({}),D=async I=>{const U=I.props||{},A=U.endpointReference||U.endpoint;if(!(!(A!=null&&A.apiUrl)||S[I.key]))try{console.log(`[DynamicForm] Prefetching for ${I.key} from ${A.apiUrl}`);const{apiUrl:F}=nt(),G=await F(A.apiUrl,A.apiMethod||"GET",{page:1,perPage:100});let se=(G==null?void 0:G.data)||G;Array.isArray(se)||(se=se?[se]:[]),S[I.key]=se,console.log(`[DynamicForm] Prefetched ${se.length} items for ${I.key}`)}catch(F){console.error(`[DynamicForm] Failed prefetching for ${I.key}`,F),S[I.key]=[]}},M=I=>{var Y;const U=I.props||{},A=S[I.key]||U.items||U.options||[],F=`FILTER-DEBUG-${I.model}`;if(!((Y=I.logic)!=null&&Y.optionsFilterRule)||!Array.isArray(I.logic.optionsFilterRule))return A;console.log(`[${F}] Starting filter. Total items: ${A.length}`),console.log(`[${F}] Current state (normalized):`,JSON.stringify(x.value));let G=-1;const se=I.logic.optionsFilterRule.find((te,de)=>{if(!te.condition)return!0;const fe=b(te.condition,x.value,F);return fe&&(G=de),fe});if(!se)return console.log(`[${F}] No active rule matches current state. Returning all items.`),A;console.log(`[${F}] Active Rule index: ${G}. Values allowed:`,se.values);const ie=U.itemValue||U.model||"id",v=A.filter(te=>typeof te!="object"?se.values.includes(String(te))||se.values.includes(te):[ie,"code","id","value"].some(Se=>{const Pe=te[Se];return Pe==null?!1:se.values.some(et=>String(et)===String(Pe))}));return console.log(`[${F}] Filtering completed. ${A.length} -> ${v.length} items.`),v.length===0&&A.length>0&&console.warn(`[${F}] Warning: Filter resulting in 0 items. First item sample:`,JSON.stringify(A[0])),v},N=I=>{if(!I||typeof I!="object")return[];if("var"in I)return[I.var];let U=[];return Object.values(I).forEach(A=>{Array.isArray(A)?A.forEach(F=>{U=U.concat(N(F))}):typeof A=="object"&&(U=U.concat(N(A)))}),U};e.watch(()=>u.value,I=>{if(!(I!=null&&I.sections))return;const U=new Set,A=F=>{F&&["visibleRule","requiredRule","optionsFilterRule"].forEach(G=>{F[G]&&N(F[G]).forEach(se=>U.add(se))})};I.sections.forEach(F=>{var G,se,ie,v,Y,te;if(((G=F.type)==null?void 0:G.toUpperCase())==="FORM"&&((se=F.propsForm)!=null&&se.fields)&&F.propsForm.fields.forEach(de=>{var fe;A(de.logic),(fe=de.logic)!=null&&fe.optionsFilterRule&&D(de)}),((ie=F.type)==null?void 0:ie.toUpperCase())==="TABLE"&&((v=F.propsTable)!=null&&v.modelDatatable)){const de=F.propsTable.modelDatatable;(!f[de]||!Array.isArray(f[de]))&&(f[de]=[])}else if(((Y=F.type)==null?void 0:Y.toUpperCase())==="WIZARD"){const de=p(F);m[de]===void 0&&(m[de]=0),(((te=F.propsWizard)==null?void 0:te.propsSteps)||[]).forEach(Se=>{(Array.isArray(Se.sectionsWizard)?Se.sectionsWizard:[Se.sectionsWizard].filter(Boolean)).forEach(et=>{et.fields&&et.fields.forEach(xe=>{var rt;A(xe.logic),(rt=xe.logic)!=null&&rt.optionsFilterRule&&D(xe)})})})}}),I.sections.forEach(F=>{var se,ie;(((se=F.propsForm)==null?void 0:se.fields)||F.fields||[]).forEach(v=>{U.has(v.model)&&D(v)}),F.type==="WIZARD"&&(((ie=F.propsWizard)==null?void 0:ie.propsSteps)||[]).forEach(Y=>{(Array.isArray(Y.sectionsWizard)?Y.sectionsWizard:[Y.sectionsWizard].filter(Boolean)).forEach(de=>{de.fields&&de.fields.forEach(fe=>{U.has(fe.model)&&D(fe)})})})})},{immediate:!0}),e.watch(()=>o.model,I=>{I&&Object.keys(I).length>0&&(console.log("[DynamicForm] Syncing model to formData",I),Object.assign(f,I),e.nextTick(()=>{Object.keys(I).forEach(U=>{})}))},{immediate:!0,deep:!0});const P=I=>{var G;if(!I)return!0;const U=I.propsForm||I.propsTable||I.propsWizard||I.props||{},A=I.logic||U.logic||((G=I.props)==null?void 0:G.logic);if(!A)return!0;const F=A.visibleRule||A.rule;return F==null?!0:!!b(F,x.value)},T=I=>{var A,F;if((A=I.props)!=null&&A.disabled)return!0;const U=(F=I.logic)==null?void 0:F.disabledRule;return U===!1?!1:U===!0?!0:!U||typeof U=="object"&&Object.keys(U).length===0?!1:!!b(U,x.value,`DISABLED-${I.model}`)},K=I=>{var A;const U=(A=I.logic)==null?void 0:A.visibleRule;return U===!1?!1:U===!0||!U||typeof U=="object"&&Object.keys(U).length===0?!0:!!b(U,x.value,`VISIBLE-${I.model}`)},$=I=>{var F,G;const U=(F=I.logic)==null?void 0:F.requiredRule,A=((G=I.props)==null?void 0:G.required)||!1;return U===!1?!1:U===!0?!0:!U||typeof U=="object"&&Object.keys(U).length===0?A:!!b(U,x.value,`REQUIRED-${I.model}`)},H=()=>{var A;if(!((A=u.value)!=null&&A.sections))return;const I=3;let U=0;for(;U<I;){let F=!1;if(u.value.sections.forEach(G=>{var ie;(((ie=G.propsForm)==null?void 0:ie.fields)||G.fields||[]).forEach(v=>{var te;const Y=(te=v.logic)==null?void 0:te.calculateRule;if(Y&&typeof Y=="object"){const de=Object.keys(Y);if(de.length>0){const fe=de[0],Se=Y[fe],Pe=b(Se,x.value,`CALC-${fe}`);Pe!==void 0&&f[fe]!==Pe&&(f[fe]=Pe,F=!0)}}})}),!F)break;U++}},ee=e.computed(()=>{var U,A,F;if(!((U=u.value)!=null&&U.sections))return!1;if(Object.keys(h).length>0)return!0;const I=G=>{for(const se of G)if(K(se)){if($(se)){const ie=f[se.model];if(Array.isArray(ie)?ie.length===0:ie==null||ie==="")return!0}if(y[se.model])return!0}return!1};for(const G of u.value.sections){const se=((A=G.propsForm)==null?void 0:A.fields)||G.fields||[];if(I(se))return!0;if(((F=G.type)==null?void 0:F.toUpperCase())==="WIZARD"){const ie=E(G);for(const v of ie)if(I(v.sections.flatMap(Y=>Y.fields||[])))return!0}}return!1});e.watch(()=>({...f}),()=>{var A;if(!((A=u.value)!=null&&A.sections))return;H();let I=!1;const U=F=>{F.forEach(G=>{const se=G.model;K(G)||h[se]&&delete h[se]})};u.value.sections.forEach(F=>{var ie,v;const G=P(F),se=((ie=F.propsForm)==null?void 0:ie.fields)||F.fields||[];G?U(se):se.forEach(Y=>{f[Y.model]!==null&&f[Y.model]!==void 0&&(f[Y.model]=Array.isArray(f[Y.model])?[]:null,I=!0)}),((v=F.type)==null?void 0:v.toUpperCase())==="WIZARD"&&E(F).forEach(te=>{te.sections.forEach(de=>{var Se;const fe=de.fields||((Se=de.propsForm)==null?void 0:Se.fields)||[];G?fe&&U(fe):fe.forEach(Pe=>{f[Pe.model]!==null&&f[Pe.model]!==void 0&&(f[Pe.model]=Array.isArray(f[Pe.model])?[]:null,I=!0)})})})}),I&&r("update:model",q())},{deep:!0});const q=()=>{var A;if(!((A=u.value)!=null&&A.sections))return{...f};const I={},U=new Set;return u.value.sections.forEach(F=>{var se,ie,v;if(!P(F))return;if((((se=F.propsForm)==null?void 0:se.fields)||F.fields||[]).forEach(Y=>{K(Y)&&(I[Y.model]=f[Y.model],U.add(Y.model))}),((ie=F.type)==null?void 0:ie.toUpperCase())==="WIZARD"&&E(F).forEach(te=>{te.sections.forEach(de=>{var Se;(de.fields||((Se=de.propsForm)==null?void 0:Se.fields)||[]).forEach(Pe=>{K(Pe)&&(I[Pe.model]=f[Pe.model],U.add(Pe.model))})})}),(v=F.propsTable)!=null&&v.modelDatatable){const Y=F.propsTable.modelDatatable;f[Y]!==void 0&&(I[Y]=f[Y],U.add(Y))}}),["id","_id"].forEach(F=>{f[F]!==void 0&&!U.has(F)&&(I[F]=f[F])}),I},R=(I,U)=>{const A={},F=[];if(Object.keys(U).forEach(G=>{const se=U[G];if(typeof se=="string"){const ie=G,v=se;I[ie]!==void 0&&(A[v]=I[ie])}else if(Array.isArray(se)&&se.length>0&&typeof se[0]=="object"){const ie=G,v=se[0],Y=Object.keys(v);let te=null;Array.isArray(I[ie])&&(te=I[ie]),te?(console.log(`%c[MAPPING] Mapping array '${ie}'`,"color: #3b82f6; font-weight: bold;"),A[ie]=te.map(de=>{const fe={};return Y.forEach(Se=>{const Pe=Se,et=v[Se];de[Pe]!==void 0&&(fe[et]=de[Pe])}),fe})):(F.push(ie),A[ie]=[])}}),F.length>0){const G=F.join(", "),se=i.value==="id"?`Kesalahan Pemetaan: Data sumber tidak ditemukan untuk field (${G}). Harap periksa skema atau hubungi tim teknis.`:`Mapping Error: Source data not found for fields (${G}). Please check the schema or contact technical team.`;We.error(se,{autoClose:5e3,position:We.POSITION.TOP_RIGHT}),console.warn(`[MAPPING-ERROR] ${se}`)}return A},j=I=>{var U,A,F,G;if(I.requireConfirm){const se=i.value==="id";k.title=se?((U=I.propCustomMessage)==null?void 0:U.titleID)||"Konfirmasi Tindakan":((A=I.propCustomMessage)==null?void 0:A.titleEN)||"Confirm Action",k.message=se?((F=I.propCustomMessage)==null?void 0:F.messageID)||"Apakah Anda yakin ingin melanjutkan tindakan ini?":((G=I.propCustomMessage)==null?void 0:G.messageEN)||"Are you sure you want to proceed with this action?",k.action=I,k.visible=!0;return}Z(I)},ae=()=>{const I=k.action;k.visible=!1,I&&Z(I)},Z=async I=>{const U=q(),A=I.propsActionGlobal||I.props||{},F=A.fieldMapping||I.fieldMapping||{};let G={};F&&typeof F=="object"&&Object.keys(F).length>0?G=R(U,F):G={...U},console.log("%c[SUBMIT-ACTION-PAYLOAD]","color: #10b981; font-weight: bold;",G),r("action",I,G);const se=!!(A.endpointPropAction||I.endpointPropAction);if(I.permission==="CREATE"||I.permission==="UPDATE"||A.type==="SUBMIT"||A.key==="submit"){c.value=!0;try{se||r("submit",G)}finally{se||(c.value=!1)}}A.keyRedirect&&A.route&&l&&l.push(A.route)},J=()=>{var U;if(!((U=u.value)!=null&&U.sections))return!0;let I=!0;return u.value.sections.forEach(A=>{var G,se;if(!P(A))return;(((G=A.propsForm)==null?void 0:G.fields)||A.fields||[]).forEach(ie=>{if(K(ie)){const v=w(ie,f[ie.model]);v&&(h[ie.model]=v,I=!1)}}),((se=A.type)==null?void 0:se.toUpperCase())==="WIZARD"&&E(A).forEach(ie=>{ie.sections.forEach(v=>{(v.fields||[]).forEach(te=>{if(K(te)){const de=w(te,f[te.model]);de&&(h[te.model]=de,I=!1)}})})})}),I},le=async()=>{if(!J()){console.warn("[DynamicForm] Submit blocked by validation errors",h);return}c.value=!0;try{const I=q();r("submit",I)}finally{c.value=!1}},ue=()=>{r("cancel")},Ce=I=>I.permission?o.isEditMode?I.permission!=="CREATE":I.permission!=="UPDATE":!0,Be=I=>{const U=I.modelDatatable;if(!U)return[];const A=f[U];return Array.isArray(A)?A:[]},me=e.ref(!1),Q=e.ref(""),O=e.ref("Plus"),X=e.ref([]),re=e.reactive({}),be=e.reactive({}),Ee=e.ref(""),Fe=e.ref(null),Re=e.ref(null),Ye=(I,U)=>{re[I]=U;const A=X.value.find(F=>F.model===I);if(A){const F=be,G=w(A,U);G?F[I]=G:delete F[I]}},Ne=(I,U)=>{var F,G,se;Ee.value=I.modelDatatable||"",Re.value=U,Fe.value=null,Q.value=i.value==="id"?U.labelID||((F=U.propsActionGlobal)==null?void 0:F.labelID)||"Tambah Data":U.labelEN||((G=U.propsActionGlobal)==null?void 0:G.labelEN)||"Add Data",O.value=U.icon||((se=U.propsActionGlobal)==null?void 0:se.icon)||"Plus";const A=(U.fieldActionGlobal||[]).map(ie=>({...ie,props:ie.propsFieldGlobal||ie.props||{}}));X.value=A,me.value=!0,Object.keys(re).forEach(ie=>delete re[ie]),Object.keys(be).forEach(ie=>delete be[ie]),A.forEach(ie=>{re[ie.model]=null}),me.value=!0},it=(I,U)=>{var de;const{action:A,row:F}=U;if(/delete|trash|remove/i.test(A)){const fe=I.modelDatatable;if(fe&&Array.isArray(f[fe])){const Se=f[fe].indexOf(F);if(Se!==-1)f[fe].splice(Se,1);else{const Pe=JSON.stringify(F),et=f[fe].findIndex(xe=>JSON.stringify(xe)===Pe);et!==-1&&f[fe].splice(et,1)}}return}const se=I.modelDatatable||"";Ee.value=se,Q.value=i.value==="id"?"Ubah Data":"Edit Data",O.value="SquarePen";const ie=f[se],v=Array.isArray(ie)?ie.indexOf(F):-1;Fe.value=v!==-1?v:null;const te=(((de=(I.actionTableGlobal||[])[0])==null?void 0:de.fieldActionGlobal)||[]).map(fe=>({...fe,props:fe.propsFieldGlobal||fe.props||{}}));X.value=te,me.value=!0,Object.keys(re).forEach(fe=>delete re[fe]),Object.keys(be).forEach(fe=>delete be[fe]),te.forEach(fe=>{re[fe.model]=F[fe.model]??null}),me.value=!0},dt=()=>{let I=!0;if(X.value.forEach(F=>{const G=w(F,re[F.model]);G&&(be[F.model]=G,I=!1)}),!I)return;const U=Ee.value;if(!U)return;Array.isArray(f[U])||(f[U]=[]);const A={...re};Fe.value!==null?f[U].splice(Fe.value,1,A):f[U].push(A),me.value=!1};return(I,U)=>{var A,F,G,se,ie;return e.openBlock(),e.createElementBlock("div",IS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((A=u.value)==null?void 0:A.sections,(v,Y)=>{var te,de,fe,Se,Pe,et;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Y},[((te=v.type)==null?void 0:te.toUpperCase())==="FORM"&&v.propsForm&&P(v)?(e.openBlock(),e.createElementBlock("div",RS,[e.createElementVNode("div",LS,[v.propsForm.titleID||v.propsForm.titleEN?(e.openBlock(),e.createElementBlock("div",$S,[e.createElementVNode("h3",jS,e.toDisplayString(i.value==="id"?v.propsForm.titleID:v.propsForm.titleEN),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",WS,[(de=v.propsForm.actionSection)!=null&&de.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(v.propsForm.actionSection,(xe,rt)=>{var Ue,Ve,gt,Bt,_t,Ft,Qe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:rt},[Ce(xe)?(e.openBlock(),e.createBlock(He,{key:0,icon:xe.icon||((Ue=xe.propsActionGlobal)==null?void 0:Ue.icon),text:i.value==="id"?xe.labelID||((Ve=xe.propsActionGlobal)==null?void 0:Ve.labelID):xe.labelEN||((gt=xe.propsActionGlobal)==null?void 0:gt.labelEN),"bg-color":((_t=xe.bgColor||((Bt=xe.propsActionGlobal)==null?void 0:Bt.bgColor))==null?void 0:_t.toLowerCase())||"primary",variant:((Qe=xe.variant||((Ft=xe.propsActionGlobal)==null?void 0:Ft.variant))==null?void 0:Qe.toLowerCase())||"outline",size:"sm",onClick:wn=>j(xe)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),Y===0?(e.openBlock(),e.createBlock(He,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:ue},null,8,["text"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",v.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(v.propsForm.fields),xe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:xe.key},[K(xe)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([xe.column==="FULL"&&v.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Hs,{field:xe,"model-value":f[xe.model],"form-data":f,required:$(xe),options:M(xe),error:h[xe.model],"onUpdate:modelValue":rt=>_(xe.model,rt)},null,8,["field","model-value","form-data","required","options","error","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((fe=v.type)==null?void 0:fe.toUpperCase())==="TABLE"&&v.propsTable&&P(v)?(e.openBlock(),e.createElementBlock("div",US,[(Se=v.propsTable.actionTableGlobal)!=null&&Se.length?(e.openBlock(),e.createElementBlock("div",HS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.propsTable.actionTableGlobal,(xe,rt)=>{var Ue,Ve;return e.openBlock(),e.createElementBlock(e.Fragment,{key:rt},[xe.propsActionGlobal?(e.openBlock(),e.createBlock(He,{key:0,icon:xe.propsActionGlobal.icon,"bg-color":((Ue=xe.propsActionGlobal.bgColor)==null?void 0:Ue.toLowerCase())||"primary",variant:((Ve=xe.propsActionGlobal.variant)==null?void 0:Ve.toLowerCase())||"default",size:"sm",onClick:gt=>Ne(v.propsTable,xe)},null,8,["icon","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0),e.createVNode(uo,{"table-config":v.propsTable,data:Be(v.propsTable),nested:!0,"show-pagination":v.propsTable.pagination??!0,onAction:xe=>it(v.propsTable,xe)},null,8,["table-config","data","show-pagination","onAction"])])):((Pe=v.type)==null?void 0:Pe.toUpperCase())==="WIZARD"&&v.propsWizard&&P(v)?(e.openBlock(),e.createElementBlock("div",qS,[e.createVNode(Ts,{tabs:E(v),modelValue:m[p(v)],"onUpdate:modelValue":xe=>m[p(v)]=xe,"is-vertical":v.propsWizard.isVertical,"is-wizard":v.propsWizard.isWizard,"type-wizard":((et=v.propsWizard.typeWizard)==null?void 0:et.toLowerCase())||"icon",loading:c.value},e.createSlots({_:2},[e.renderList(E(v),xe=>({name:`tab-${xe.key}`,fn:e.withCtx(()=>{var rt,Ue;return[e.createElementVNode("div",GS,[xe.title||(rt=xe.actions)!=null&&rt.length?(e.openBlock(),e.createElementBlock("div",XS,[e.createElementVNode("div",null,[xe.title?(e.openBlock(),e.createElementBlock("h4",KS,e.toDisplayString(xe.title),1)):e.createCommentVNode("",!0),xe.description?(e.openBlock(),e.createElementBlock("p",YS,e.toDisplayString(xe.description),1)):e.createCommentVNode("",!0)]),(Ue=xe.actions)!=null&&Ue.length?(e.openBlock(),e.createElementBlock("div",JS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.actions,(Ve,gt)=>{var Bt,_t,Ft,Qe,wn,Ho,$n;return e.openBlock(),e.createElementBlock(e.Fragment,{key:gt},[Ce(Ve)?(e.openBlock(),e.createBlock(He,{key:0,icon:Ve.icon||((Bt=Ve.propsActionGlobal)==null?void 0:Bt.icon),text:i.value==="id"?Ve.labelID||((_t=Ve.propsActionGlobal)==null?void 0:_t.labelID):Ve.labelEN||((Ft=Ve.propsActionGlobal)==null?void 0:Ft.labelEN),"bg-color":((wn=Ve.bgColor||((Qe=Ve.propsActionGlobal)==null?void 0:Qe.bgColor))==null?void 0:wn.toLowerCase())||"primary",variant:(($n=Ve.variant||((Ho=Ve.propsActionGlobal)==null?void 0:Ho.variant))==null?void 0:$n.toLowerCase())||"tonal",size:"sm",onClick:Qd=>j(Ve)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.sections,(Ve,gt)=>{var Bt,_t,Ft;return e.openBlock(),e.createElementBlock(e.Fragment,{key:gt},[((Bt=Ve.type)==null?void 0:Bt.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",Ve.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(Ve.fields),Qe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Qe.key},[K(Qe)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([Qe.column==="FULL"&&Ve.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Hs,{field:Qe,"model-value":f[Qe.model],"form-data":f,required:$(Qe),disabled:T(Qe),options:M(Qe),error:h[Qe.model],"onUpdate:modelValue":wn=>_(Qe.model,wn)},null,8,["field","model-value","form-data","required","disabled","options","error","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((_t=Ve.type)==null?void 0:_t.toUpperCase())==="TABLE"||Ve.isDataTable?(e.openBlock(),e.createElementBlock("div",QS,[e.createVNode(uo,{"table-config":Ve.propsDataTableWizard||Ve.propsTable,data:Be(Ve.propsDataTableWizard||Ve.propsTable),nested:!0,"show-pagination":((Ft=Ve.propsDataTableWizard||Ve.propsTable)==null?void 0:Ft.pagination)??!0,onAction:Qe=>it(Ve.propsDataTableWizard||Ve.propsTable,Qe)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",ZS," Unknown section type: "+e.toDisplayString(Ve.type),1))],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),g!=null&&g.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((G=(F=u.value)==null?void 0:F.ui)==null?void 0:G.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(ie=(se=u.value)==null?void 0:se.actionGlobal)!=null&&ie.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u.value.actionGlobal,(v,Y)=>{var te,de,fe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Y},[v.propsActionGlobal&&Ce(v)?(e.openBlock(),e.createBlock(He,{key:0,icon:v.propsActionGlobal.icon,text:i.value==="id"?v.propsActionGlobal.labelID:v.propsActionGlobal.labelEN,"bg-color":((te=v.propsActionGlobal.bgColor)==null?void 0:te.toLowerCase())||"primary",variant:((de=v.propsActionGlobal.variant)==null?void 0:de.toLowerCase())||"default",loading:c.value,disabled:ee.value&&(v.permission==="CREATE"||v.permission==="UPDATE"||((fe=v.propsActionGlobal)==null?void 0:fe.key)==="submit"),onClick:Se=>j(v)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(He,{key:1,text:"Submit","bg-color":"primary",loading:c.value,disabled:ee.value,onClick:le},null,8,["loading","disabled"]))],2)),e.createVNode(ro,{modelValue:k.visible,"onUpdate:modelValue":U[1]||(U[1]=v=>k.visible=v),title:k.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(He,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:U[0]||(U[0]=v=>k.visible=!1)},null,8,["text"]),e.createVNode(He,{text:e.unref(a)("common.confirm"),onClick:ae},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",eA,e.toDisplayString(k.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(ro,{modelValue:me.value,"onUpdate:modelValue":U[3]||(U[3]=v=>me.value=v),title:Q.value,icon:O.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(He,{variant:"outline",text:"Cancel",onClick:U[2]||(U[2]=v=>me.value=!1)}),e.createVNode(He,{text:"Save",onClick:dt})]),default:e.withCtx(()=>[X.value.length?(e.openBlock(),e.createElementBlock("div",tA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,v=>(e.openBlock(),e.createElementBlock("div",{key:v.key,class:e.normalizeClass(v.column==="FULL"?"md:col-span-2":"col-span-1")},[e.createVNode(Hs,{field:v,"model-value":re[v.model],"form-data":re,error:be[v.model],"onUpdate:modelValue":Y=>Ye(v.model,Y)},null,8,["field","model-value","form-data","error","onUpdate:modelValue"])],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"])])}}}),oA={class:"w-full space-y-6 animate-pulse"},rA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},aA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",oA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",rA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.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]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),sA={class:"w-full"},iA={class:"relative mx-auto min-h-[37.5rem]"},lA={key:"content",class:"w-full"},cA={class:"mb-6"},dA={class:"text-neutral-500 dark:text-neutral-400"},uA={key:"skeleton",class:"w-full"},fA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},qs=wt(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var M,N,P,T,K,$,H,ee;const o=t,r=n,a=(N=(M=e.getCurrentInstance())==null?void 0:M.appContext)==null?void 0:N.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const q=En.useRoute();if(q&&Object.keys(q).length>0)s=q;else{const R=e.getCurrentInstance();(K=(T=(P=R==null?void 0:R.appContext)==null?void 0:P.config)==null?void 0:T.globalProperties)!=null&&K.$route&&(s=R.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:q=>{typeof window<"u"&&(typeof q=="string"?window.location.href=q:q&&q.path&&(window.location.href=q.path))},__isFallback:!0};try{const q=En.useRouter();if(q)i=q;else{const R=e.getCurrentInstance();(ee=(H=($=R==null?void 0:R.appContext)==null?void 0:$.config)==null?void 0:H.globalProperties)!=null&&ee.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=nt();let d;try{d=zt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=yS(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const q=s.path.match(/\/edit\/([^\/]+)$/);return q?q[1]:null}),m=e.ref({}),g=e.ref(null),y=e.ref(!0),k=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",E="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",C=e.ref(o.layoutCode),w=e.computed(()=>{var j;if(!g.value)return"";const q=((j=d==null?void 0:d.value)==null?void 0:j.toLowerCase())||"en";return(q==="en"||q.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(w,q=>{q&&u(q)},{immediate:!0});const _=(q,R="")=>{const j={};return!q||typeof q!="object"||Object.keys(q).forEach(ae=>{const Z=q[ae],J=R?`${R}.${ae}`:ae;Z&&typeof Z=="object"&&!Array.isArray(Z)&&!(Z instanceof Date)&&Object.assign(j,_(Z,J)),j[J]=Z}),j},B=async()=>{var q,R,j,ae,Z,J;y.value=!0;try{let le=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(le=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Ce=ue?{Authorization:`Bearer ${ue}`}:{},Be=`${p}${le}`;let me=await l(Be,"GET",null,Ce);if(!me.status||!me.data||Array.isArray(me.data)&&me.data.length===0)try{const Q=`${E}${le}`,O=await l(Q,"GET",null,Ce);if(O.status){const X=Array.isArray(O.data)?O.data[0]:O.data;X&&X.code&&(le=X.code,C.value=le,me=await l(`${p}${le}`,"GET",null,Ce))}}catch(Q){console.warn("Failed to resolve layout code via datatable",Q)}if(me.status){g.value=Array.isArray(me.data)?me.data[0]:me.data;const Q={};if((q=g.value)!=null&&q.sections&&g.value.sections.forEach(O=>{((O.propsForm||O.props||{}).fields||O.fields||[]).forEach(be=>{var Fe;const Ee=be.model||((Fe=be.props)==null?void 0:Fe.model)||be.key;Ee&&(Q[Ee]=null)})}),m.value=Q,y.value=!1,f.value&&h.value){k.value=!0;try{const O=(ae=(j=(R=g.value.sections)==null?void 0:R[0])==null?void 0:j.propsForm)==null?void 0:ae.endpointForm,X=g.value.endpointForm,re=O||X;if(re!=null&&re.apiUrl){const be=re.apiUrl,Ee=re.apiMethod||"GET",Fe=re.keyParam||[],Re={};Fe.length>0?Fe.forEach(Ne=>{Re[Ne]=h.value}):Re.id=h.value;const Ye=await c(be,Ee,Re);if(Ye.status){let Ne=Array.isArray(Ye.data)?Ye.data[0]:Ye.data;Ye.payload&&(Ne={...Ne,...Ye.payload});const it=_(Ne);m.value={...m.value,...Ne,...it}}}else if((Z=g.value.endpointGlobal)!=null&&Z.apiUrl){const be=g.value.endpointGlobal.apiUrl,Ee=g.value.endpointGlobal.apiMethod||"GET",Fe={id:h.value},Re=await c(be,Ee,Fe);if(Re.status){const Ye=Array.isArray(Re.data)?Re.data[0]:Re.data,Ne=_(Ye);m.value={...m.value,...Ye,...Ne}}}else{const be=((J=g.value.endpoint)==null?void 0:J.detailUrl)||`/api/${C.value}/detail/${h.value}`,Ee=await l(be,"GET");if(Ee.status){let Fe=Array.isArray(Ee.data)?Ee.data[0]:Ee.data;if(Ee.payload){const Ne={...Ee.payload};if(Object.keys(Ne).forEach(it=>{Fe[it]!==void 0&&Fe[it]!==null&&(Ne[it]=Fe[it])}),!("id"in Ne)&&Fe.id){const it=Object.keys(Ne).find(dt=>dt.startsWith("id")&&dt.length>2&&!Ne[dt]);it&&(Ne[it]=Fe.id)}Fe=Ne}const Re={...Fe};Object.keys(m.value).forEach(Ne=>{if(Re[Ne]===void 0||Re[Ne]===null){if(Ne.toLowerCase().startsWith("id")&&Ne.length>2){const dt=Ne.substring(2).toLowerCase(),I=Array.isArray(Ee.data)?Ee.data[0]:Ee.data,U=Object.keys(I).find(A=>A.toLowerCase()===dt);U&&I[U]&&typeof I[U]=="object"&&"id"in I[U]&&(Re[Ne]=I[U].id)}if(Ne==="idSupervisor"){const dt=Array.isArray(Ee.data)?Ee.data[0]:Ee.data;dt.supervisorId&&(Re[Ne]=dt.supervisorId)}}});const Ye=_(Re);m.value={...m.value,...Re,...Ye}}}}catch(O){console.error("Failed to fetch record data:",O)}finally{k.value=!1}}}}catch(le){console.error("Failed to load form layout:",le),y.value=!1}},x=q=>{m.value=q,r("update:model",q)},b=async q=>{var R,j,ae;try{const Z=(ae=(j=(R=g.value.sections)==null?void 0:R[0])==null?void 0:j.propsForm)==null?void 0:ae.endpointForm,J=g.value.endpointGlobal||g.value.endpoint,le=(Z==null?void 0:Z.submitUrl)||(J==null?void 0:J.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(Z==null?void 0:Z.submitMethod)||(J==null?void 0:J.submitMethod)||(f.value?"PUT":"POST"),Ce=Object.values(q).some(me=>me instanceof File||me instanceof Blob);let Be;Ce?(Be=new FormData,Object.keys(q).forEach(me=>{const Q=q[me];Q!=null&&(Array.isArray(Q)?Q.forEach(O=>Be.append(`${me}[]`,O)):Be.append(me,Q))})):(Be={...q},f.value&&h.value&&!Be.id&&(Be.id=h.value)),await l(le,ue,Be),r("submit-success",Be),i.back()}catch(Z){console.error("Submit failed:",Z)}},S=async(q,R,j)=>{if(q==="cancel"){D();return}const ae=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(ae)try{y.value=!0;const Z=j?{...j}:{...m.value};f.value&&R.model&&h.value&&(Z[R.model]=h.value);const J=ae.apiUrl,le=ae.apiMethod||"POST";(await c(J,le,Z)).status&&(r("action-success",q,R,Z),i.back())}catch(Z){console.error("Action failed:",Z)}finally{y.value=!1}},D=()=>{r("cancel"),i.back()};return e.onMounted(()=>{B()}),e.watch(()=>o.model,q=>{q&&Object.keys(q).length>0&&(m.value={...m.value,...q})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(q,R)=>(e.openBlock(),e.createElementBlock("div",sA,[e.createElementVNode("div",iA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!y.value&&g.value?(e.openBlock(),e.createElementBlock("div",lA,[e.createElementVNode("div",cA,[e.createElementVNode("p",dA,e.toDisplayString(g.value.description),1)]),e.createVNode(nA,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:k.value,"onUpdate:model":R[0]||(R[0]=j=>x(j)),onSubmit:b,onCancel:D,onAction:S,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):y.value?(e.openBlock(),e.createElementBlock("div",uA,[e.createVNode(aA)])):(e.openBlock(),e.createElementBlock("div",fA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9d6797b1"]]),hA={class:"h-full flex flex-col"},mA={key:1,class:"flex-1 flex items-center justify-center"},pA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Gs=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var E,C,w,_,B,x;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=nt();let i={query:{},params:{},path:""};try{const b=En.useRoute();b?i=b:(w=(C=(E=a==null?void 0:a.appContext)==null?void 0:E.config)==null?void 0:C.globalProperties)!=null&&w.$route&&(i=a.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=En.useRouter();b?l=b:(x=(B=(_=a==null?void 0:a.appContext)==null?void 0:_.config)==null?void 0:B.globalProperties)!=null&&x.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),h=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),y=async()=>{var b;f.value=!0;try{const S="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=S?{Authorization:`Bearer ${S}`}:{},M=await s(g.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(S){console.error("Gagal Menampilkan Datatable:",S)}finally{f.value=!1}},k=b=>{b.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",b.action,b)},p=b=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",b);let S=b.route;if(S||(S=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),S){const D=b.path?{code:b.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:S,query:D}),r("navigate",{route:S,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{y()}),(b,S)=>(e.openBlock(),e.createElementBlock("div",hA,[!f.value&&u.value?(e.openBlock(),e.createBlock(uo,{key:0,ref_key:"dtRef",ref:h,"api-url":g.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||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:k,onNavigate:p},{"header-actions":e.withCtx(()=>[...S[0]||(S[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",mA,[...S[1]||(S[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",pA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),Kd=e.defineCustomElement(qs),Yd=e.defineCustomElement(Gs);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",Kd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Yd));const gA=[er,xi,He,Zi,va,Pa,cd,rn,ws,Cs,Lr,ro,Sd,$r,Ad,As,Vd,Ds,jr,Ns,ao,Ms,Wr,Dd,Nd,vs,Ps,Ur,Hr,Gn,so,Td,Od,Ts,Os,Fs,Us,uo,qs,Gs],Jd={install(t,n={}){n&&Object.keys(n).length>0&&Ys(n),gA.forEach(o=>{o.name&&t.component(o.name,o)})}};he.AutoLayoutDatatable=Gs,he.AutoLayoutForm=qs,he.DCodeAutoComplete=er,he.DCodeBadge=Us,he.DCodeBeforeAfter=va,he.DCodeButton=He,he.DCodeCard=Zi,he.DCodeCardCheckboxList=ws,he.DCodeChart=cd,he.DCodeCheckbox=rn,he.DCodeCurrencyField=Cs,he.DCodeDatePicker=Lr,he.DCodeDialog=ro,he.DCodeDialogCloseBtn=Sd,he.DCodeDropzone=$r,he.DCodeFileField=Ad,he.DCodeFileResult=As,he.DCodeIconDropdown=Vd,he.DCodeImageCropperDialog=Ds,he.DCodeImageField=jr,he.DCodeImageResult=Ns,he.DCodeInfiniteAutoComplete=xi,he.DCodeLabel=ao,he.DCodeListLabels=Pa,he.DCodeMultiSelect=Ms,he.DCodeOtpInput=Wr,he.DCodePermissionMenu=Os,he.DCodeProgress=Dd,he.DCodeProgressBar=Nd,he.DCodeRadio=vs,he.DCodeRadioCustom=Ps,he.DCodeSlider=Ur,he.DCodeSwitch=Hr,he.DCodeTextField=Gn,he.DCodeTextarea=so,he.DCodeTimelineWithIcons=Td,he.DCodeTreePermissions=Fs,he.DCodeUploadFile=Od,he.DCodeWizard=Ts,he.DataTable=uo,he.DataTableComponent=uo,he.DynamicUI=Jd,he.MicroDynamicDatatable=Yd,he.MicroDynamicForm=Kd,he.cn=ve,he.default=Jd,he.setApiConfig=Ys,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
95
+ `});return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(Uo),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",pC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",gC,[t.showValue?(e.openBlock(),e.createElementBlock("div",bC,[e.createElementVNode("span",yC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",xC,e.toDisplayString(m.value),1),e.createElementVNode("span",kC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",wC,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${g.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:b,onChange:x,onMousedown:p,onMouseup:E,onTouchstart:p,onTouchend:E},null,42,CC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",EC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,k=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${w(k.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",BC,e.toDisplayString(k.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",_C,[B[1]||(B[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),AC={class:"grid gap-3"},VC={key:0,class:"ml-1 text-destructive"},DC={class:"inline-flex items-center gap-3"},NC=["id","name","aria-checked","aria-label","disabled"],MC={key:0,class:"absolute inset-0 flex items-center justify-center"},vC={class:"relative z-10 flex items-center gap-2"},PC=["id","name","aria-checked","aria-label","disabled"],TC={key:0,class:"absolute inset-0 flex items-center justify-center"},OC={name:"DCodeSwitch"},Yr=e.defineComponent({...OC,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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.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=e.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=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.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=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(e.openBlock(),e.createElementBlock("div",AC,[t.title?(e.openBlock(),e.createBlock(Uo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",VC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",DC,[e.createVNode(e.unref(ol),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(tl),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(rl),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",MC,[...h[0]||(h[0]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,NC)]),_:1}),e.createVNode(e.unref(nl),{side:"top","side-offset":8,class:e.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",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",vC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",TC,[...h[1]||(h[1]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,PC))]),_:1})])]))}}),FC=["aria-busy"],zC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},IC=["for"],RC={key:0,class:"ml-1 text-destructive"},LC={class:"relative w-full group"},$C=["id","value"],jC={key:0,class:"absolute top-1 right-2"},WC={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"},UC={key:1,class:"text-xs text-destructive"},uo=e.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(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const te=o.required,O=o["aria-required"];return te===""||te===!0||te==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:te,class:O,id:Y,required:se,"aria-required":xe,...Ae}=o;return Ae}),f=e.computed(()=>{const te=o.maxlength;let O=Number.NaN;return typeof te=="number"?O=te:typeof te=="string"&&(O=Number.parseInt(te,10)),Number.isFinite(O)&&O>0?O:-1}),h=te=>f.value>0?te.slice(0,f.value):te,m=e.computed(()=>{const te=a.modelValue;return te==null||String(te).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),b=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,te=>{const O=String(te??"");O!==b.value&&(b.value=O)});const x=e.ref(!1),p=e.ref(!1),E=te=>te.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const Y=O.toLowerCase();return Y.charAt(0).toUpperCase()+Y.slice(1)}).join(""),w=te=>{const O=te.toLowerCase(),Y=O.search(new RegExp("\\p{L}","u"));return Y<0?O:O.slice(0,Y)+O.charAt(Y).toUpperCase()+O.slice(Y+1)},C=te=>{switch(a.textCase){case"uppercase":return te.toUpperCase();case"lowercase":return te.toLowerCase();case"titlecase":return E(te);case"sentencecase":return w(te);case"none":default:return te}},_=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=te=>{if(!te)return null;const O=Array.isArray(te)?te.join(""):te;return O?new Set(O):null},k=e.computed(()=>B(a.allowChars)),y=(te,O)=>(te.lastIndex=0,te.test(O)),A=te=>{if(te===`
96
+ `)return a.valueType!=="number";if(a.valueType==="free")return!0;const O=te===" ",Y=/\d/.test(te),se=new RegExp("\\p{L}","u").test(te),xe=new RegExp("\\p{N}","u").test(te);return a.valueType==="number"?Y:a.valueType==="letter"?se||a.allowSpaces&&O:a.valueType==="letternumber"?se||xe||a.allowSpaces&&O:!0},V=te=>{let O="";for(const Y of te){const se=!!k.value&&k.value.has(Y);a.pattern&&!se&&!y(a.pattern,Y)||!se&&!A(Y)||(O+=Y)}return O},M=te=>{const O=V(te),Y=a.applyTextCaseToValue?C(O):O;return h(Y)};let D=null;const T=te=>{if(te==="")return null;if(a.valueType==="number"&&a.returnNumber){const O=te.replaceAll(`
97
+ `,""),Y=Number(O);return Number.isFinite(Y)?Y:null}return te},P=te=>{b.value=te,r("update:modelValue",T(te))},K=(te,O)=>{const Y=h(O);p.value=!0,te.value=Y,P(Y),queueMicrotask(()=>p.value=!1)},L=(te,O)=>{const Y=te.selectionStart??te.value.length,se=te.selectionEnd??te.value.length;if(f.value>0){const xe=te.value.length-(se-Y),Ae=f.value-xe;if(Ae<=0)return;O=O.slice(0,Ae)}te.setRangeText(O,Y,se,"end"),K(te,M(te.value))},G=te=>{var se;if(!D||x.value||p.value||!((se=te.inputType)!=null&&se.startsWith("insert")))return;const O=te.data;if(O==null)return;const Y=M(O);Y!==O&&(te.preventDefault(),Y.length>0&&L(D,Y))},Q=te=>{var se;if(!D||x.value||p.value)return;const O=((se=te.clipboardData)==null?void 0:se.getData("text"))??"",Y=M(O);Y!==O&&(te.preventDefault(),Y.length>0&&L(D,Y))},X=async te=>{if(!D||x.value||p.value)return;const O=te.target,Y=O.value??"",se=M(Y);if(se===Y){const xe=O.selectionStart??se.length,Ae=O.selectionEnd??se.length;K(O,se),await e.nextTick();try{O.setSelectionRange(xe,Ae)}catch{}P(se)}else{const xe=O.selectionStart??se.length,Ae=O.selectionEnd??se.length;K(O,se),await e.nextTick();try{O.setSelectionRange(xe,Ae)}catch{}}},R=()=>x.value=!0,H=()=>{if(x.value=!1,!D)return;const te=D.value??"",O=M(te);O===te?P(O):K(D,O)};e.onMounted(()=>{if(D=document.getElementById(c.value),!D)return;D.addEventListener("beforeinput",G),D.addEventListener("paste",Q),D.addEventListener("input",X),D.addEventListener("compositionstart",R),D.addEventListener("compositionend",H);const te=D.value??"",O=M(te);O===te?P(O):K(D,O)}),e.onBeforeUnmount(()=>{D&&(D.removeEventListener("beforeinput",G),D.removeEventListener("paste",Q),D.removeEventListener("input",X),D.removeEventListener("compositionstart",R),D.removeEventListener("compositionend",H),D=null)});const ae=()=>{b.value="",D&&(D.value=""),r("update:modelValue",null),r("clear")},Z=e.computed(()=>b.value.length),J=e.computed(()=>a.showCharCount?f.value>0:!1),ie=e.computed(()=>J.value&&Z.value>0),de=e.computed(()=>`${Z.value} / ${f.value}`),Ee=e.computed(()=>!!a.error),Ne=e.computed(()=>{const te=o.rows,O=typeof te=="number"?te:Number.parseInt(String(te??""),10);return Number.isFinite(O)&&O>0?O:3}),ye=e.computed(()=>({height:`${Ne.value*24+16}px`}));return(te,O)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",zC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(ye.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",RC,"*")):e.createCommentVNode("",!0)],8,IC)):e.createCommentVNode("",!0),e.createElementVNode("div",LC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:b.value},u.value,{style:`text-transform: ${_.value}; padding-right: ${g.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-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 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",Ee.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,$C),g.value?(e.openBlock(),e.createElementBlock("div",jC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ae}," ✕ ")])):e.createCommentVNode("",!0),ie.value&&!Ee.value?(e.openBlock(),e.createElementBlock("p",WC,e.toDisplayString(de.value),1)):e.createCommentVNode("",!0)]),Ee.value?(e.openBlock(),e.createElementBlock("p",UC,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,FC)),[[e.vShow,i.value]])}}),zd=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.AvatarRoot),{class:e.normalizeClass(e.unref(Fe)(e.unref(HC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Id=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Rd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),HC=cr("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"}}}),Jr=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.Separator),e.mergeProps(e.unref(o),{class:e.unref(Fe)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),qC={class:"bg-card text-card-foreground"},GC={class:"pb-6 px-3"},XC={key:0,class:"flex justify-center p-8"},KC={key:1,class:"p-8 text-center text-red-500"},YC={key:2,class:"relative"},JC={class:"space-y-6"},QC={class:"rounded-xl border bg-card text-card-foreground shadow"},ZC={class:"p-4"},eE={class:"flex items-center justify-between gap-3"},tE={class:"font-medium"},nE={class:"text-xs text-muted-foreground"},oE={class:"mt-1 text-sm text-muted-foreground"},rE={class:"text-foreground"},aE={class:"text-foreground"},sE={class:"mt-1 text-xs text-muted-foreground"},iE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},lE={class:"flex items-center justify-between gap-3"},cE={class:"font-medium"},dE={class:"text-xs text-muted-foreground"},uE={class:"mt-2 text-sm text-muted-foreground"},fE={class:"flex flex-wrap items-center justify-between gap-3"},hE={class:"flex items-center gap-3"},mE={class:"leading-tight"},pE={class:"text-sm font-medium"},gE={class:"text-xs text-muted-foreground"},bE={class:"flex items-center gap-2"},yE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},xE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},kE=["src"],wE={class:"flex-1"},CE={class:"flex items-center justify-between gap-3"},EE={class:"font-medium"},BE={class:"text-xs text-muted-foreground"},_E={class:"mt-1 text-sm text-muted-foreground"},SE={class:"text-left sm:text-center"},AE={class:"text-xs text-muted-foreground"},VE={class:"text-left sm:text-center"},DE={class:"text-xs text-muted-foreground"},NE={class:"text-left sm:text-center"},ME={class:"text-xs text-muted-foreground"},vE={class:"flex items-center justify-between gap-3"},PE={class:"font-medium"},TE={class:"text-xs text-muted-foreground"},OE={class:"mt-2 text-sm text-muted-foreground"},FE={class:"mt-3 flex items-center gap-3"},zE={class:"text-sm font-medium"},IE={class:"flex items-start justify-between gap-3"},RE={class:"font-medium"},LE={class:"mt-3 grid gap-2 text-sm"},$E={class:"flex items-center justify-between gap-3"},jE={class:"flex items-center gap-2 text-muted-foreground"},WE={class:"font-medium"},UE={class:"flex items-center justify-between gap-3"},HE={class:"flex items-center gap-2 text-muted-foreground"},qE={class:"font-medium"},GE={class:"flex items-center justify-between gap-3"},XE={class:"flex items-center gap-2 text-muted-foreground"},KE={class:"font-medium"},YE={class:"flex items-center justify-between"},JE={class:"flex items-center gap-2"},QE={class:"flex items-start justify-between gap-3"},ZE={class:"flex items-center gap-2"},eB={class:"font-medium"},tB={class:"mt-2 text-sm text-muted-foreground"},nB={key:0,class:"mt-1 text-sm text-muted-foreground"},oB={class:"flex flex-wrap items-center justify-between gap-3"},rB={class:"flex items-center gap-2"},aB={class:"text-xs text-muted-foreground"},Ld=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=et.useBreakpoints(et.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.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{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:le.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:le.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:le.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:le.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:le.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:le.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:le.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=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),b=e.resolveComponent("RefreshCcw"),x=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",qC,[h[8]||(h[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",GC,[a.value?(e.openBlock(),e.createElementBlock("div",XC,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",KC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",YC,[h[7]||(h[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",JC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",QC,[e.createElementVNode("div",ZC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",eE,[e.createElementVNode("p",tE,e.toDisplayString(p.title),1),e.createElementVNode("p",nE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",oE,[e.createElementVNode("span",rE,e.toDisplayString(p.from),1),e.createVNode(e.unref(le.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",aE,e.toDisplayString(p.to),1)]),e.createElementVNode("p",sE,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",iE,[e.createVNode(e.unref(le.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",lE,[e.createElementVNode("p",cE,e.toDisplayString(p.title),1),e.createElementVNode("p",dE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",uE,e.toDisplayString(p.desc),1),e.createVNode(e.unref(Jr),{class:"my-4"}),e.createElementVNode("div",fE,[e.createElementVNode("div",hE,[e.createVNode(e.unref(zd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Rd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Id),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",mE,[e.createElementVNode("p",pE,e.toDisplayString(p.personName),1),e.createElementVNode("p",gE,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",bE,[e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",yE,[e.createElementVNode("div",xE,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,kE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",wE,[e.createElementVNode("div",CE,[e.createElementVNode("p",EE,e.toDisplayString(p.title),1),e.createElementVNode("p",BE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",_E,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",SE,[h[1]||(h[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",AE,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",VE,[h[2]||(h[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",DE,e.toDisplayString(p.price),1)]),e.createElementVNode("div",NE,[h[3]||(h[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",ME,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",vE,[e.createElementVNode("p",PE,e.toDisplayString(p.title),1),e.createElementVNode("p",TE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",OE,e.toDisplayString(p.desc),1),e.createElementVNode("div",FE,[e.createVNode(e.unref(zd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Rd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Id),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",zE,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",IE,[e.createElementVNode("p",RE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",LE,[e.createElementVNode("div",$E,[e.createElementVNode("div",jE,[e.createVNode(e.unref(le.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",WE,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",UE,[e.createElementVNode("div",HE,[e.createVNode(e.unref(le.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",qE,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",GE,[e.createElementVNode("div",XE,[e.createVNode(e.unref(le.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",KE,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(Jr),{class:"my-4"}),e.createElementVNode("div",YE,[e.createElementVNode("div",JE,[e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(b,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",QE,[e.createElementVNode("div",ZE,[e.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",eB,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",tB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",nB,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(Jr),{class:"my-4"}),e.createElementVNode("div",oB,[e.createElementVNode("div",rB,[e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",aB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),sB={class:"dcode-upload-file"},iB={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"},lB={key:0,class:"text-xs text-gray-500 mt-1"},cB=["accept"],dB={key:1,class:"text-xs text-red-600 mt-1"},$d=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",sB,[t.label?(e.openBlock(),e.createBlock(co,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",iB,[e.createVNode(e.unref(le.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",lB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,cB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",dB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),uB=["onClick"],fB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},hB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},mB={key:1},pB={key:0,class:"text-white"},gB={key:1},bB={key:2},yB=["disabled","onClick"],xB={key:1,class:"mr-2 text-sm font-bold opacity-70"},kB={class:"whitespace-normal text-sm text-center leading-tight"},wB={class:"flex flex-col flex-1 min-w-0"},CB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},EB={class:"text-sm text-muted-foreground"},BB={class:"px-1"},_B=["disabled"],SB=["type"],AB=["disabled"],Ls=Et(e.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(t,{emit:n}){const o=t,r=n,a=st(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var k;if(typeof o.modelValue=="string"){const y=(k=o.tabs)==null?void 0:k.findIndex(A=>A.key===o.modelValue);if(y!==void 0&&y>=0)return y}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(k){var y;if(i.value=k,typeof o.modelValue=="string"){const A=(y=o.tabs)==null?void 0:y[k];A?r("update:modelValue",A.key):r("update:modelValue",k)}else r("update:modelValue",k)}}),c=e.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=e.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"?It[k]||null:k:null}const h=e.reactive({});function m(k){return h[k.key]||(h[k.key]={loaded:!1,loading:!1,data:null,error:null}),h[k.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function b(k){const y=k.endpoint||{};return{apiModule:k.apiModule||y.apiModule,apiAction:k.apiAction||y.apiAction,apiUrl:y.apiUrl,apiMethod:y.apiMethod||"GET",apiParams:k.apiParams}}function x(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const y=o.tabs[k];return!(!y||y.disabled)}async function p(k){if(typeof k.tab.fetchData=="function"){const P=await k.tab.fetchData(),K=(P==null?void 0:P.data)??P;return(K==null?void 0:K.data)??K}const y=b(k.tab);if(!(y.apiModule&&y.apiAction||y.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const V=g();let M;if(y.apiUrl)M=await s("","",V,{_url:y.apiUrl,_method:y.apiMethod,_data:y.apiParams??void 0});else{const P={...V,...y.apiParams};M=await s(y.apiModule,y.apiAction,P)}const D=(M==null?void 0:M.data)??M;return(D==null?void 0:D.data)??D}async function E(k,{force:y=!1}={}){const A=u(k),V=o.tabs[A];if(!V)return;const M=m(V);if(!(o.cache&&M.loaded&&!y)&&!M.loading){M.loading=!0,M.error=null;try{const D=await p({tabIndex:A,tab:V});M.data=D,M.loaded=!0,r("loaded",{tabIndex:A,tab:V,data:D})}catch(D){const T=typeof(D==null?void 0:D.message)=="string"&&D.message||typeof D=="string"&&D||"Failed to load tab data.";M.error=T,r("error",{tabIndex:A,tab:V,message:T})}finally{M.loading=!1}}}function w(k){const y=u(k);x(y)&&y!==l.value&&(l.value=y)}function C(k=l.value){return E(k,{force:!0})}function _(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function B(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return e.watch(()=>o.tabs,k=>{for(const y of k??[])m(y)},{immediate:!0}),e.watch(()=>l.value,async k=>{var A;const y=(A=o.tabs)==null?void 0:A[k];y&&r("change",{tabIndex:k,tab:y}),await E(k)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async k=>{k&&await E(l.value)},{immediate:!0}),(k,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("div",{key:A.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[V<l.value?"wizard-num-done":"",V===l.value?"wizard-num-active":V>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!A.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",mB,[V<l.value?(e.openBlock(),e.createElementBlock("span",pB,"✓")):(e.openBlock(),e.createElementBlock("span",gB,e.toDisplayString(V+1),1))])):(e.openBlock(),e.createElementBlock("span",bB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",V===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(A.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("div",{key:A.key,onClick:M=>w(V),style:e.normalizeStyle({zIndex:t.tabs.length-V}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[V>0?"pl-8":"",V===l.value?"wizard-step-active":V<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",fB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",hB,e.toDisplayString(A.title),1)],2),V<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[V===l.value?"wizard-svg-active":V<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...y[0]||(y[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,uB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("button",{key:A.key,type:"button",disabled:!x(V),onClick:M=>w(V),class:e.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",e.unref(Fe)("border-b border-r",!t.isVertical&&V===t.tabs.length-1&&"border-r-0",V===l.value?"wizard-btn-active":"wizard-btn-pending",!x(V)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",xB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",kB,e.toDisplayString(A.title),1)],10,yB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Jr),{key:0})),e.createElementVNode("div",wB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var A,V,M,D;return[(e.openBlock(),e.createElementBlock("div",{key:((A=d.value)==null?void 0:A.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(V=h[d.value.key])!=null&&V.loading?e.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",CB,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),y[1]||(y[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(M=h[d.value.key])==null?void 0:M.data,loaded:(D=h[d.value.key])==null?void 0:D.loaded,reload:C},()=>[e.createElementVNode("div",EB,[y[2]||(y[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",BB,"tab-"+e.toDisplayString(d.value.key),1),y[3]||(y[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:_,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,_B),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:B,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,SB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.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"},[t.loading?(e.openBlock(),e.createBlock(e.unref(le.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,AB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),VB={class:"permission-menu w-full space-y-4"},DB={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},NB={class:"flex items-center justify-between"},MB={class:"flex items-center gap-3 flex-1"},vB=["onClick"],PB={key:1,class:"w-7"},TB={key:2,class:"flex-shrink-0"},OB={class:"text-lg font-semibold flex-1"},FB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},zB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},IB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},RB=["checked","disabled","onChange"],LB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},$B={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},jB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},WB={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},UB={class:"flex items-center justify-between"},HB={class:"flex items-center gap-3 flex-1"},qB={key:0,class:"flex-shrink-0"},GB={class:"text-base font-semibold flex-1"},XB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},KB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},YB=["checked","onChange"],JB={class:"text-xs font-medium"},QB={key:0,class:"p-3"},ZB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},e_=["checked","disabled","onChange"],t_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},$s=Et(e.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(t,{expose:n,emit:o}){const{t:r}=vt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(V=!0)=>{(D=>{D.forEach(T=>{T.permission.forEach(P=>{const K=`${T.id}-${P.id}-parent`,L=P.code==="VIEW"||P.name.toUpperCase()==="VIEW";l.value.has(K)||l.value.set(K,L||(V?T.checked??!1:!1))}),T.detail&&T.detail.length>0&&T.detail.forEach(P=>{P.permission.forEach(K=>{const L=`${P.id}-${K.id}-child`,G=K.code==="VIEW"||K.name.toUpperCase()==="VIEW";l.value.has(L)||l.value.set(L,G||(V?P.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(V=>{const M=V.menuId,D=V.actionsIds;i.value.forEach(T=>{T.id===M&&D.forEach(P=>{const K=`${M}-${P}-parent`;l.value.set(K,!0)}),T.detail&&T.detail.length>0&&T.detail.forEach(P=>{P.id===M&&D.forEach(K=>{const L=`${M}-${K}-child`;l.value.set(L,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(V,M)=>{M===0&&V>0&&u()});const f=V=>V.detail&&V.detail.length>0,h=V=>{c.value.has(V)?c.value.delete(V):c.value.add(V)},m=V=>c.value.has(V),g=(V,M,D=!1)=>{const T=`${V}-${M}-${D?"child":"parent"}`;return l.value.get(T)??!1},b=()=>{const V=B();s("update:modelValue",V.permissions)},x=(V,M,D,T=!1)=>{const P=D.target.checked,K=`${V}-${M}-${T?"child":"parent"}`;l.value.set(K,P),s("permission-change",V,M,P,!T),b()},p=V=>V.permission.filter(E),E=V=>V.code==="VIEW"||V.name.toUpperCase()==="VIEW",w=(V,M,D)=>{const T=D.target.checked;M.permission.forEach(P=>{if(E(P)){const L=`${M.id}-${P.id}-child`;l.value.set(L,!0);return}const K=`${M.id}-${P.id}-child`;l.value.set(K,T)}),l.value=new Map(l.value),s("menu-check",M.id,T),b()},C=(V,M=!1)=>{const D=M?V.permission:p(V);return!D||D.length===0?!1:D.every(T=>{const P=`${V.id}-${T.id}-${M?"child":"parent"}`;return l.value.get(P)??!1})},_=()=>{const V={};return i.value.forEach(M=>{var D;V[M.id]={name:M.name,parentPermissions:M.permission.map(T=>({id:T.id,name:T.name,checked:g(M.id,T.id,!1)})),children:((D=M.detail)==null?void 0:D.map(T=>({id:T.id,name:T.name,permissions:T.permission.map(P=>({id:P.id,name:P.name,checked:g(T.id,P.id,!0)}))})))||[]}}),V},B=()=>{const V=[],M=(D,T=!1)=>{const P=[];D.permission.forEach(K=>{const L=`${D.id}-${K.id}-${T?"child":"parent"}`;(l.value.get(L)??!1)&&P.push(K.id)}),P.length>0&&V.push({menuId:D.id,actionsIds:P})};return i.value.forEach(D=>{M(D,!1),D.detail&&D.detail.length>0&&D.detail.forEach(T=>{M(T,!0)})}),{permissions:V}};return n({getCurrentStates:_,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const V=[],M=(D,T=!1)=>{const P=D.permission.map(L=>{const G=`${D.id}-${L.id}-${T?"child":"parent"}`,Q=l.value.get(G)??!1;return{id:L.id,name:L.name,checked:Q}}),K=P.filter(L=>L.checked).map(L=>L.id);V.push({menuId:D.id,menuName:D.name,actionsIds:K,actions:P})};return i.value.forEach(D=>{M(D,!1),D.detail&&D.detail.length>0&&D.detail.forEach(T=>{M(T,!0)})}),{permissions:V}},permissionStates:l,expandAll:()=>{i.value.forEach(V=>{f(V)&&c.value.add(V.id)})},collapseAll:()=>{c.value.clear()}}),(V,M)=>(e.openBlock(),e.createElementBlock("div",VB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(D)}])},[e.createElementVNode("div",DB,[e.createElementVNode("div",NB,[e.createElementVNode("div",MB,[f(D)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:T=>h(D.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(D.id)?(e.openBlock(),e.createBlock(e.unref(le.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(le.ChevronRight),{key:1,class:"w-5 h-5"}))],8,vB)):(e.openBlock(),e.createElementBlock("div",PB)),t.showIcons&&D.icon?(e.openBlock(),e.createElementBlock("span",TB,[e.createElementVNode("i",{class:e.normalizeClass([D.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",OB,e.toDisplayString(D.name),1)])])]),D.permission&&D.permission.length>0&&!f(D)?(e.openBlock(),e.createElementBlock("div",FB,[e.createElementVNode("h4",zB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",IB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(D),T=>(e.openBlock(),e.createElementBlock("label",{key:T.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:E(T)||g(D.id,T.id,!1),disabled:E(T),onChange:P=>x(D.id,T.id,P,!1),class:e.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",E(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,RB),e.createElementVNode("span",LB,e.toDisplayString(T.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[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:e.withCtx(()=>[f(D)&&m(D.id)?(e.openBlock(),e.createElementBlock("div",$B,[e.createElementVNode("h4",jB,[M[0]||(M[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.detail,T=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[e.createElementVNode("div",WB,[e.createElementVNode("div",UB,[e.createElementVNode("div",HB,[t.showIcons&&T.icon?(e.openBlock(),e.createElementBlock("span",qB,[e.createElementVNode("i",{class:e.normalizeClass([T.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",GB,e.toDisplayString(T.name),1),T.path?(e.openBlock(),e.createElementBlock("span",XB,e.toDisplayString(T.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",KB,[e.createElementVNode("input",{type:"checkbox",checked:C(T,!0),onChange:P=>w(D,T,P),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,YB),e.createElementVNode("span",JB,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),T.permission&&T.permission.length>0?(e.openBlock(),e.createElementBlock("div",QB,[e.createElementVNode("div",ZB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.permission,P=>(e.openBlock(),e.createElementBlock("label",{key:P.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"},[e.createElementVNode("input",{type:"checkbox",checked:E(P)||g(T.id,P.id,!0),disabled:E(P),onChange:K=>x(T.id,P.id,K,!0),class:e.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",E(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,e_),e.createElementVNode("span",t_,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),n_={class:"space-y-4"},o_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},r_={key:0,class:"text-danger-500"},a_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},s_={class:"text-neutral-600 dark:text-neutral-400"},i_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},l_={class:"text-neutral-500 dark:text-neutral-400"},c_={key:3,class:"space-y-3"},d_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},u_={class:"flex items-center gap-3"},f_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},h_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},m_={class:"flex items-center gap-2 text-sm font-medium"},p_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},g_={class:"p-4"},b_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},y_={class:"ml-2 flex-1 min-w-0"},x_=["for"],k_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},w_={key:4,class:"mt-1 text-xs text-danger-600"},js=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=vt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(E=>({menuId:E.menuId,module:E.module,label:E.label||E.module,permissions:E.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const E={};return p.forEach(w=>{const C=w.key,_=C&&C.includes(".")?C.split(".")[0]:"other";E[_]||(E[_]={menuId:0,module:_,label:_,permissions:[]}),E[_].permissions.push({id:w.id,key:w.key,label:w.label,description:w.description})}),Object.values(E)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const E=[],w=(C,_="")=>{const B=_?`${_}.${C.name}`:C.name,k=B.toLowerCase().replace(/\s+/g,"_"),y=[];if(C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{y.push(A.id)}),C.permission&&C.permission.length>0){const A=C.permission.map(V=>({id:V.id,key:`${k}.${V.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${V.name} ${C.name}`,description:`Permission to ${V.name.toLowerCase()} ${C.name.toLowerCase()}`}));E.push({menuId:C.id,module:k,label:C.name,permissions:A,subMenuIds:y.length>0?y:void 0})}C.detail&&Array.isArray(C.detail)&&C.detail.forEach(A=>{w(A,B)})};return p.forEach(C=>w(C)),E}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const E=u(p);i.value=E;const w={},C=[],_={};E.forEach(k=>{k.permissions.forEach(y=>{const A=typeof y.id=="string"?parseInt(y.id):y.id;_[A]=k.menuId})});const B=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(y=>B.add(y))}),E.forEach(k=>k.permissions.forEach(y=>{const A=typeof y.id=="string"?parseInt(y.id):y.id;w[A]=B.has(A)})),l.value=w,c.value=C,d.value=_}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(E=>{const w=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[w]}).length,m=p=>p.permissions.every(E=>{const w=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[w]}),g=p=>{const E=h(p);return E>0&&E<p.permissions.length},b=e.ref(!1),x=(p,E)=>{b.value=!0,p.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),p.permissions.forEach(_=>{const B=typeof _.id=="string"?parseInt(_.id):_.id;l.value[B]=E});let w=o.modelValue?[...o.modelValue]:[],C=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(C=[...C,...p.subMenuIds],p.subMenuIds.forEach(_=>{const B=i.value.find(k=>k.menuId===_);B&&B.permissions.forEach(k=>{const y=typeof k.id=="string"?parseInt(k.id):k.id;l.value[y]=E})})),E?C.forEach(_=>{const B=i.value.find(k=>k.menuId===_);if(B){const k=B.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),y=w.findIndex(A=>A.menuId===_);y!==-1?w[y]={menuId:_,actionsIds:k}:w.push({menuId:_,actionsIds:k})}}):w=w.filter(_=>!C.includes(_.menuId)),c.value=w.map(_=>_.menuId),console.log("Full Result:",JSON.stringify(w,null,2)),r("update:modelValue",w),setTimeout(()=>{b.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const E=new Set,w=[];p.forEach(C=>{w.push(C.menuId),C.actionsIds&&Array.isArray(C.actionsIds)&&C.actionsIds.forEach(_=>E.add(_))}),Object.keys(l.value).forEach(C=>{const _=parseInt(C);l.value[_]=E.has(_)}),c.value=w}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,E)=>{if(b.value)return;if(Object.keys(p).map(C=>parseInt(C)).filter(C=>p[C]!==(E==null?void 0:E[C])).length>0){let C=o.modelValue?[...o.modelValue]:[];const _={};Object.keys(p).forEach(B=>{const k=parseInt(B);if(p[k]){const y=d.value[k];console.log(`Permission ${k} belongs to Menu ${y}`),y!==void 0&&(_[y]||(_[y]=[]),_[y].push(k))}}),Object.keys(_).forEach(B=>{const k=parseInt(B),y=_[k],A=C.findIndex(V=>V.menuId===k);A!==-1?C[A]={menuId:k,actionsIds:y}:C.push({menuId:k,actionsIds:y})}),C=C.filter(B=>_[B.menuId]&&_[B.menuId].length>0),c.value=C.map(B=>B.menuId),console.log("Result:",JSON.stringify(C,null,2)),r("update:modelValue",C)}},{deep:!0}),e.onMounted(f),(p,E)=>(e.openBlock(),e.createElementBlock("div",n_,[t.label?(e.openBlock(),e.createElementBlock("label",o_,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",r_,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",a_,[e.createVNode(e.unref(le.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",s_,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",i_,[e.createElementVNode("p",l_,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",c_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",d_,[e.createElementVNode("div",u_,[e.createVNode(hn,{modelValue:m(w),indeterminate:g(w),"onUpdate:modelValue":C=>x(w,!!C),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",f_,e.toDisplayString(w.label||w.module),1),e.createElementVNode("div",h_,e.toDisplayString(h(w))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(w.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",m_,[e.createElementVNode("div",p_,e.toDisplayString(h(w))+"/"+e.toDisplayString(w.permissions.length),1)])]),e.createElementVNode("div",g_,[e.createElementVNode("div",b_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.permissions,C=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(hn,{modelValue:l.value[typeof C.id=="string"?parseInt(C.id):C.id],"onUpdate:modelValue":_=>l.value[typeof C.id=="string"?parseInt(C.id):C.id]=_,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",y_,[e.createElementVNode("label",{for:`perm-${C.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(C.label||C.key),9,x_),C.description?(e.openBlock(),e.createElementBlock("p",k_,e.toDisplayString(C.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",w_,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),C_=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},E_=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),B_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):E_(t),__={key:0,class:"fixed inset-0 z-[100] flex justify-end"},S_={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},A_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},V_={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},D_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},N_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},M_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},v_=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(Ye,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",__,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",S_,[e.createElementVNode("div",A_,[e.createElementVNode("div",null,[e.createElementVNode("h3",V_,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",D_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Ye,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",N_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",M_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),P_={key:0},T_=["value","name"],jd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=vt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Jn,DCodeAutoComplete:rr,DCodeDatePicker:Hr,DCodeTextarea:uo,DCodeTextArea:uo,DCodeCheckbox:hn,DCodeSwitch:Yr,DCodeOtpInput:Xr,DCodeImageField:Gr,DCodeSlider:Kr},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.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,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",P_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,T_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),O_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=et.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(Fe)("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)),[[e.vModelText,e.unref(a)]])}}),F_=e.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(t,{emit:n}){const o=t,r=n,a=et.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),z_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(Fe)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),I_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(Fe)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(le.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),R_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(Fe)(e.unref(Yn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),L_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=et.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(Fe)(e.unref(Yn)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),$_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(Fe)(e.unref(Yn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(le.ChevronRightIcon))])]),_:3},16,["class"]))}}),j_=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(Fe)(e.unref(Yn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(le.ChevronRightIcon))])]),_:3},16,["class"]))}}),W_=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(Fe)(e.unref(Yn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),U_=e.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(t,{emit:n}){const o=t,r=n,a=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),H_=e.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(t,{emit:n}){const o=t,r=n,a=et.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Fe)("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",t.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:e.withCtx(()=>[e.createVNode(e.unref(K_)),e.createVNode(e.unref(we.SelectViewport),{class:e.normalizeClass(e.unref(Fe)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(X_))]),_:3},16,["class"])]),_:3}))}}),q_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},G_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(Fe)("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:e.withCtx(()=>[e.createElementVNode("span",q_,[e.createVNode(e.unref(we.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(le.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(we.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),X_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(Fe)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronDown))])]),_:3},16,["class"]))}}),K_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(Fe)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronUp))])]),_:3},16,["class"]))}}),Y_=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=et.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(Fe)("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:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(we.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),J_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),qo={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},fo={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},gt={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Q_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},Z_={dangerouslyHTMLString:!1,multiple:!0,position:qo.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},e2={rtl:!1,newestOnTop:!1,toastClassName:""},Wd={...Z_,...e2};gt.DEFAULT;var $e=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))($e||{}),Ws=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Ws||{});const t2={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},n2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},o2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},r2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Ud="Toastify--animate Toastify__none-enter";function Hd(t,n=!1){var o;let r=t2;if(!t||typeof t=="string")switch(t){case"flip":r=r2;break;case"zoom":r=o2;break;case"slide":r=n2;break}else r=t;if(n)r.enter=Ud;else if(r.enter===Ud){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function a2(t){return t.containerId||String(t.position)}const Qr="will-unmount";function s2(t=qo.TOP_RIGHT){return!!document.querySelector(`.${$e.CSS_NAMESPACE}__toast-container--${t}`)}function i2(t=qo.TOP_RIGHT){return`${$e.CSS_NAMESPACE}__toast-container--${t}`}function l2(t,n,o=!1){const r=[`${$e.CSS_NAMESPACE}__toast-container`,`${$e.CSS_NAMESPACE}__toast-container--${t}`,o?`${$e.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return mo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function c2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=$e.CSS_NAMESPACE,l=i2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Qr)),f=c||document.createElement("div"),h=document.createElement("div");h.className=l2(o,r,a),h.dataset.testid=`${$e.CSS_NAMESPACE}__toast-container--${o}`,h.id=a2(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=$e.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Us(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",Us,!1);try{Go[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Go[a],delete dt[a]}catch{}}const Go=e.reactive({});function d2(t,n){const o=document.getElementById(String(n));o&&(Go[o.id]=t)}function Hs(t,n=!0){const o=String(t);if(!Go[o])return;const r=document.getElementById(o);r&&r.classList.add(Qr),n?(f2(t),r&&r.addEventListener("animationend",Us,!1)):Us(o),Ft.items=Ft.items.filter(a=>a.containerId!==t)}function u2(t){for(const n in Go)Hs(n,t);Ft.items=[]}function qd(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...Hd(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function f2(t){for(const n in dt)if(n===t)for(const o of dt[n]||[])qd(o)}function h2(t){const n=ho().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function qs(t){return document.getElementById(t)}function m2(t){const n=qs(t.containerId);return n&&n.classList.contains(Qr)}function Gd(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function p2(t){return t?Ft.items.filter(n=>n.containerId===t).length>0:Ft.items.length>0}function g2(){if(Ft.items.length>0){const t=Ft.items.shift();Zr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const dt=e.reactive({}),Ft=e.reactive({items:[]});function ho(){const t=e.toRaw(dt);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function b2(t){return ho().find(n=>n.toastId===t)}function Zr(t,n={}){if(m2(n)){const o=qs(n.containerId);o&&o.addEventListener("animationend",Gs.bind(null,t,n),!1)}else Gs(t,n)}function Gs(t,n={}){const o=qs(n.containerId);o&&o.removeEventListener("animationend",Gs.bind(null,t,n),!1);const r=dt[n.containerId]||[],a=r.length>0;if(!a&&!s2(n.position)){const s=c2(n),i=e.createApp($2,n);n.useHandler&&n.useHandler(i),i.mount(s),d2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?_t.update(n):_t.add(t,n)})}const _t={add(t,n){const{containerId:o=""}=n;o&&(dt[o]=dt[o]||[],dt[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=dt[o])==null||r.unshift(n):(a=dt[o])==null||a.push(n),n.onOpen&&n.onOpen(Gd(n))},n.delay||0))},remove(t){if(t){const n=h2(t);if(n){const o=dt[n];let r=o.find(a=>a.toastId===t);dt[n]=o.filter(a=>a.toastId!==t),!dt[n].length&&!p2(n)&&Hs(n,!1),g2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(Gd(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){dt[n]=dt[n]||[];const o=dt[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};_t.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Ue(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Hs(t,n):u2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",_t.dismissCallback,!1),setTimeout(()=>{_t.remove(o)}))},dismiss(t){if(t){const n=ho();for(const o of n)if(o.toastId===t){qd(o,r=>{r.addEventListener("animationend",_t.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=ho();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",_t.dismissCallback,!1),_t.remove(t));break}}}},y2=e.reactive({useHandler:void 0}),Xd=e.reactive({}),ea=e.reactive({});function Kd(){return Math.random().toString(36).substring(2,9)}function x2(t){return typeof t=="number"&&!isNaN(t)}function Xs(t){return typeof t=="string"}function mo(t){return typeof t=="function"}function ta(...t){return e.mergeProps(...t)}function na(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function k2(t={}){Xd[`${$e.CSS_NAMESPACE}-default-options`]=t}function Yd(){return Xd[`${$e.CSS_NAMESPACE}-default-options`]||Wd}function w2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var oa=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(oa||{});const Jd={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:qo.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:fo.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:gt.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}},C2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:gt.DEFAULT},theme:{type:String,required:!1,default:fo.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}},E2=e.defineComponent({name:"ProgressBar",props:C2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${$e.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${$e.CSS_NAMESPACE}__progress-bar--controlled`:`${$e.CSS_NAMESPACE}__progress-bar--animated`,`${$e.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${$e.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${$e.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),B2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:fo.AUTO},type:{type:String,required:!1,default:fo.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${$e.CSS_NAMESPACE}__close-button ${$e.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.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)])])}}),ra=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function _2(t){return e.createVNode(ra,e.mergeProps(t,{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 S2(t){return e.createVNode(ra,e.mergeProps(t,{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 A2(t){return e.createVNode(ra,e.mergeProps(t,{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 V2(t){return e.createVNode(ra,e.mergeProps(t,{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 D2(){return e.createVNode("div",{class:`${$e.CSS_NAMESPACE}__spinner`},null)}const aa={info:S2,warning:_2,success:A2,error:V2,spinner:D2},N2=t=>t in aa;function M2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return aa.spinner();if(r!==!1){if(na(r))a=e.toRaw(r);else if(mo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?aa.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):Xs(r)||x2(r)?a=r:N2(n)&&(a=aa[n](i));return a}}const v2=()=>{};function P2(t,n,o=$e.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function T2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(oa.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||$e.COLLAPSE_DURATION}),i=s.done||v2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:x,onMouseleave:b}:{});function u(){const E=l.value.split(" ");h().addEventListener(Ws.ENTRANCE_ANIMATION_END,b,{once:!0});const w=_=>{const B=h();_.target===B&&(B.dispatchEvent(new Event(Ws.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",w),B.removeEventListener("animationcancel",w),a.value===oa.Enter&&_.type!=="animationcancel"&&B.classList.remove(...E))},C=()=>{const _=h();_.classList.add(...E),_.addEventListener("animationend",w),_.addEventListener("animationcancel",w)};t.pauseOnFocusLoss&&m(),C()}function f(){if(!h())return;const E=()=>{const C=h();C.removeEventListener("animationend",E),s.collapse?P2(C,i,s.collapseDuration):i()},w=()=>{const C=h();a.value=oa.Exit,C&&(C.className+=` ${c.value}`,C.addEventListener("animationend",E))};o.value||(r.value?E():setTimeout(w))}function h(){return t.toastRef.value}function m(){document.hasFocus()||x(),window.addEventListener("focus",b),window.addEventListener("blur",x)}function g(){window.removeEventListener("focus",b),window.removeEventListener("blur",x)}function b(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function x(){n.value=!1}function p(E){E&&(E.stopPropagation(),E.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const E=ho();o.value=E.findIndex(w=>w.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?x():b())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function O2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const F2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Jd,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>M2(t)),s=e.computed(()=>[`${$e.CSS_NAMESPACE}__toast`,`${$e.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${$e.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${$e.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=T2({toastRef:n,loading:o,done:()=>{_t.remove(t.toastId)},...Hd(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(O2(f)){const h=[];return f.title!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${$e.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${$e.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${$e.CSS_NAMESPACE}__toast-text`},[h])}return na(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):mo(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${$e.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${$e.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${$e.CSS_NAMESPACE}--animate-icon ${$e.CSS_NAMESPACE}__zoom-enter`].join(" ")},[na(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):mo(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(B2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),na(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):mo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(E2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),sa="vue3-toastify:url-change";let ia=0,Xo;function z2(){if(!(typeof window>"u")&&ea.lastUrl!==window.location.href){ea.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Yd().clearOnUrlChange!==!1,n=Object.values(dt).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&_t.dismiss(o.toastId);Ft.items=Ft.items.filter(o=>!t(o.toastProps))}}function I2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(sa)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(sa)),a},()=>{t.pushState=n,t.replaceState=o}}function R2(){if(typeof window>"u"||Xo)return;const t=I2(),n=()=>z2();window.addEventListener(sa,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Xo=()=>{t(),window.removeEventListener(sa,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Xo=void 0}}function L2(){Xo&&(Xo(),ea.lastUrl="")}const $2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Jd,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>dt[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(ia+=1,R2())}),e.onUnmounted(()=>{typeof window<"u"&&ia>0&&(ia-=1,ia===0&&L2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(F2,e.mergeProps({key:s},a),null)})])}});let Ks=!1;const Qd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Zd(){const t=[];return ho().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Qr)&&t.push(n)}),t}function j2(t){const n=Zd().length,o=t??0;return o>0&&n+Ft.items.length>=o}function W2(t){j2(t.limit)&&!t.updateId&&Ft.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function An(t,n,o={}){if(Ks)return;o=ta(Yd(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Kd()),o={...o,...o.type==="loading"?Qd:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=w2()),W2(o),ea.lastUrl=window.location.href,o.multiple?Ft.items.length?o.updateId&&Zr(t,o):Zr(t,o):(Ks=!0,Ue.clearAll(void 0,!1),setTimeout(()=>{Zr(t,o)},0),setTimeout(()=>{Ks=!1},390)),o.toastId}const Ue=(t,n)=>An(t,gt.DEFAULT,n);Ue.info=(t,n)=>An(t,gt.DEFAULT,{...n,type:gt.INFO}),Ue.error=(t,n)=>An(t,gt.DEFAULT,{...n,type:gt.ERROR}),Ue.warning=(t,n)=>An(t,gt.DEFAULT,{...n,type:gt.WARNING}),Ue.warn=Ue.warning,Ue.success=(t,n)=>An(t,gt.DEFAULT,{...n,type:gt.SUCCESS}),Ue.loading=(t,n)=>An(t,gt.DEFAULT,ta(n,Qd)),Ue.dark=(t,n)=>An(t,gt.DEFAULT,ta(n,{theme:fo.DARK})),Ue.remove=t=>{t?_t.dismiss(t):_t.clear()},Ue.clearAll=(t,n)=>{e.nextTick(()=>{_t.clear(t,n)})},Ue.isActive=t=>{let n=!1;return n=Zd().findIndex(o=>o.toastId===t)>-1,n},Ue.update=(t,n={})=>{setTimeout(()=>{const o=b2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Kd()},i=s.render||a;delete s.render,An(i,s.type,s)}},0)},Ue.done=t=>{Ue.update(t,{isLoading:!1,progress:1})},Ue.promise=U2;function U2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=Xs(n)?Ue.loading(n,d):Ue.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,g,b)=>{if(g==null){Ue.remove(c);return}const x={type:m,...u,...a,data:b},p=Xs(g)?{render:g}:g;return c?Ue.update(c,{...x,...p,isLoading:!1}):Ue(p.render,{...x,...p,isLoading:!1}),b},h=mo(t)?t():t;return h.then(m=>{f("success",r,m)}).catch(m=>{f("error",o,m)}),h}Ue.POSITION=qo,Ue.THEME=fo,Ue.TYPE=gt,Ue.TRANSITIONS=Q_;const H2={install(t,n={}){y2.useHandler=n.useHandler||(()=>{}),q2(n)}};typeof window<"u"&&(window.Vue3Toastify=H2);function q2(t={}){const n=ta(Wd,t);k2(n)}const G2={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:[]},X2={key:0,class:"inline-block"},Ys=Et(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?It[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return f[n.size]||f.sm}),s=e.computed(()=>{const f={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return Fe(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>Fe("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,h)=>r.value?(e.openBlock(),e.createElementBlock("div",X2,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]);var la={exports:{}},K2=la.exports,eu;function Y2(){return eu||(eu=1,(function(t,n){(function(o,r){t.exports=r()})(K2,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(x){return r.apply(x,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,h,m;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.filter(function(x){return r.truthy(r.apply(f,x))}):[];if(l==="map")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.map(function(x){return r.apply(f,x)}):[];if(l==="reduce")return h=r.apply(c[0],i),f=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(h)?h.reduce(function(x,p){return r.apply(f,{current:p,accumulator:x})},m):m;if(l==="all"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(!r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="none"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!0;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="some"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!0;return!1}}if(c=c.map(function(x){return r.apply(x,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),b=a;for(d=0;d<g.length;d++){if(!b.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");b=b[g[d]]}return b.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(la)),la.exports}var J2=Y2();const Zt=Xi(J2),Q2={class:"dcode-card animate-slide-up"},Z2={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"},eS={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},tS={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]"},nS={class:"relative w-full sm:w-64"},oS={key:0,class:"relative"},rS={class:"flex flex-col h-full"},aS={key:0,class:"flex-1 overflow-y-auto py-4"},sS={class:"grid grid-cols-1 gap-4 px-1"},iS={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"},lS={class:"flex justify-end gap-2 w-full"},cS={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},dS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},uS={class:"dcode-table w-full"},fS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},hS=["onClick"],mS={key:0,class:"flex items-center justify-center w-full"},pS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},gS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},bS={key:0,class:"px-3 py-0.5"},yS={key:1},xS=["colspan"],kS={class:"flex flex-col items-center gap-2"},wS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},CS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},ES={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},BS={key:0,class:"flex items-center justify-center"},_S={key:0,class:"px-3 py-0.5 !text-center"},SS={key:0,class:"flex items-center justify-center gap-1.5"},AS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},VS=["colspan"],DS={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"},NS={class:"flex items-center gap-4"},MS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},vS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},PS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},TS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},OS={class:"flex-shrink-0"},FS={class:"space-y-4"},zS={class:"text-gray-600 dark:text-gray-400"},IS={class:"grid grid-cols-1 gap-4 py-4 px-1"},RS={class:"flex items-end gap-2"},po=e.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(t,{expose:n,emit:o}){var iu,lu,cu,du,uu,fu;Zt.add_operation("length",S=>S==null?0:typeof S=="string"||Array.isArray(S)?S.length:typeof S=="number"?String(S).length:typeof S=="object"?Object.keys(S).length:0),Zt.add_operation("==",(S,z)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?S.id==z||S.code==z:z!==null&&typeof z=="object"&&"_isLogicValue"in z?z.id==S||z.code==S:S==z),Zt.add_operation("!=",(S,z)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?!(S.id==z||S.code==z):z!==null&&typeof z=="object"&&"_isLogicValue"in z?!(z.id==S||z.code==S):S!=z);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=st(),{locale:l}=vt.useI18n();let c={query:{},params:{},path:""};try{const S=Vn.useRoute();S?c=S:(cu=(lu=(iu=s==null?void 0:s.appContext)==null?void 0:iu.config)==null?void 0:lu.globalProperties)!=null&&cu.$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=Vn.useRouter();S?d=S:(fu=(uu=(du=s==null?void 0:s.appContext)==null?void 0:du.config)==null?void 0:uu.globalProperties)!=null&&fu.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),h=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),b=e.ref(!1),x=e.ref(0),p=e.ref({}),E=e.ref([]),w=e.ref(null),C=e.ref(!0),_=e.ref([]),B=e.ref([]),k=e.ref([]),y=e.ref(!1),A=e.ref(!1),V=e.ref({}),M=e.ref(null),D=e.ref(null),T=e.ref(null),P=e.ref([]),K=e.computed(()=>{if(q.value.length===0)return!1;const S=q.value.map(z=>{const re=te.value.find(j=>j.type==="CHECKBOX"),F=(re==null?void 0:re.keyCheckbox)||"id";return z[F]}).filter(z=>z!=null);return S.length===0?!1:S.every(z=>P.value.includes(z))}),L=e.computed(()=>{if(q.value.length===0)return!1;const S=te.value.find(j=>j.type==="CHECKBOX"),z=(S==null?void 0:S.keyCheckbox)||"id",re=q.value.map(j=>j[z]).filter(j=>j!=null),F=re.filter(j=>P.value.includes(j)).length;return F>0&&F<re.length}),G=S=>{const z=te.value.find(j=>j.type==="CHECKBOX"),re=(z==null?void 0:z.keyCheckbox)||"id",F=S[re];return F!==void 0&&P.value.includes(F)},Q=S=>{const z=te.value.find(j=>j.type==="CHECKBOX"),re=(z==null?void 0:z.keyCheckbox)||"id",F=q.value.map(j=>j[re]).filter(j=>j!=null);if(S){const j=new Set([...P.value,...F]);P.value=Array.from(j)}else P.value=P.value.filter(j=>!F.includes(j))},X=(S,z)=>{const re=te.value.find(oe=>oe.type==="CHECKBOX"),F=(re==null?void 0:re.keyCheckbox)||"id",j=S[F];j!=null&&(z?P.value.includes(j)||P.value.push(j):P.value=P.value.filter(oe=>oe!==j))};e.watch(P,S=>{var re;a("update:selection",S);const z=K.value||S.length>1;(re=B.value)!=null&&re.length&&B.value.forEach(F=>{var j;(j=F.fieldActionGlobal)!=null&&j.length&&F.fieldActionGlobal.forEach(oe=>{var De,He;const ke=F.endpoint||((De=F.propsActionGlobal)==null?void 0:De.endpointPropAction)||F.propsActionGlobal,Me=(He=ke==null?void 0:ke.keyParam)==null?void 0:He[0];(Me&&oe.model===Me||!Me&&/^(id|ids|idAuditTrail)/i.test(oe.model))&&z&&oe.model&&(V.value[oe.model]=S)})})},{deep:!0});const R=S=>Array.from({length:S}).map((z,re)=>{const F={id:re+1,no:re+1};return te.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?F[j.keyCheckbox||"id"]=re+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} ${re+1}`)}),F}),H=S=>S&&typeof S=="string"&&S.trim()?S:void 0,ae=e.computed(()=>{var S,z,re,F;return H((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiModule)||H((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiModule)||r.apiModule}),Z=e.computed(()=>{var S,z,re,F;return H((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiAction)||H((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiAction)||r.apiAction}),J=e.computed(()=>{var S,z,re,F;return H((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiMethod)||H((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiMethod)||r.apiMethod||"POST"}),ie=e.computed(()=>{var S,z,re,F;return H((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiUrl)||H((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiUrl)||r.apiUrl}),de=e.computed(()=>r.permissionBase||""),Ee=e.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,z)=>(S.seq||0)-(z.seq||0))),Ne=S=>{var oe,ke,Me;const z=(S==null?void 0:S.column)||((oe=S==null?void 0:S.props)==null?void 0:oe.column)||((ke=S==null?void 0:S.propsFieldGlobal)==null?void 0:ke.column)||((Me=S==null?void 0:S.propsFieldCustom)==null?void 0:Me.column);if(!z)return"col-span-1";const re=z.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"}[re]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${z}, returned=${j}`),j},ye=()=>{let S=null;if(r.tableConfig&&(S=r.tableConfig),S){w.value=S,S.headers&&(E.value=S.headers.map(F=>{var ke,Me,Se,De,He,Ie,qe,Nt,en,fa;if(F.key==="action"||((ke=F.custom)==null?void 0:ke.type)==="ACTION"||((Me=F.custom)==null?void 0:Me.type)==="action"){const Mt=((Se=F.custom)==null?void 0:Se.actionCustom)||((De=F.custom)==null?void 0:De.action);return Mt&&(_.value=Mt.map(zt=>{const ot=zt.propsActionCustom||zt.props||{},ha=zt.propCustomMessage||{};return{permission:zt.permission,label:l.value==="id"?ot.labelID:ot.labelEN,tooltip:l.value==="id"?ot.tooltipID||ot.labelID:ot.tooltipEN||ot.labelEN,icon:ot.icon,variant:ot.variant||"ghost",bgColor:ot.bgColor,action:ot.actionType||ot.key,route:ot.route,path:ot.path,endpoint:ot.endpointPropAction,requiredCondition:zt.requiredCondition||!1,propCustomCondition:zt.propCustomCondition||[],fieldMapping:zt.fieldMapping||ot.fieldMapping||null,openDialog:zt.openDialog||!1,fieldActionCustom:(zt.fieldActionCustom||[]).map(ma=>{const ei=ma.propsFieldCustom||ma.propsFieldGlobal||ma.props||{};return{...ma,props:{...ei,endpoint:ei.endpointComponent||ei.endpoint}}}),condition:zt.visibleRule||zt.propCustomCondition||ot.visibleRule||ot.propCustomCondition||null,requireConfirm:zt.requireConfirm||ot.requireConfirm||!1,confirmTitle:l.value==="id"?ha.titleID||ot.confirmTitleID||"Konfirmasi":ha.titleEN||ot.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?ha.messageID||ot.confirmMessageID||"Apakah Anda yakin?":ha.messageEN||ot.confirmMessageEN||"Are you sure?"}})),null}let j;const oe=((He=F.custom)==null?void 0:He.conditionBadge)||((Ie=F.custom)==null?void 0:Ie.condition);return(((qe=F.custom)==null?void 0:qe.type)==="BADGE"||((Nt=F.custom)==null?void 0:Nt.type)==="badge")&&oe&&(j=oe.map(Mt=>({value:Mt.value,label:l.value==="id"?Mt.labelID:Mt.labelEN,labelID:Mt.labelID,labelEN:Mt.labelEN,color:Mt.color||Mt.bgColor,variant:Mt.variant,logic:Mt.logic||Mt.conditionRule||null}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(en=F.custom)==null?void 0:en.type,condition:j,keyCheckbox:(fa=F.custom)==null?void 0:fa.keyCheckbox}}).filter(F=>F!==null));const z=S.filters||S.filter;z&&Array.isArray(z)&&(k.value=z.map(F=>({...F,props:F.propsFilters||F.props||{}})),k.value.forEach(F=>{p.value[F.model]=""}));const re=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",re),re&&Array.isArray(re)?(B.value=re.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,fieldMapping:F.fieldMapping||j.fieldMapping||null,visibleRule:F.visibleRule||j.visibleRule||F.propCustomCondition||j.propCustomCondition||null,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(oe=>{const ke=oe.propsFieldGlobal||oe.props||{};return{...oe,props:{...ke,endpoint:ke.endpointComponent||ke.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(C.value=S.pagination)}};e.watch(()=>r.tableConfig,()=>{ye()},{deep:!0,immediate:!0});const te=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?E.value:r.columns||[]),O=e.computed(()=>r.hasActions||_.value.length>0),Y=e.computed(()=>r.dummyMode?!1:ae.value||ie.value?b.value:r.loading),se=e.computed(()=>!!ae.value||!!ie.value),xe=e.computed(()=>[]),Ae=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!r.permissionChecker,effectivePath:de.value}),r.menuPermissions&&r.menuPermissions.length>0){const z=c.path,re=r.menuPermissions.find(F=>z.startsWith(F.path));if(re&&re.actions){const F=re.actions.find(j=>j.code===S.toUpperCase());return F?F.checked:!1}return!1}if(r.permissionChecker){const z=r.permissionChecker(de.value,S);return console.log("[DEBUG] permissionChecker result:",z),z}return xe.value.some(z=>z.code===S)},Re=(S,z)=>{if(S.condition)try{return Zt.apply(S.condition,z)}catch(ke){return console.warn("Row action jsonLogic error:",ke),!1}if(!S.visibilityCondition)return!0;const{field:re,operator:F,value:j}=S.visibilityCondition,oe=$(z,re);switch(F){case"equals":return oe===j;case"notEquals":return oe!==j;case"in":return Array.isArray(j)&&j.includes(oe);case"notIn":return Array.isArray(j)&&!j.includes(oe);case"greaterThan":return oe>j;case"lessThan":return oe<j;case"contains":return String(oe).includes(String(j));default:return!0}},Ve=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const S=B.value.filter(z=>{if(z.visibleRule)try{const F=q.value[0]||{};if(!Zt.apply(z.visibleRule,F))return!1}catch(F){console.warn("Header action visibility logic error:",F)}if(r.ignorePermissions)return!0;if(!z.permission)return console.log("[DEBUG] Action no permission, showing:",z.label),!0;if(r.checkPermission){const F=r.checkPermission(z.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(r.permissions){const F=r.permissions.includes(z.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const re=Ae(z.permission);return console.log("[DEBUG] Internal permission check:",{label:z.label,permission:z.permission,hasPerm:re}),re});return console.log("[DEBUG] Filtered header actions:",S.length),S}),je=e.computed(()=>_.value.length===0?_.value:_.value.filter(S=>r.ignorePermissions||!S.permission?!0:r.checkPermission?r.checkPermission(S.permission):r.permissions?r.permissions.includes(S.permission):Ae(S.permission))),Oe=S=>je.value.filter(z=>Re(z,S)),at=(S,z)=>{var j,oe;if(S.requiredCondition&&((j=S.propCustomCondition)==null?void 0:j.length)>0){const ke=$(z,"status"),Me=S.propCustomCondition.find(Se=>Se.value===ke);if(Me)return Me.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const re=$(z,S.colorCondition.field),F=(oe=S.colorCondition.conditions)==null?void 0:oe.find(ke=>ke.value===re);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},ut=S=>{const z=(S||"left").toLowerCase();return z==="center"?"justify-center":z==="right"?"justify-end":"justify-start"},St={ToggleLeft:le.ToggleLeft,SquarePen:le.SquarePen,Trash2:le.Trash2,Eye:le.Eye,CheckCircle:le.CheckCircle,Plus:le.Plus,Download:le.Download,RefreshCw:le.RefreshCw,Search:le.Search,SlidersHorizontal:le.SlidersHorizontal},At=S=>S?It[S]?It[S]:St[S]||null:null,q=e.computed(()=>r.dummyMode?te.value.length>0?R(10):[]:se.value?g.value.map((S,z)=>({...S,no:(f.value-1)*h.value+z+1})):W.value),ce=e.computed(()=>r.dummyMode?10:se.value?x.value:N.value.length),v=e.computed(()=>ce.value===0?0:(f.value-1)*h.value+1),U=e.computed(()=>{const S=f.value*h.value;return S>ce.value?ce.value:S}),$=(S,z)=>{if(!(!S||!z))return z in S?S[z]:z.split(".").reduce((re,F)=>re&&re[F],S)},N=e.computed(()=>{if(se.value)return[];if(!u.value)return r.data;const S=u.value.toLowerCase();return r.data.filter(z=>te.value.some(re=>{const F=$(z,re.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),I=e.computed(()=>se.value?[]:m.value.key?[...N.value].sort((z,re)=>{const F=$(z,m.value.key),j=$(re,m.value.key);if(F===j)return 0;let oe=0;return typeof F=="number"&&typeof j=="number"?oe=F-j:oe=String(F).localeCompare(String(j)),m.value.direction==="asc"?oe:-oe}):N.value),W=e.computed(()=>{if(se.value)return[];const S=(f.value-1)*h.value,z=S+h.value;return I.value.slice(S,z).map((re,F)=>({...re,no:S+F+1}))}),ne=e.computed(()=>se.value?Object.values(p.value).some(S=>!!S):!!u.value),ee=[10,25,50,100],fe=()=>{se.value&&(p.value={...p.value,keyword:u.value},f.value=1,Ce())};let Be;const _e=()=>{r.enableQuickSearch&&(clearTimeout(Be),Be=setTimeout(()=>{fe()},500))};let pe;const Le=()=>{clearTimeout(pe),pe=setTimeout(()=>{se.value&&Ce()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&se.value&&_e()});const Ce=async()=>{if(!r.dummyMode&&se.value&&!(!ae.value&&!ie.value))try{b.value=!0;const S={page:f.value,perPage:h.value,...p.value,...r.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(re=>{(S[re]===""||S[re]===null||S[re]===void 0)&&delete S[re]});let z;ae.value?z=await i(ae.value,Z.value,S):ie.value&&(z=await i(ie.value,J.value,S)),Qe(z)}catch(S){console.error("DataTable fetch error",S),b.value=!1}},Qe=S=>{console.log("DataTable handleResponseData:",S),S&&(r.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(E.value=S.columns.map(z=>({key:z.key||z.field||z.name,label:z.label||z.header||z.name,width:z.width,align:z.align||"LEFT",sortable:z.sortable!==!1,type:z.type,condition:z.condition,format:z.format}))),S.data&&Array.isArray(S.data)?(g.value=S.data,S.totalData?x.value=S.totalData:S.maxPage?x.value=S.maxPage*h.value:x.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(g.value=S,x.value=S.length):S.users?(g.value=S.users,x.value=S.users.length):S.items&&Array.isArray(S.items)?(g.value=S.items,x.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(g.value=S.list,x.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(g.value=S.rows,x.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(g.value=S.result,x.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),g.value=[],x.value=0)),b.value=!1};e.onUnmounted(()=>{clearTimeout(Be),clearTimeout(pe)});const he=()=>{Object.keys(p.value).forEach(S=>{p.value[S]=""}),u.value="",f.value=1,Ce()},tt=()=>{f.value=1,Ce()},xt=(S,z)=>{const re=$(S,z.key);let F={variant:"secondary",class:"",label:re};if(z.condition){const j=z.condition.find(oe=>{if(oe.logic||typeof oe.value=="object"&&oe.value!==null)try{const Me=oe.logic||oe.value;return Zt.apply(Me,S)}catch(Me){return console.warn("Badge logic error:",Me),!1}const ke=(Me,Se)=>Me==null||Se===void 0||Se===null?!1:typeof Me=="string"&&typeof Se=="string"?Me.toLowerCase().trim()===Se.toLowerCase().trim():Me==Se;if(ke(oe.value,re)||typeof re=="object"&&re!==null&&(ke(oe.value,re.code)||ke(oe.value,re.id)))return!0;if(z.key.includes(".")){const Se=z.key.split(".").slice(0,-1).join("."),De=$(S,Se);if(De&&typeof De=="object"&&(ke(oe.value,De.code)||ke(oe.value,De.id)))return!0}return!1});if(j){j.variant&&(F.variant=j.variant);const ke=(l.value||"en")==="id"?j.labelID:j.labelEN;if(F.label=ke||j.label||(typeof re=="object"?re.name||re.code:re),j.color||j.bgColor){const Me=(j.color||j.bgColor||"").toLowerCase(),Se=F.variant==="outline",De={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",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},He={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"},Ie={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Se?He[Me]&&(F.class=He[Me]):Ie[Me]?F.variant=Ie[Me]:De[Me]&&(F.class=De[Me])}}else F.label=typeof re=="object"?(re==null?void 0:re.name)||(re==null?void 0:re.code)||"-":re}else F.label=typeof re=="object"?(re==null?void 0:re.name)||(re==null?void 0:re.code)||"-":re;return F},ve=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),a("update:sort",m.value)},kt=S=>{S!==f.value&&(f.value=S,se.value&&Ce(),a("update:page",S))},Vt=S=>{h.value=S,f.value=1,se.value&&Ce()},Ut=S=>{const z=Math.random()*15+75;if(S.width){const re=parseInt(String(S.width));return re<100?`${Math.floor(re*(Math.random()*.2+.7))}px`:`${z}%`}return`${z}%`},Dt=()=>{u.value="",p.value={},f.value=1,Ce()},nt=S=>{var z;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const re=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${re}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){D.value=S,T.value=null,V.value={};const re=S.fieldActionGlobal||S.field||[];re.length&&re.forEach(F=>{var ke;const j=S.endpoint||((ke=S.propsActionGlobal)==null?void 0:ke.endpointPropAction)||S.propsActionGlobal,oe=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;oe&&F.model===oe||!oe&&/^(id|ids|idAuditTrail)/i.test(F.model)?V.value[F.model]=P.value:V.value[F.model]||(V.value[F.model]="")}),A.value=!0}else a("action",{action:((z=S.propsActionCustom)==null?void 0:z.key)||S.key||"create",row:null,selection:P.value})},qn=async(S,z)=>{var re,F,j,oe;if(S.requireConfirm){M.value={button:S,row:z},y.value=!0;return}if(S.openDialog){D.value=S,T.value=z,V.value={};const ke=te.value.find(De=>De.type==="CHECKBOX"),Me=(ke==null?void 0:ke.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(De=>{/^(id|ids|idAuditTrail)/i.test(De.model)?V.value[De.model]=[z[Me]]:S.action==="showToken"&&De.model==="token"?V.value[De.model]=z.token!==void 0?z.token:"":z[De.model]!==void 0?V.value[De.model]=z[De.model]:V.value[De.model]=""});const Se=S.endpoint||((re=S.propsActionGlobal)==null?void 0:re.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||((j=S.props)==null?void 0:j.endpointPropAction);if(((oe=Se==null?void 0:Se.apiMethod)==null?void 0:oe.toUpperCase())==="GET"&&Se.apiUrl){b.value=!0;const{apiUrl:De}=st(),He={};Se.keyParam&&Array.isArray(Se.keyParam)&&Se.keyParam.forEach((Ie,qe)=>{const Nt=Se.model&&qe===0?Se.model:Ie;z[Ie]!==void 0&&(He[Nt]=z[Ie])}),Object.keys(He).length===0&&z.id&&(He.id=z.id),De(Se.apiUrl,"GET",He).then(Ie=>{let qe=Ie;if(Ie&&Ie.data!==void 0?qe=Ie.data:Ie&&Ie.result!==void 0&&(qe=Ie.result),qe!=null){if(typeof qe=="string")V.value.hasOwnProperty("token")&&(V.value.token=qe);else if(typeof qe=="object"&&(qe.item&&(qe=qe.item),Array.isArray(qe)&&(qe=qe[0]||{}),Object.keys(qe).forEach(Nt=>{V.value[Nt]=qe[Nt]}),!V.value.token)){const Nt=Object.keys(qe).find(en=>en.toLowerCase().includes("token"));if(Nt)V.value.token=qe[Nt];else{const en=Object.values(qe).filter(fa=>typeof fa=="string");en.length===1&&(V.value.token=en[0])}}}A.value=!0}).catch(Ie=>{console.error("Fetch Data Failed",Ie)}).finally(()=>{b.value=!1});return}A.value=!0;return}Ko(S,z)},Ko=(S,z)=>{if(S.route){if(S.path){const j=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${j}`,S.path)}let re=S.route;re.includes(":")?re=re.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,oe)=>z[oe]||z.id||oe):z.id&&(re=`${re.replace(/\/$/,"")}/${z.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:re,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){b.value=!0;const{apiUrl:re}=st(),F=S.endpoint.apiUrl,j=S.endpoint.apiMethod||"POST",oe={},ke=S.fieldMapping;if(ke&&typeof ke=="object"){const{locale:Me}=vt.useI18n(),Se=Me.value||"en",De=[];if(Object.entries(ke).forEach(([He,Ie])=>{if(typeof Ie=="string"){const qe=$(z,He);qe!==void 0?oe[Ie]=qe:(console.warn(`[MAPPING-DEBUG] No matching source found for '${He}'`),De.push(He))}}),De.length>0){const He=Se==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Ie=Se==="id"?`Terdapat ketidaksesuaian skema pada field: ${De.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${De.join(", ")}. Please contact the development team.`;Ue.warning(`${He}: ${Ie}`,{autoClose:5e3,position:"top-right"})}}Object.keys(oe).length===0&&z.id&&(oe.id=z.id),re(F,j,oe).then(()=>{Ce(),a("action",{action:S.action||"success",row:z})}).catch(Me=>{console.error("Action Failed",Me)}).finally(()=>{b.value=!1})}else a("action",{action:S.action,row:z})},da=()=>{M.value&&(Ko(M.value.button,M.value.row),su())},au=()=>{var S,z,re;if(D.value){const F=D.value,j=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let oe=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!oe){const De=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(He=>/^(id|ids|idAuditTrail)/i.test(He.model));oe=De?De.model:"ids"}let ke=null,Me=!1;if(T.value){const Se=te.value.find(Ie=>Ie.type==="CHECKBOX"),De=(Se==null?void 0:Se.keyCheckbox)||"id",He=T.value[De];if(j!=null&&j.apiUrl){ke={...V.value};const Ie=F.fieldMapping;Ie&&typeof Ie=="object"&&Object.entries(Ie).forEach(([qe,Nt])=>{if(typeof Nt=="string"){const en=$(T.value,qe);en!==void 0&&(ke[Nt]=en)}}),ke[oe]||(ke[oe]=[He]),Me=!0}}else j!=null&&j.apiUrl&&(ke={...V.value},ke[oe]||(ke[oe]=P.value||[]),Me=!0);if(Me&&ke&&(j!=null&&j.apiUrl)){if(((z=j==null?void 0:j.apiMethod)==null?void 0:z.toUpperCase())==="GET"){A.value=!1,T.value||(P.value=[]);return}const{apiUrl:Se}=st(),De=j.apiUrl,He=j.apiMethod||"POST";Se(De,He,ke).then(()=>{A.value=!1,T.value||(P.value=[]),Ce(),a("action",{action:"success",row:null})}).catch(Ie=>{console.error("Action Failed",Ie)})}else if(T.value){const Se=te.value.find(qe=>qe.type==="CHECKBOX"),De=(Se==null?void 0:Se.keyCheckbox)||"id",He=T.value[De],Ie={...V.value};Ie[oe]||(Ie[oe]=[He]),a("action",{action:D.value.action,row:Ie}),A.value=!1}else{const Se={...V.value};Se[oe]||(Se[oe]=P.value);const De={action:((re=D.value.propsActionGlobal)==null?void 0:re.key)||D.value.key,row:Se,selection:P.value};a("action",De),A.value=!1}}},CA=S=>{const z=V.value[S];z&&B_(String(z)).then(()=>{Ue.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(re=>{console.error("Failed to copy",re)})},su=()=>{y.value=!1,M.value=null},EA=e.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),BA=e.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");n({fetchData:Ce,filters:p,resetFilters:he,handleRefresh:Dt});const ua=e.ref(""),_A=S=>{if(!S)return"";const z=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:z.apiUrl||S.apiUrl,module:z.apiModule||S.apiModule,action:z.apiAction||S.apiAction,method:z.apiMethod||S.apiMethod,params:S.apiParams,socket:z.socket||S.socketEndpoint,socketParams:S.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){ye();const S=_A(r.tableConfig);S!==ua.value&&(!ua.value&&se.value?(ua.value=S,Ce()):(ua.value=S,se.value&&Le()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{se.value&&Ce()}),e.watch(()=>r.apiParams,()=>{se.value&&Ce()},{deep:!0}),e.watch(()=>B.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const z=Ve.value;console.log("[DEBUG] visibleHeaderActions evaluated:",z.length,"items")},{deep:!0}),e.onMounted(()=>{ye(),se.value&&(r.tableConfig||(b.value=!0,Ce()))}),(S,z)=>{var re;return e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("div",Z2,[e.createElementVNode("div",eS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",tS,[e.createElementVNode("div",nS,[e.createVNode(e.unref(le.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(O_),{modelValue:u.value,"onUpdate:modelValue":z[0]||(z[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:e.withKeys(fe,["enter"])},null,8,["modelValue"])]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",oS,[e.createVNode(v_,null,{trigger:e.withCtx(()=>[e.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:e.withCtx(()=>[e.createElementVNode("div",lS,[e.renderSlot(S.$slots,"filter-footer",{fetch:Ce,reset:he})])]),default:e.withCtx(()=>[z[8]||(z[8]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",rS,[e.renderSlot(S.$slots,"filter-form",{filters:p.value},()=>[k.value.length>0?(e.openBlock(),e.createElementBlock("div",aS,[e.createElementVNode("div",sS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,(F,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(Ne(F))},[e.createVNode(jd,{field:F,modelValue:p.value[F.model],"onUpdate:modelValue":oe=>p.value[F.model]=oe},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",iS,[e.createVNode(Ye,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:he,disabled:Y.value},null,8,["disabled"]),e.createVNode(Ye,{onClick:tt,disabled:Y.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",cS)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.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:Dt,disabled:Y.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(le.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":Y.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(F,j)=>(e.openBlock(),e.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:oe=>nt(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(S.$slots,"header-actions")],2)])]),e.createElementVNode("div",dS,[e.createElementVNode("table",uS,[e.createElementVNode("thead",fS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,class:e.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:e.normalizeStyle(F.width?{width:F.width}:{}),onClick:j=>F.sortable&&ve(F.key)},[F.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",mS,[e.createVNode(hn,{"model-value":K.value,indeterminate:L.value,"onUpdate:modelValue":z[1]||(z[1]=j=>Q(!!j)),onClick:z[2]||(z[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",ut(F.align)])},[e.createElementVNode("span",null,e.toDisplayString(F.label),1)],2))],14,hS))),128)),O.value?(e.openBlock(),e.createElementBlock("th",pS,[...z[9]||(z[9]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",gS,[Y.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value,F=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${F}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,j=>{var oe,ke;return e.openBlock(),e.createElementBlock("td",{key:j.key,class:e.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.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",((oe=j.align)==null?void 0:oe.toLowerCase())==="center"?"mx-auto":"",((ke=j.align)==null?void 0:ke.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:Ut(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",bS,[...z[10]||(z[10]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):q.value.length===0?(e.openBlock(),e.createElementBlock("tr",yS,[e.createElementVNode("td",{colspan:te.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",kS,[e.createVNode(e.unref(gu.Vue3Lottie),{animationData:e.unref(G2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",wS,e.toDisplayString(ne.value?"No search results":"No data"),1),e.createElementVNode("p",CS,e.toDisplayString(ne.value?"Try changing keywords":"No data added"),1)])])],8,xS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.value,(F,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[e.createElementVNode("tr",ES,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,oe=>(e.openBlock(),e.createElementBlock("td",{key:oe.key,class:e.normalizeClass([oe.align?`text-${oe.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(S.$slots,`cell-${oe.key}`,{row:F,value:$(F,oe.key)},()=>[oe.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",BS,[e.createVNode(hn,{"model-value":G(F),"onUpdate:modelValue":ke=>X(F,!!ke),onClick:z[3]||(z[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):oe.type==="badge"||oe.type==="BADGE"||oe.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[oe.align?`justify-${oe.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(Ys,{variant:xt(F,oe).variant,class:e.normalizeClass([xt(F,oe).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(xt(F,oe).label),1)]),_:2},1032,["variant","class"])],2)):oe.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*h.value+j+1),1)],64)):oe.type==="date"||oe.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString($(F,oe.key)?e.unref(C_)($(F,oe.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(oe.format?oe.format($(F,oe.key)):$(F,oe.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",_S,[e.renderSlot(S.$slots,"actions",{row:F,buttons:Oe(F),getButtonColor:at,getIconComponent:At},()=>[Oe(F).length>0?(e.openBlock(),e.createElementBlock("div",SS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(F),(oe,ke)=>(e.openBlock(),e.createElementBlock("div",{key:ke,class:"group relative"},[e.createVNode(Ye,{tooltip:oe.tooltip||oe.label,icon:oe.icon,size:"icon",rounded:oe.rounded||"sm",borderStyle:oe.borderStyle||"none",variant:oe.variant||"ghost","bg-color":at(oe,F),onClick:Me=>qn(oe,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",AS,[e.createElementVNode("td",{colspan:te.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(S.$slots,"expanded-row",{row:F,index:j})],8,VS)])):e.createCommentVNode("",!0)],64))),128))])])]),!Y.value&&q.value.length>0&&t.showPagination&&C.value?(e.openBlock(),e.createElementBlock("div",DS,[e.createElementVNode("div",NS,[e.createVNode(e.unref(U_),{"model-value":String(h.value),"onUpdate:modelValue":z[4]||(z[4]=F=>Vt(Number(F)))},{default:e.withCtx(()=>[e.createVNode(e.unref(Y_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(J_),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(H_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(ee,F=>e.createVNode(e.unref(G_),{key:F,value:String(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),z[15]||(z[15]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",MS,[z[11]||(z[11]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",vS,e.toDisplayString(v.value),1),z[12]||(z[12]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",PS,e.toDisplayString(U.value),1),z[13]||(z[13]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",TS,e.toDisplayString(ce.value),1),z[14]||(z[14]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",OS,[e.createVNode(e.unref(F_),{total:ce.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":kt,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(z_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:F})=>[e.createVNode(e.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:opacity-50 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(W_),{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:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(j,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[j.type==="page"?(e.openBlock(),e.createBlock(e.unref(L_),{key:oe,value:j.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(jt),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:ke=>kt(j.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(I_),{key:j.type,index:oe},null,8,["index"]))],64))),256)),e.createVNode(e.unref(j_),{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:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.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:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(lo,{modelValue:y.value,"onUpdate:modelValue":z[5]||(z[5]=F=>y.value=F),title:EA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",onClick:su,text:"Cancel"}),e.createVNode(Ye,{variant:"default",onClick:da,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",FS,[e.createElementVNode("p",zS,e.toDisplayString(BA.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(lo,{modelValue:A.value,"onUpdate:modelValue":z[7]||(z[7]=F=>A.value=F),title:((re=D.value)==null?void 0:re.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",onClick:z[6]||(z[6]=F=>A.value=!1),text:"Cancel"}),e.createVNode(Ye,{variant:"default",onClick:au,text:"Save"})]),default:e.withCtx(()=>{var F,j;return[e.createElementVNode("div",IS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((F=D.value)==null?void 0:F.fieldActionCustom)||((j=D.value)==null?void 0:j.fieldActionGlobal)||[],(oe,ke)=>{var Me,Se,De;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ke},[oe.isHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Ne(oe))},[e.createElementVNode("div",RS,[e.createVNode(jd,{class:"flex-1 w-full",field:oe,modelValue:V.value[oe.model],"onUpdate:modelValue":He=>V.value[oe.model]=He},null,8,["field","modelValue","onUpdate:modelValue"]),oe.isCopyable||(Me=oe.props)!=null&&Me.isCopyable||((Se=D.value)==null?void 0:Se.action)==="showToken"||((De=D.value)==null?void 0:De.action)==="copyToken"?(e.openBlock(),e.createBlock(Ye,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:He=>CA(oe.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function tu(){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 LS={key:0},$S=["value","name"],jS={key:2,class:"text-xs text-neutral-400 italic"},Js=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=vt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,h=>{s.value=h});const i={DCodeTextField:Jn,DCodeAutoComplete:rr,DCodeDatePicker:Hr,DCodeTextarea:uo,DCodeTextArea:uo,DCodeCheckbox:hn,DCodeSwitch:Yr,DCodeOtpInput:Xr,DCodeImageField:Gr,DCodeSlider:Kr,DCodeRadio:Is,DCodeRadioCustom:Rs,DCodeDynamicUploadList:As,DCodeMultiSelect:zs,DCodeCurrencyField:Ss,DCodePermissionMenu:$s,DCodeTreePermissions:js,DCodeCardCheckboxList:_s,DCodeBeforeAfter:Fa,DCodeListLabels:za},l=e.computed(()=>{const h=r.field.component;return i[h]||null}),c=(h,m)=>{const g={label:"",placeholder:""},b=(m==null?void 0:m.labelID)||h.labelID,x=(m==null?void 0:m.labelEN)||h.labelEN;(b||x)&&(g.label=o.value==="id"?b:x);const p=(m==null?void 0:m.placeholderID)||h.placeholderID,E=(m==null?void 0:m.placeholderEN)||h.placeholderEN;return(p||E)&&(g.placeholder=o.value==="id"?p:E),g},d=(h,m)=>{var b;if(!((b=h.endpoint)!=null&&b.apiUrl))return{};const g={};return Array.isArray(h.endpoint.keyParam)&&h.endpoint.keyParam.forEach(x=>{m&&m[x]!=null&&(g[x]=m[x])}),{endpoint:{apiUrl:h.endpoint.apiUrl,apiMethod:h.endpoint.apiMethod||"GET"},...Object.keys(g).length?{apiParams:g}:{}}},u=e.computed(()=>{var x,p,E;const h=r.field.props||r.field.propsFieldGlobal||{},m={},g=c(h,r.dynamicLabels);return g.label&&(m.label=g.label),g.placeholder&&(m.placeholder=g.placeholder),m.required=r.required!==void 0?r.required:h.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(w=>{h[w]!==void 0&&h[w]!==null&&(m[w]=h[w])}),m.minLength=((x=r.dynamicLength)==null?void 0:x.minLength)??h.minLength,m.maxLength=((p=r.dynamicLength)==null?void 0:p.maxLength)??h.maxLength,h.valueType&&(m.type=h.valueType),r.error&&(m.error=r.error),Object.assign(m,d(h,r.formData)),(E=h.endpointReference)!=null&&E.apiUrl&&(m.endpointReference=h.endpointReference),r.options&&(m.options=r.options,m.items=r.options),m}),f=h=>{s.value=h,a("update:modelValue",h)};return(h,m)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",LS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,$S)])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},u.value,{modelValue:s.value,"onUpdate:modelValue":[m[0]||(m[0]=g=>s.value=g),f]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",jS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),WS={class:"w-full space-y-6"},US={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},HS={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},qS={key:0,class:"px-4 py-3"},GS={class:"text-sm font-semibold text-white"},XS={class:"px-4 py-3 flex items-center gap-2"},KS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},YS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},JS={key:2,class:"w-full"},QS={class:"space-y-6 mt-4"},ZS={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},eA={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},tA={key:1,class:"text-xs text-neutral-500"},nA={key:0,class:"flex items-center gap-2"},oA={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},rA={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},aA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},sA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},iA=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model"],setup(t,{emit:n}){Zt.add_operation("length",v=>v==null?0:typeof v=="string"||Array.isArray(v)?v.length:typeof v=="number"?String(v).length:typeof v=="object"?Object.keys(v).length:0),Zt.add_operation("==",(v,U)=>v!==null&&typeof v=="object"&&"_isLogicValue"in v?v.id==U||v.code==U:U!==null&&typeof U=="object"&&"_isLogicValue"in U?U.id==v||U.code==v:v==U),Zt.add_operation("!=",(v,U)=>v!==null&&typeof v=="object"&&"_isLogicValue"in v?!(v.id==U||v.code==U):U!==null&&typeof U=="object"&&"_isLogicValue"in U?!(U.id==v||U.code==v):v!=U);const o=t,r=n,{t:a,locale:s}=vt.useI18n(),i=e.computed(()=>s.value),l=Vn.useRouter(),c=e.ref(!1),d=e.ref(null),u=e.computed(()=>o.schema||d.value),f=e.reactive({}),h=e.reactive({}),m=e.reactive({}),g=e.reactive({}),b=e.reactive({}),x=e.reactive({visible:!1,title:"",message:"",action:null}),p=v=>{var U,$,N;return((U=v.propsForm)==null?void 0:U.key)||(($=v.propsTable)==null?void 0:$.key)||((N=v.propsWizard)==null?void 0:N.key)||v.id||"unknown-section"},E=v=>{var $;return((($=v.propsWizard)==null?void 0:$.propsSteps)||[]).filter(N=>L(N)).map((N,I)=>{var ee;let W=[];if(Array.isArray(N.sectionsWizard))W=N.sectionsWizard;else if(N.sectionsWizard&&typeof N.sectionsWizard=="object"){const fe=N.sectionsWizard;W=[{type:fe.type||(fe.fields?"FORM":fe.isDataTable?"TABLE":"UNKNOWN"),...fe}]}const ne=G(N);return{key:N.key||`step-${I}`,title:ne.title,description:ne.description,icon:N.icon||void 0,sections:W,actions:((ee=N.propsComponent)==null?void 0:ee.actionComponent)||N.actionComponent||[]}})},w=v=>v?[...v].sort((U,$)=>(U.seq||0)-($.seq||0)):[],C=(v,U)=>{var I;const $=((I=v.logic)==null?void 0:I.labelingRule)||[];if(!Array.isArray($)||$.length===0)return null;const N=U?A(U):V.value;return $.find(W=>M(W.condition,N,`LABEL-${v.model}`))||null},_=(v,U)=>{var I;const $=((I=v.logic)==null?void 0:I.lengthRule)||[];if(!Array.isArray($)||$.length===0)return null;const N=U?A(U):V.value;return $.find(W=>M(W.condition,N,`LENGTH-${v.model}`))||null},B=(v,U,$)=>{const N=v.props||v.propsFieldGlobal;if(!N)return null;const I=U==null?"":String(U);if(I==="")return null;const W=_(v,$),ne=(W==null?void 0:W.minLength)??N.minLength,ee=(W==null?void 0:W.maxLength)??N.maxLength;if(ne&&I.length<ne)return i.value==="id"?`Minimal ${ne} karakter`:`Minimum ${ne} characters`;if(ee&&I.length>ee)return i.value==="id"?`Maksimal ${ee} karakter`:`Maximum ${ee} characters`;if(N.regex)try{if(!new RegExp(N.regex).test(I))return N.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${v.model}:`,N.regex)}return null},k=(v,U)=>{var N,I;f[v]=U;let $=null;(I=(N=u.value)==null?void 0:N.sections)==null||I.forEach(W=>{var fe,Be;const ee=(((fe=W.propsForm)==null?void 0:fe.fields)||W.fields||[]).find(_e=>_e.model===v);ee&&($=ee),((Be=W.type)==null?void 0:Be.toUpperCase())==="WIZARD"&&E(W).forEach(pe=>{pe.sections.forEach(Le=>{var he;const Qe=(Le.fields||((he=Le.propsForm)==null?void 0:he.fields)||[]).find(tt=>tt.model===v);Qe&&($=Qe)})})}),$&&(b[v]=B($,U)),r("update:model",Z())},y=(v,U)=>{var ee,fe;if(U==null)return U;let $=null;if((fe=(ee=u.value)==null?void 0:ee.sections)==null||fe.forEach(Be=>{var Le,Ce,Qe;const pe=(((Le=Be.propsForm)==null?void 0:Le.fields)||Be.fields||((Ce=Be.sectionsWizard)==null?void 0:Ce.fields)||[]).find(he=>he.model===v);pe&&($=pe),Be.type==="WIZARD"&&(((Qe=Be.propsWizard)==null?void 0:Qe.propsSteps)||[]).forEach(tt=>{(Array.isArray(tt.sectionsWizard)?tt.sectionsWizard:[tt.sectionsWizard].filter(Boolean)).forEach(ve=>{if(ve.fields){const kt=ve.fields.find(Vt=>Vt.model===v);kt&&($=kt)}})})}),!$)return U;const N=D[$.key];if(!N||!Array.isArray(N))return U;const I=$.props||{},W=I.itemValue||I.model||"id",ne=N.find(Be=>String(Be[W])===String(U));return ne&&ne.code?{id:U,code:ne.code,_isLogicValue:!0}:ne&&ne.value?ne.value:U},A=v=>{const U={};for(const $ in v){const N=v[$];N!==null&&typeof N=="object"&&!Array.isArray(N)?U[$]=(N==null?void 0:N.code)??(N==null?void 0:N.id)??(N==null?void 0:N.value)??(N==null?void 0:N.key)??String(N):U[$]=y($,N)}return U},V=e.computed(()=>A(f)),M=(v,U,$="LOGIC")=>{if(v==null)return!0;if(typeof v=="boolean")return v;if(typeof v=="object")try{const N=Zt.apply(v,U);return $.includes("FILTER")&&console.log(`[${$}] Evaluating rule:`,JSON.stringify(v),"with data vars:",JSON.stringify(U),"=> Result:",N),N}catch(N){return console.error(`[${$}] JsonLogic error:`,N,"Rule:",v),!1}try{return!!new Function("formData",`return ${v};`)(U)}catch(N){return console.error(`[${$}] String logic error:`,N,"Rule:",v),!1}},D=e.reactive({}),T=async v=>{const U=v.props||{},$=U.endpointReference||U.endpoint;if(!(!($!=null&&$.apiUrl)||D[v.key]))try{console.log(`[DynamicForm] Prefetching for ${v.key} from ${$.apiUrl}`);const{apiUrl:N}=st(),I=await N($.apiUrl,$.apiMethod||"GET",{page:1,perPage:100});let W=(I==null?void 0:I.data)||I;Array.isArray(W)||(W=W?[W]:[]),D[v.key]=W,console.log(`[DynamicForm] Prefetched ${W.length} items for ${v.key}`)}catch(N){console.error(`[DynamicForm] Failed prefetching for ${v.key}`,N),D[v.key]=[]}},P=(v,U)=>{var _e;const $=v.props||{},N=D[v.key]||$.items||$.options||[],I=`FILTER-DEBUG-${v.model}`;if(!((_e=v.logic)!=null&&_e.optionsFilterRule)||!Array.isArray(v.logic.optionsFilterRule))return N;const W=U?A(U):V.value;console.log(`[${I}] Starting filter. Total items: ${N.length}`),console.log(`[${I}] Current state (for filter):`,JSON.stringify(W));let ne=-1;const ee=v.logic.optionsFilterRule.find((pe,Le)=>{if(!pe.condition)return!0;const Ce=M(pe.condition,W,I);return Ce&&(ne=Le),Ce});if(!ee)return console.log(`[${I}] No active rule matches current state. Returning all items.`),N;console.log(`[${I}] Active Rule index: ${ne}. Values allowed:`,ee.values);const fe=$.itemValue||$.model||"id",Be=N.filter(pe=>typeof pe!="object"?ee.values.includes(String(pe))||ee.values.includes(pe):[fe,"code","id","value"].some(Qe=>{const he=pe[Qe];return he==null?!1:ee.values.some(tt=>String(tt)===String(he))}));return console.log(`[${I}] Filtering completed. ${N.length} -> ${Be.length} items.`),Be.length===0&&N.length>0&&console.warn(`[${I}] Warning: Filter resulting in 0 items. First item sample:`,JSON.stringify(N[0])),Be},K=v=>{if(!v||typeof v!="object")return[];if("var"in v)return[v.var];let U=[];return Object.values(v).forEach($=>{Array.isArray($)?$.forEach(N=>{U=U.concat(K(N))}):typeof $=="object"&&(U=U.concat(K($)))}),U};e.watch(()=>u.value,v=>{if(!(v!=null&&v.sections))return;const U=new Set,$=N=>{N&&["visibleRule","requiredRule","optionsFilterRule"].forEach(I=>{N[I]&&K(N[I]).forEach(W=>U.add(W))})};v.sections.forEach(N=>{var I,W,ne,ee,fe,Be;if(((I=N.type)==null?void 0:I.toUpperCase())==="FORM"&&((W=N.propsForm)!=null&&W.fields)&&N.propsForm.fields.forEach(_e=>{var pe;$(_e.logic),(pe=_e.logic)!=null&&pe.optionsFilterRule&&T(_e)}),((ne=N.type)==null?void 0:ne.toUpperCase())==="TABLE"&&((ee=N.propsTable)!=null&&ee.modelDatatable)){const _e=N.propsTable.modelDatatable;(!f[_e]||!Array.isArray(f[_e]))&&(f[_e]=[])}else if(((fe=N.type)==null?void 0:fe.toUpperCase())==="WIZARD"){const _e=p(N);m[_e]===void 0&&(m[_e]=0),(((Be=N.propsWizard)==null?void 0:Be.propsSteps)||[]).forEach(Le=>{(Array.isArray(Le.sectionsWizard)?Le.sectionsWizard:[Le.sectionsWizard].filter(Boolean)).forEach(Qe=>{Qe.fields&&Qe.fields.forEach(he=>{var tt;$(he.logic),(tt=he.logic)!=null&&tt.optionsFilterRule&&T(he)})})})}}),v.sections.forEach(N=>{var W,ne;(((W=N.propsForm)==null?void 0:W.fields)||N.fields||[]).forEach(ee=>{U.has(ee.model)&&T(ee)}),N.type==="WIZARD"&&(((ne=N.propsWizard)==null?void 0:ne.propsSteps)||[]).forEach(fe=>{(Array.isArray(fe.sectionsWizard)?fe.sectionsWizard:[fe.sectionsWizard].filter(Boolean)).forEach(_e=>{_e.fields&&_e.fields.forEach(pe=>{U.has(pe.model)&&T(pe)})})})})},{immediate:!0}),e.watch(()=>o.model,v=>{v&&Object.keys(v).length>0&&(console.log("[DynamicForm] Syncing model to formData",v),Object.assign(f,v),e.nextTick(()=>{Object.keys(v).forEach(U=>{})}))},{immediate:!0,deep:!0});const L=(v,U)=>{var ne;if(!v)return!0;const $=v.propsForm||v.propsTable||v.propsWizard||v.props||{},N=v.logic||$.logic||((ne=v.props)==null?void 0:ne.logic);if(!N)return!0;const I=N.visibleRule||N.rule;if(I==null)return!0;if(I===!1)return!1;if(I===!0)return!0;const W=V.value;return!!M(I,W,`VISIBLE-SEC-${p(v)}`)},G=(v,U)=>{var pe;if(!v)return{title:"",description:""};const $=v.propsForm||v.propsTable||v.propsWizard||v.props||{},I=(v.logic||$.logic||((pe=v.props)==null?void 0:pe.logic)||{}).labelingRule||[],W=$.titleID||v.titleID||v.labelID,ne=$.titleEN||v.titleEN||v.labelEN,ee=$.descriptionID||v.descriptionID,fe=$.descriptionEN||v.descriptionEN;let Be=i.value==="id"?W:ne,_e=i.value==="id"?ee:fe;if(Array.isArray(I)&&I.length>0){const Le=V.value,Ce=I.find(Qe=>M(Qe.condition,Le,`LABEL-SEC-${p(v)}`));Ce&&(Be=i.value==="id"?Ce.labelID||Ce.titleID:Ce.labelEN||Ce.titleEN,_e=i.value==="id"?Ce.descriptionID:Ce.descriptionEN)}return{title:Be,description:_e}},Q=(v,U)=>{var I;const $=(I=v.logic)==null?void 0:I.visibleRule;if($===!1)return!1;if($===!0||!$||typeof $=="object"&&Object.keys($).length===0)return!0;const N=U?A(U):V.value;return!!M($,N,`VISIBLE-${v.model}`)},X=(v,U)=>{var W,ne;const $=(W=v.logic)==null?void 0:W.requiredRule,N=((ne=v.props)==null?void 0:ne.required)||!1;if($===!1)return!1;if($===!0)return!0;if(!$||typeof $=="object"&&Object.keys($).length===0)return N;const I=U?A(U):V.value;return!!M($,I,`REQUIRED-${v.model}`)},R=(v,U)=>{var W,ne;const $=(W=v.logic)==null?void 0:W.disableRule,N=((ne=v.props)==null?void 0:ne.disabled)||!1;if($===!1)return!1;if($===!0)return!0;if(!$||typeof $=="object"&&Object.keys($).length===0)return N;const I=U?A(U):V.value;return!!M($,I,`DISABLED-${v.model}`)},H=()=>{var $;if(!(($=u.value)!=null&&$.sections))return;const v=3;let U=0;for(;U<v;){let N=!1;if(u.value.sections.forEach(I=>{var ne;(((ne=I.propsForm)==null?void 0:ne.fields)||I.fields||[]).forEach(ee=>{var Be;const fe=(Be=ee.logic)==null?void 0:Be.calculateRule;if(fe&&typeof fe=="object"){const _e=Object.keys(fe);if(_e.length>0){const pe=_e[0],Le=fe[pe],Ce=M(Le,V.value,`CALC-${pe}`);Ce!==void 0&&f[pe]!==Ce&&(f[pe]=Ce,N=!0)}}})}),!N)break;U++}},ae=e.computed(()=>{var U,$,N;if(!((U=u.value)!=null&&U.sections))return!1;if(Object.keys(h).length>0)return!0;const v=I=>{for(const W of I)if(Q(W)){if(X(W)){const ne=f[W.model];if(Array.isArray(ne)?ne.length===0:ne==null||ne==="")return!0}if(b[W.model])return!0}return!1};for(const I of u.value.sections){const W=(($=I.propsForm)==null?void 0:$.fields)||I.fields||[];if(v(W))return!0;if(((N=I.type)==null?void 0:N.toUpperCase())==="WIZARD"){const ne=E(I);for(const ee of ne)if(v(ee.sections.flatMap(fe=>fe.fields||[])))return!0}}return!1});e.watch(()=>({...f}),()=>{var $;if(!(($=u.value)!=null&&$.sections))return;H();let v=!1;const U=N=>{N.forEach(I=>{const W=I.model;Q(I)||h[W]&&delete h[W]})};u.value.sections.forEach(N=>{var ne,ee;const I=L(N),W=((ne=N.propsForm)==null?void 0:ne.fields)||N.fields||[];I?U(W):W.forEach(fe=>{f[fe.model]!==null&&f[fe.model]!==void 0&&(f[fe.model]=Array.isArray(f[fe.model])?[]:null,v=!0)}),((ee=N.type)==null?void 0:ee.toUpperCase())==="WIZARD"&&E(N).forEach(Be=>{Be.sections.forEach(_e=>{var Le;const pe=_e.fields||((Le=_e.propsForm)==null?void 0:Le.fields)||[];I?pe&&U(pe):pe.forEach(Ce=>{f[Ce.model]!==null&&f[Ce.model]!==void 0&&(f[Ce.model]=Array.isArray(f[Ce.model])?[]:null,v=!0)})})})}),v&&r("update:model",Z())},{deep:!0});const Z=()=>{var $;if(!(($=u.value)!=null&&$.sections))return{...f};const v={},U=new Set;return u.value.sections.forEach(N=>{var W,ne,ee;if(!L(N))return;if((((W=N.propsForm)==null?void 0:W.fields)||N.fields||[]).forEach(fe=>{Q(fe)&&(v[fe.model]=f[fe.model],U.add(fe.model))}),((ne=N.type)==null?void 0:ne.toUpperCase())==="WIZARD"&&E(N).forEach(Be=>{Be.sections.forEach(_e=>{var Le;(_e.fields||((Le=_e.propsForm)==null?void 0:Le.fields)||[]).forEach(Ce=>{Q(Ce)&&(v[Ce.model]=f[Ce.model],U.add(Ce.model))})})}),(ee=N.propsTable)!=null&&ee.modelDatatable){const fe=N.propsTable.modelDatatable;f[fe]!==void 0&&(v[fe]=f[fe],U.add(fe))}}),["id","_id"].forEach(N=>{f[N]!==void 0&&!U.has(N)&&(v[N]=f[N])}),v},J=(v,U)=>{const $={},N=[];if(Object.keys(U).forEach(I=>{const W=U[I];if(typeof W=="string"){const ne=I,ee=W;v[ne]!==void 0&&($[ee]=v[ne])}else if(Array.isArray(W)&&W.length>0&&typeof W[0]=="object"){const ne=I,ee=W[0],fe=Object.keys(ee);let Be=null;Array.isArray(v[ne])&&(Be=v[ne]),Be?(console.log(`%c[MAPPING] Mapping array '${ne}'`,"color: #3b82f6; font-weight: bold;"),$[ne]=Be.map(_e=>{const pe={};return fe.forEach(Le=>{const Ce=Le,Qe=ee[Le];_e[Ce]!==void 0&&(pe[Qe]=_e[Ce])}),pe})):(N.push(ne),$[ne]=[])}}),N.length>0){const I=N.join(", "),W=i.value==="id"?`Kesalahan Pemetaan: Data sumber tidak ditemukan untuk field (${I}). Harap periksa skema atau hubungi tim teknis.`:`Mapping Error: Source data not found for fields (${I}). Please check the schema or contact technical team.`;Ue.error(W,{autoClose:5e3,position:Ue.POSITION.TOP_RIGHT}),console.warn(`[MAPPING-ERROR] ${W}`)}return $},ie=v=>{var U,$,N,I;if(v.requireConfirm){const W=i.value==="id";x.title=W?((U=v.propCustomMessage)==null?void 0:U.titleID)||"Konfirmasi Tindakan":(($=v.propCustomMessage)==null?void 0:$.titleEN)||"Confirm Action",x.message=W?((N=v.propCustomMessage)==null?void 0:N.messageID)||"Apakah Anda yakin ingin melanjutkan tindakan ini?":((I=v.propCustomMessage)==null?void 0:I.messageEN)||"Are you sure you want to proceed with this action?",x.action=v,x.visible=!0;return}Ee(v)},de=()=>{const v=x.action;x.visible=!1,v&&Ee(v)},Ee=async v=>{const U=Z(),$=v.propsActionGlobal||v.props||{},N=$.fieldMapping||v.fieldMapping||{};let I={};N&&typeof N=="object"&&Object.keys(N).length>0?I=J(U,N):I={...U},console.log("%c[SUBMIT-ACTION-PAYLOAD]","color: #10b981; font-weight: bold;",I),r("action",v,I);const W=!!($.endpointPropAction||v.endpointPropAction);if(v.permission==="CREATE"||v.permission==="UPDATE"||$.type==="SUBMIT"||$.key==="submit"){c.value=!0;try{W||r("submit",I)}finally{W||(c.value=!1)}}$.keyRedirect&&$.route&&l&&l.push($.route)},Ne=()=>{var U;if(!((U=u.value)!=null&&U.sections))return!0;let v=!0;return u.value.sections.forEach($=>{var I,W;if(!L($))return;(((I=$.propsForm)==null?void 0:I.fields)||$.fields||[]).forEach(ne=>{if(Q(ne)){const ee=B(ne,f[ne.model]);ee&&(h[ne.model]=ee,v=!1)}}),((W=$.type)==null?void 0:W.toUpperCase())==="WIZARD"&&E($).forEach(ne=>{ne.sections.forEach(ee=>{(ee.fields||[]).forEach(Be=>{if(Q(Be)){const _e=B(Be,f[Be.model]);_e&&(h[Be.model]=_e,v=!1)}})})})}),v},ye=async()=>{if(!Ne()){console.warn("[DynamicForm] Submit blocked by validation errors",h);return}c.value=!0;try{const v=Z();r("submit",v)}finally{c.value=!1}},te=()=>{r("cancel")},O=v=>v.permission?o.isEditMode?v.permission!=="CREATE":v.permission!=="UPDATE":!0,Y=v=>{const U=v.modelDatatable;if(!U)return[];const $=f[U];return Array.isArray($)?$:[]},se=e.ref(!1),xe=e.ref(""),Ae=e.ref("Plus"),Re=e.ref([]),Ve=e.reactive({}),je=e.reactive({}),Oe=e.ref(""),at=e.ref(null),ut=e.ref(null),St=(v,U)=>{Ve[v]=U;const $=Re.value.find(N=>N.model===v);if($){const N=je,I=B($,U);I?N[v]=I:delete N[v]}},At=(v,U)=>{var N,I,W;Oe.value=v.modelDatatable||"",ut.value=U,at.value=null,xe.value=i.value==="id"?U.labelID||((N=U.propsActionGlobal)==null?void 0:N.labelID)||"Tambah Data":U.labelEN||((I=U.propsActionGlobal)==null?void 0:I.labelEN)||"Add Data",Ae.value=U.icon||((W=U.propsActionGlobal)==null?void 0:W.icon)||"Plus";const $=(U.fieldActionGlobal||[]).map(ne=>({...ne,props:ne.propsFieldGlobal||ne.props||{}}));Re.value=$,se.value=!0,Object.keys(Ve).forEach(ne=>delete Ve[ne]),Object.keys(je).forEach(ne=>delete je[ne]),$.forEach(ne=>{Ve[ne.model]=null}),se.value=!0},q=(v,U)=>{var _e;const{action:$,row:N}=U;if(/delete|trash|remove/i.test($)){const pe=v.modelDatatable;if(pe&&Array.isArray(f[pe])){const Le=f[pe].indexOf(N);if(Le!==-1)f[pe].splice(Le,1);else{const Ce=JSON.stringify(N),Qe=f[pe].findIndex(he=>JSON.stringify(he)===Ce);Qe!==-1&&f[pe].splice(Qe,1)}}return}const W=v.modelDatatable||"";Oe.value=W,xe.value=i.value==="id"?"Ubah Data":"Edit Data",Ae.value="SquarePen";const ne=f[W],ee=Array.isArray(ne)?ne.indexOf(N):-1;at.value=ee!==-1?ee:null;const Be=(((_e=(v.actionTableGlobal||[])[0])==null?void 0:_e.fieldActionGlobal)||[]).map(pe=>({...pe,props:pe.propsFieldGlobal||pe.props||{}}));Re.value=Be,se.value=!0,Object.keys(Ve).forEach(pe=>delete Ve[pe]),Object.keys(je).forEach(pe=>delete je[pe]),Be.forEach(pe=>{Ve[pe.model]=N[pe.model]??null}),se.value=!0},ce=()=>{let v=!0;if(Re.value.forEach(N=>{const I=B(N,Ve[N.model]);I&&(je[N.model]=I,v=!1)}),!v)return;const U=Oe.value;if(!U)return;Array.isArray(f[U])||(f[U]=[]);const $={...Ve};at.value!==null?f[U].splice(at.value,1,$):f[U].push($),se.value=!1};return(v,U)=>{var $,N,I,W,ne;return e.openBlock(),e.createElementBlock("div",WS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(($=u.value)==null?void 0:$.sections,(ee,fe)=>{var Be,_e,pe,Le,Ce,Qe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:fe},[((Be=ee.type)==null?void 0:Be.toUpperCase())==="FORM"&&ee.propsForm&&L(ee)?(e.openBlock(),e.createElementBlock("div",US,[e.createElementVNode("div",HS,[G(ee).title?(e.openBlock(),e.createElementBlock("div",qS,[e.createElementVNode("h3",GS,e.toDisplayString(G(ee).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",XS,[(_e=ee.propsForm.actionSection)!=null&&_e.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ee.propsForm.actionSection,(he,tt)=>{var xt,ve,kt,Vt,Ut,Dt,nt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:tt},[O(he)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:he.icon||((xt=he.propsActionGlobal)==null?void 0:xt.icon),text:i.value==="id"?he.labelID||((ve=he.propsActionGlobal)==null?void 0:ve.labelID):he.labelEN||((kt=he.propsActionGlobal)==null?void 0:kt.labelEN),"bg-color":((Ut=he.bgColor||((Vt=he.propsActionGlobal)==null?void 0:Vt.bgColor))==null?void 0:Ut.toLowerCase())||"primary",variant:((nt=he.variant||((Dt=he.propsActionGlobal)==null?void 0:Dt.variant))==null?void 0:nt.toLowerCase())||"outline",size:"sm",onClick:qn=>ie(he)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),fe===0?(e.openBlock(),e.createBlock(Ye,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:te},null,8,["text"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",ee.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w(ee.propsForm.fields),he=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:he.key},[Q(he)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([he.column==="FULL"&&ee.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Js,{field:he,"model-value":f[he.model],"form-data":f,required:X(he),options:P(he),error:h[he.model],"dynamic-labels":C(he),"dynamic-length":_(he),"onUpdate:modelValue":tt=>k(he.model,tt)},null,8,["field","model-value","form-data","required","options","error","dynamic-labels","dynamic-length","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((pe=ee.type)==null?void 0:pe.toUpperCase())==="TABLE"&&ee.propsTable&&L(ee)?(e.openBlock(),e.createElementBlock("div",KS,[(Le=ee.propsTable.actionTableGlobal)!=null&&Le.length?(e.openBlock(),e.createElementBlock("div",YS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.propsTable.actionTableGlobal,(he,tt)=>{var xt,ve;return e.openBlock(),e.createElementBlock(e.Fragment,{key:tt},[he.propsActionGlobal?(e.openBlock(),e.createBlock(Ye,{key:0,icon:he.propsActionGlobal.icon,"bg-color":((xt=he.propsActionGlobal.bgColor)==null?void 0:xt.toLowerCase())||"primary",variant:((ve=he.propsActionGlobal.variant)==null?void 0:ve.toLowerCase())||"default",size:"sm",onClick:kt=>At(ee.propsTable,he)},null,8,["icon","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0),e.createVNode(po,{"table-config":ee.propsTable,data:Y(ee.propsTable),nested:!0,"show-pagination":ee.propsTable.pagination??!0,onAction:he=>q(ee.propsTable,he)},null,8,["table-config","data","show-pagination","onAction"])])):((Ce=ee.type)==null?void 0:Ce.toUpperCase())==="WIZARD"&&ee.propsWizard&&L(ee)?(e.openBlock(),e.createElementBlock("div",JS,[e.createVNode(Ls,{tabs:E(ee),modelValue:m[p(ee)],"onUpdate:modelValue":he=>m[p(ee)]=he,"is-vertical":ee.propsWizard.isVertical,"is-wizard":ee.propsWizard.isWizard,"type-wizard":((Qe=ee.propsWizard.typeWizard)==null?void 0:Qe.toLowerCase())||"icon",loading:c.value},e.createSlots({_:2},[e.renderList(E(ee),he=>({name:`tab-${he.key}`,fn:e.withCtx(()=>{var tt,xt;return[e.createElementVNode("div",QS,[he.title||(tt=he.actions)!=null&&tt.length?(e.openBlock(),e.createElementBlock("div",ZS,[e.createElementVNode("div",null,[he.title?(e.openBlock(),e.createElementBlock("h4",eA,e.toDisplayString(he.title),1)):e.createCommentVNode("",!0),he.description?(e.openBlock(),e.createElementBlock("p",tA,e.toDisplayString(he.description),1)):e.createCommentVNode("",!0)]),(xt=he.actions)!=null&&xt.length?(e.openBlock(),e.createElementBlock("div",nA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.actions,(ve,kt)=>{var Vt,Ut,Dt,nt,qn,Ko,da;return e.openBlock(),e.createElementBlock(e.Fragment,{key:kt},[O(ve)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:ve.icon||((Vt=ve.propsActionGlobal)==null?void 0:Vt.icon),text:i.value==="id"?ve.labelID||((Ut=ve.propsActionGlobal)==null?void 0:Ut.labelID):ve.labelEN||((Dt=ve.propsActionGlobal)==null?void 0:Dt.labelEN),"bg-color":((qn=ve.bgColor||((nt=ve.propsActionGlobal)==null?void 0:nt.bgColor))==null?void 0:qn.toLowerCase())||"primary",variant:((da=ve.variant||((Ko=ve.propsActionGlobal)==null?void 0:Ko.variant))==null?void 0:da.toLowerCase())||"tonal",size:"sm",onClick:au=>ie(ve)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.sections,(ve,kt)=>{var Vt,Ut,Dt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:kt},[L(ve)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((Vt=ve.type)==null?void 0:Vt.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",ve.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w(ve.fields),nt=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:nt.key},[Q(nt)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([nt.column==="FULL"&&ve.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Js,{field:nt,"model-value":f[nt.model],"form-data":f,required:X(nt),disabled:R(nt),options:P(nt),error:h[nt.model],"dynamic-labels":C(nt),"dynamic-length":_(nt),"onUpdate:modelValue":qn=>k(nt.model,qn)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((Ut=ve.type)==null?void 0:Ut.toUpperCase())==="TABLE"||ve.isDataTable?(e.openBlock(),e.createElementBlock("div",oA,[e.createVNode(po,{"table-config":ve.propsDataTableWizard||ve.propsTable,data:Y(ve.propsDataTableWizard||ve.propsTable),nested:!0,"show-pagination":((Dt=ve.propsDataTableWizard||ve.propsTable)==null?void 0:Dt.pagination)??!0,onAction:nt=>q(ve.propsDataTableWizard||ve.propsTable,nt)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",rA," Unknown section type: "+e.toDisplayString(ve.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),g!=null&&g.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((I=(N=u.value)==null?void 0:N.ui)==null?void 0:I.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(ne=(W=u.value)==null?void 0:W.actionGlobal)!=null&&ne.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u.value.actionGlobal,(ee,fe)=>{var Be,_e,pe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:fe},[ee.propsActionGlobal&&O(ee)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:ee.propsActionGlobal.icon,text:i.value==="id"?ee.propsActionGlobal.labelID:ee.propsActionGlobal.labelEN,"bg-color":((Be=ee.propsActionGlobal.bgColor)==null?void 0:Be.toLowerCase())||"primary",variant:((_e=ee.propsActionGlobal.variant)==null?void 0:_e.toLowerCase())||"default",loading:c.value,disabled:ae.value&&(ee.permission==="CREATE"||ee.permission==="UPDATE"||((pe=ee.propsActionGlobal)==null?void 0:pe.key)==="submit"),onClick:Le=>ie(ee)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(Ye,{key:1,text:"Submit","bg-color":"primary",loading:c.value,disabled:ae.value,onClick:ye},null,8,["loading","disabled"]))],2)),e.createVNode(lo,{modelValue:x.visible,"onUpdate:modelValue":U[1]||(U[1]=ee=>x.visible=ee),title:x.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:U[0]||(U[0]=ee=>x.visible=!1)},null,8,["text"]),e.createVNode(Ye,{text:e.unref(a)("common.confirm"),onClick:de},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",aA,e.toDisplayString(x.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(lo,{modelValue:se.value,"onUpdate:modelValue":U[3]||(U[3]=ee=>se.value=ee),title:xe.value,icon:Ae.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",text:"Cancel",onClick:U[2]||(U[2]=ee=>se.value=!1)}),e.createVNode(Ye,{text:"Save",onClick:ce})]),default:e.withCtx(()=>[Re.value.length?(e.openBlock(),e.createElementBlock("div",sA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,ee=>(e.openBlock(),e.createElementBlock("div",{key:ee.key,class:e.normalizeClass(ee.column==="FULL"?"md:col-span-2":"col-span-1")},[Q(ee,Ve)?(e.openBlock(),e.createBlock(Js,{key:0,field:ee,"model-value":Ve[ee.model],"form-data":Ve,required:X(ee,Ve),disabled:R(ee,Ve),options:P(ee,Ve),error:je[ee.model],"dynamic-labels":C(ee,Ve),"dynamic-length":_(ee,Ve),"onUpdate:modelValue":fe=>St(ee.model,fe)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"])])}}}),lA={class:"w-full space-y-6 animate-pulse"},cA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},dA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",lA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",cA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.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]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),uA={class:"w-full"},fA={class:"relative mx-auto min-h-[37.5rem]"},hA={key:"content",class:"w-full"},mA={class:"mb-6"},pA={class:"text-neutral-500 dark:text-neutral-400"},gA={key:"skeleton",class:"w-full"},bA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Qs=Et(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var M,D,T,P,K,L,G,Q;const o=t,r=n,a=(D=(M=e.getCurrentInstance())==null?void 0:M.appContext)==null?void 0:D.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const X=Vn.useRoute();if(X&&Object.keys(X).length>0)s=X;else{const R=e.getCurrentInstance();(K=(P=(T=R==null?void 0:R.appContext)==null?void 0:T.config)==null?void 0:P.globalProperties)!=null&&K.$route&&(s=R.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:X=>{typeof window<"u"&&(typeof X=="string"?window.location.href=X:X&&X.path&&(window.location.href=X.path))},__isFallback:!0};try{const X=Vn.useRouter();if(X)i=X;else{const R=e.getCurrentInstance();(Q=(G=(L=R==null?void 0:R.appContext)==null?void 0:L.config)==null?void 0:G.globalProperties)!=null&&Q.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=st();let d;try{d=vt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=tu(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const X=s.path.match(/\/edit\/([^\/]+)$/);return X?X[1]:null}),m=e.ref({}),g=e.ref(null),b=e.ref(!0),x=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",E="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",w=e.ref(o.layoutCode),C=e.computed(()=>{var H;if(!g.value)return"";const X=((H=d==null?void 0:d.value)==null?void 0:H.toLowerCase())||"en";return(X==="en"||X.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(C,X=>{X&&u(X)},{immediate:!0});const _=(X,R="")=>{const H={};return!X||typeof X!="object"||Object.keys(X).forEach(ae=>{const Z=X[ae],J=R?`${R}.${ae}`:ae;Z&&typeof Z=="object"&&!Array.isArray(Z)&&!(Z instanceof Date)&&Object.assign(H,_(Z,J)),H[J]=Z}),H},B=async()=>{var X,R,H,ae,Z,J;b.value=!0;try{let ie=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ie=s.query.code||o.layoutCode);const de="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Ee=de?{Authorization:`Bearer ${de}`}:{},Ne=`${p}${ie}`;let ye=await l(Ne,"GET",null,Ee);if(!ye.status||!ye.data||Array.isArray(ye.data)&&ye.data.length===0)try{const te=`${E}${ie}`,O=await l(te,"GET",null,Ee);if(O.status){const Y=Array.isArray(O.data)?O.data[0]:O.data;Y&&Y.code&&(ie=Y.code,w.value=ie,ye=await l(`${p}${ie}`,"GET",null,Ee))}}catch(te){console.warn("Failed to resolve layout code via datatable",te)}if(ye.status){g.value=Array.isArray(ye.data)?ye.data[0]:ye.data;const te={};if((X=g.value)!=null&&X.sections&&g.value.sections.forEach(O=>{((O.propsForm||O.props||{}).fields||O.fields||[]).forEach(xe=>{var Re;const Ae=xe.model||((Re=xe.props)==null?void 0:Re.model)||xe.key;Ae&&(te[Ae]=null)})}),m.value=te,b.value=!1,f.value&&h.value){x.value=!0;try{const O=(ae=(H=(R=g.value.sections)==null?void 0:R[0])==null?void 0:H.propsForm)==null?void 0:ae.endpointForm,Y=g.value.endpointForm,se=O||Y;if(se!=null&&se.apiUrl){const xe=se.apiUrl,Ae=se.apiMethod||"GET",Re=se.keyParam||[],Ve={};Re.length>0?Re.forEach(Oe=>{Ve[Oe]=h.value}):Ve.id=h.value;const je=await c(xe,Ae,Ve);if(je.status){let Oe=Array.isArray(je.data)?je.data[0]:je.data;je.payload&&(Oe={...Oe,...je.payload});const at=_(Oe);m.value={...m.value,...Oe,...at}}}else if((Z=g.value.endpointGlobal)!=null&&Z.apiUrl){const xe=g.value.endpointGlobal.apiUrl,Ae=g.value.endpointGlobal.apiMethod||"GET",Re={id:h.value},Ve=await c(xe,Ae,Re);if(Ve.status){const je=Array.isArray(Ve.data)?Ve.data[0]:Ve.data,Oe=_(je);m.value={...m.value,...je,...Oe}}}else{const xe=((J=g.value.endpoint)==null?void 0:J.detailUrl)||`/api/${w.value}/detail/${h.value}`,Ae=await l(xe,"GET");if(Ae.status){let Re=Array.isArray(Ae.data)?Ae.data[0]:Ae.data;if(Ae.payload){const Oe={...Ae.payload};if(Object.keys(Oe).forEach(at=>{Re[at]!==void 0&&Re[at]!==null&&(Oe[at]=Re[at])}),!("id"in Oe)&&Re.id){const at=Object.keys(Oe).find(ut=>ut.startsWith("id")&&ut.length>2&&!Oe[ut]);at&&(Oe[at]=Re.id)}Re=Oe}const Ve={...Re};Object.keys(m.value).forEach(Oe=>{if(Ve[Oe]===void 0||Ve[Oe]===null){if(Oe.toLowerCase().startsWith("id")&&Oe.length>2){const ut=Oe.substring(2).toLowerCase(),St=Array.isArray(Ae.data)?Ae.data[0]:Ae.data,At=Object.keys(St).find(q=>q.toLowerCase()===ut);At&&St[At]&&typeof St[At]=="object"&&"id"in St[At]&&(Ve[Oe]=St[At].id)}if(Oe==="idSupervisor"){const ut=Array.isArray(Ae.data)?Ae.data[0]:Ae.data;ut.supervisorId&&(Ve[Oe]=ut.supervisorId)}}});const je=_(Ve);m.value={...m.value,...Ve,...je}}}}catch(O){console.error("Failed to fetch record data:",O)}finally{x.value=!1}}}}catch(ie){console.error("Failed to load form layout:",ie),b.value=!1}},k=X=>{m.value=X,r("update:model",X)},y=async X=>{var R,H,ae;try{const Z=(ae=(H=(R=g.value.sections)==null?void 0:R[0])==null?void 0:H.propsForm)==null?void 0:ae.endpointForm,J=g.value.endpointGlobal||g.value.endpoint,ie=(Z==null?void 0:Z.submitUrl)||(J==null?void 0:J.submitUrl)||`/api/generic/${o.layoutCode}`,de=(Z==null?void 0:Z.submitMethod)||(J==null?void 0:J.submitMethod)||(f.value?"PUT":"POST"),Ee=Object.values(X).some(ye=>ye instanceof File||ye instanceof Blob);let Ne;Ee?(Ne=new FormData,Object.keys(X).forEach(ye=>{const te=X[ye];te!=null&&(Array.isArray(te)?te.forEach(O=>Ne.append(`${ye}[]`,O)):Ne.append(ye,te))})):(Ne={...X},f.value&&h.value&&!Ne.id&&(Ne.id=h.value)),await l(ie,de,Ne),r("submit-success",Ne),i.back()}catch(Z){console.error("Submit failed:",Z)}},A=async(X,R,H)=>{if(X==="cancel"){V();return}const ae=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(ae)try{b.value=!0;const Z=H?{...H}:{...m.value};f.value&&R.model&&h.value&&(Z[R.model]=h.value);const J=ae.apiUrl,ie=ae.apiMethod||"POST";(await c(J,ie,Z)).status&&(r("action-success",X,R,Z),i.back())}catch(Z){console.error("Action failed:",Z)}finally{b.value=!1}},V=()=>{r("cancel"),i.back()};return e.onMounted(()=>{B()}),e.watch(()=>o.model,X=>{X&&Object.keys(X).length>0&&(m.value={...m.value,...X})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(X,R)=>(e.openBlock(),e.createElementBlock("div",uA,[e.createElementVNode("div",fA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!b.value&&g.value?(e.openBlock(),e.createElementBlock("div",hA,[e.createElementVNode("div",mA,[e.createElementVNode("p",pA,e.toDisplayString(g.value.description),1)]),e.createVNode(iA,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:x.value,"onUpdate:model":R[0]||(R[0]=H=>k(H)),onSubmit:y,onCancel:V,onAction:A,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):b.value?(e.openBlock(),e.createElementBlock("div",gA,[e.createVNode(dA)])):(e.openBlock(),e.createElementBlock("div",bA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9d6797b1"]]),yA={class:"h-full flex flex-col"},xA={key:1,class:"flex-1 flex items-center justify-center"},kA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Zs=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var _,B,k,y,A,V;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=st();let i={query:{},params:{},path:""};try{const M=Vn.useRoute();M?i=M:(k=(B=(_=a==null?void 0:a.appContext)==null?void 0:_.config)==null?void 0:B.globalProperties)!=null&&k.$route&&(i=a.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:M=>{typeof window<"u"&&(typeof M=="string"?window.location.href=M:M&&M.path&&(window.location.href=M.path))}};try{const M=Vn.useRouter();M?l=M:(V=(A=(y=a==null?void 0:a.appContext)==null?void 0:y.config)==null?void 0:A.globalProperties)!=null&&V.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),h=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),{setPageTitle:b}=tu();let x;try{x=vt.useI18n().locale}catch{x=e.ref("en")}const p=()=>{if(u.value){const D=(x.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";b(D)}};e.watch(x,()=>{p()});const E=async()=>{f.value=!0;try{const M="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=M?{Authorization:`Bearer ${M}`}:{},T=await s(g.value,"GET",null,D);T.status&&(u.value=Array.isArray(T.data)?T.data[0]:T.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(M){console.error("Gagal Menampilkan Datatable:",M)}finally{f.value=!1}},w=M=>{M.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",M.action,M)},C=M=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",M);let D=M.route;const T=M.path;if(!D&&T){const K=((i==null?void 0:i.path)||"").split("/");K.length>=2&&(D=`/${K[1]}/create`)}if(D||T){const P={...M.query||{},code:T||void 0};Object.keys(P).forEach(K=>P[K]===void 0&&delete P[K]),console.log("[DEBUG] Emitting navigate to parent:",{route:D,query:P}),r("navigate",{route:D||"/form",query:P}),l&&!l.__isFallback&&l.push({path:D||"/form",query:P})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{E()}),(M,D)=>(e.openBlock(),e.createElementBlock("div",yA,[!f.value&&u.value?(e.openBlock(),e.createBlock(po,{key:0,ref_key:"dtRef",ref:h,"api-url":g.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||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:w,onNavigate:C},{"header-actions":e.withCtx(()=>[...D[0]||(D[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",xA,[...D[1]||(D[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",kA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),nu=e.defineCustomElement(Qs),ou=e.defineCustomElement(Zs);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",nu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",ou));const wA=[rr,_i,Ye,al,Fa,za,pd,hn,_s,Ss,Hr,lo,vd,qr,Pd,Ps,As,Td,Os,Gr,Fs,co,zs,Xr,Od,Fd,Is,Rs,Kr,Yr,Jn,uo,Ld,$d,Ls,$s,js,Ys,po,Qs,Zs],ru={install(t,n={}){n&&Object.keys(n).length>0&&ni(n),wA.forEach(o=>{o.name&&t.component(o.name,o)})}};ue.AutoLayoutDatatable=Zs,ue.AutoLayoutForm=Qs,ue.DCodeAutoComplete=rr,ue.DCodeBadge=Ys,ue.DCodeBeforeAfter=Fa,ue.DCodeButton=Ye,ue.DCodeCard=al,ue.DCodeCardCheckboxList=_s,ue.DCodeChart=pd,ue.DCodeCheckbox=hn,ue.DCodeCurrencyField=Ss,ue.DCodeDatePicker=Hr,ue.DCodeDialog=lo,ue.DCodeDialogCloseBtn=vd,ue.DCodeDropzone=qr,ue.DCodeDynamicUploadList=As,ue.DCodeFileField=Pd,ue.DCodeFileResult=Ps,ue.DCodeIconDropdown=Td,ue.DCodeImageCropperDialog=Os,ue.DCodeImageField=Gr,ue.DCodeImageResult=Fs,ue.DCodeInfiniteAutoComplete=_i,ue.DCodeLabel=co,ue.DCodeListLabels=za,ue.DCodeMultiSelect=zs,ue.DCodeOtpInput=Xr,ue.DCodePermissionMenu=$s,ue.DCodeProgress=Od,ue.DCodeProgressBar=Fd,ue.DCodeRadio=Is,ue.DCodeRadioCustom=Rs,ue.DCodeSlider=Kr,ue.DCodeSwitch=Yr,ue.DCodeTextField=Jn,ue.DCodeTextarea=uo,ue.DCodeTimelineWithIcons=Ld,ue.DCodeTreePermissions=js,ue.DCodeUploadFile=$d,ue.DCodeWizard=Ls,ue.DataTable=po,ue.DataTableComponent=po,ue.DynamicUI=ru,ue.MicroDynamicDatatable=ou,ue.MicroDynamicForm=nu,ue.cn=Fe,ue.default=ru,ue.setApiConfig=ni,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));