@gemafajarramadhan/dynamic-ui 1.2.61 → 1.2.63

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(pe,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):(pe=typeof globalThis<"u"?globalThis:pe||self,e(pe.DynamicUI={},pe.Vue,pe.LucideIcons,pe.rekaUi,pe.core,pe.VueI18n,pe.VueDatePicker,pe.Uppy,pe.UppyDashboard,pe.UppyImageEditor,pe.VueRouter,pe.Vue3Lottie))})(this,(function(pe,e,le,Be,st,Ot,yu,xu,hi,ku,vn,wu){"use strict";var oA=Object.defineProperty;var rA=(pe,e,le)=>e in pe?oA(pe,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):pe[e]=le;var we=(pe,e,le)=>rA(pe,typeof e!="symbol"?e+"":e,le);var wa;function Cu(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 $t=Cu(le);let jt={};function pi(t){jt={...jt,...t}}function Eu(){return jt}function Bu(){return jt.apiBaseUrl?jt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function _u(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(jt.getAuthToken?n=jt.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}`),jt.getHeaders){const o=jt.getHeaders();return{...t,...o}}return t}function Su(){jt.onUnauthorized&&jt.onUnauthorized()}async function Vu(t,n,o,r){const a=Eu();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=Bu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{..._u(),...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 p=new URLSearchParams;Object.entries(o).forEach(([x,g])=>{g!=null&&p.append(x,String(g))});const k=p.toString();k&&(f=`${d}${d.includes("?")?"&":"?"}${k}`)}const m=await fetch(f,u);if(m.status===401&&Su(),!m.ok){const p=await m.text();throw new Error(`HTTP ${m.status}: ${p}`)}return(m.headers.get("content-type")||"").includes("application/json")?m.json():{status:!0,data:await m.text()}}function ct(){const t=(n,o,r,a)=>{let s=n,i=o,l=r,c=a;return a&&typeof a=="object"?(a._url&&(s=a._url,i=a._method||i||"POST",a._data&&(l={...l||{},...a._data})),a.headers&&(c=a.headers)):n&&o&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(o.toUpperCase())||(s=`${n.endsWith("/")?n.slice(0,-1):n}/${o}`,i="POST")),Vu(s,i,l,c)};return{apiUrl:t,DCodeApi:t}}const Qn=Math.min,Vt=Math.max,lr=Math.round,cr=Math.floor,Gt=t=>({x:t,y:t}),Au={left:"right",right:"left",bottom:"top",top:"bottom"};function gi(t,n,o){return Vt(t,Qn(n,o))}function So(t,n){return typeof t=="function"?t(n):t}function yn(t){return t.split("-")[0]}function Vo(t){return t.split("-")[1]}function bi(t){return t==="x"?"y":"x"}function yi(t){return t==="y"?"height":"width"}function on(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function xi(t){return bi(on(t))}function Du(t,n,o){o===void 0&&(o=!1);const r=Vo(t),a=xi(t),s=yi(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=dr(i)),[i,dr(i)]}function Nu(t){const n=dr(t);return[Aa(t),n,Aa(n)]}function Aa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ki=["left","right"],wi=["right","left"],Mu=["top","bottom"],Tu=["bottom","top"];function Pu(t,n,o){switch(t){case"top":case"bottom":return o?n?wi:ki:n?ki:wi;case"left":case"right":return n?Mu:Tu;default:return[]}}function vu(t,n,o,r){const a=Vo(t);let s=Pu(yn(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(Aa)))),s}function dr(t){const n=yn(t);return Au[n]+t.slice(n.length)}function Ou(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fu(t){return typeof t!="number"?Ou(t):{top:t,right:t,bottom:t,left:t}}function ur(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 Ci(t,n,o){let{reference:r,floating:a}=t;const s=on(n),i=xi(n),l=yi(i),c=yn(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Vo(n)){case"start":h[i]-=m*(o&&d?-1:1);break;case"end":h[i]+=m*(o&&d?-1:1);break}return h}async function zu(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:m=!1,padding:h=0}=So(n,t),p=Fu(h),x=l[m?f==="floating"?"reference":"floating":f],g=ur(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})),S=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},B=ur(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:E,strategy:c}):S);return{top:(g.top-B.top+p.top)/C.y,bottom:(B.bottom-g.bottom+p.bottom)/C.y,left:(g.left-B.left+p.left)/C.x,right:(B.right-g.right+p.right)/C.x}}const Ru=50,Iu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:zu},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}=Ci(d,r,c),m=r,h=0;const p={};for(let k=0;k<s.length;k++){const x=s[k];if(!x)continue;const{name:g,fn:S}=x,{x:E,y:C,data:B,reset:w}=await S({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:p,rects:d,platform:l,elements:{reference:t,floating:n}});u=E??u,f=C??f,p[g]={...p[g],...B},w&&h<Ru&&(h++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(d=w.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):w.rects),{x:u,y:f}=Ci(d,m,c)),k=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:p}},Lu=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:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:k=!0,...x}=So(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const g=yn(a),S=on(l),E=yn(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),B=m||(E||!k?[dr(l)]:Nu(l)),w=p!=="none";!m&&w&&B.push(...vu(l,k,p,C));const y=[l,...B],b=await c.detectOverflow(n,x),_=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(b[g]),f){const v=Du(a,i,C);_.push(b[v[0]],b[v[1]])}if(V=[...V,{placement:a,overflows:_}],!_.every(v=>v<=0)){var D,N;const v=(((D=s.flip)==null?void 0:D.index)||0)+1,X=y[v];if(X&&(!(f==="alignment"?S!==on(X):!1)||V.every(Y=>on(Y.placement)===S?Y.overflows[0]>0:!0)))return{data:{index:v,overflows:V},reset:{placement:X}};let O=(N=V.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:N.placement;if(!O)switch(h){case"bestFit":{var T;const H=(T=V.filter(Y=>{if(w){const oe=on(Y.placement);return oe===S||oe==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(oe=>oe>0).reduce((oe,M)=>oe+M,0)]).sort((Y,oe)=>Y[1]-oe[1])[0])==null?void 0:T[0];H&&(O=H);break}case"initialPlacement":O=l;break}if(a!==O)return{reset:{placement:O}}}return{}}}},$u=new Set(["left","top"]);async function ju(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=yn(o),l=Vo(o),c=on(o)==="y",d=$u.has(i)?-1:1,u=s&&c?-1:1,f=So(n,t);let{mainAxis:m,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Uu=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 ju(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}}}}},Wu=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:g=>{let{x:S,y:E}=g;return{x:S,y:E}}},...d}=So(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),m=on(yn(a)),h=bi(m);let p=u[h],k=u[m];if(i){const g=h==="y"?"top":"left",S=h==="y"?"bottom":"right",E=p+f[g],C=p-f[S];p=gi(E,p,C)}if(l){const g=m==="y"?"top":"left",S=m==="y"?"bottom":"right",E=k+f[g],C=k-f[S];k=gi(E,k,C)}const x=c.fn({...n,[h]:p,[m]:k});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[h]:i,[m]:l}}}}}},Hu=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}=So(t,n),u=await i.detectOverflow(n,d),f=yn(a),m=Vo(a),h=on(a)==="y",{width:p,height:k}=s.floating;let x,g;f==="top"||f==="bottom"?(x=f,g=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,x=m==="end"?"top":"bottom");const S=k-u.top-u.bottom,E=p-u.left-u.right,C=Qn(k-u[x],S),B=Qn(p-u[g],E),w=!n.middlewareData.shift;let y=C,b=B;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=E),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(y=S),w&&!m){const V=Vt(u.left,0),D=Vt(u.right,0),N=Vt(u.top,0),T=Vt(u.bottom,0);h?b=p-2*(V!==0||D!==0?V+D:Vt(u.left,u.right)):y=k-2*(N!==0||T!==0?N+T:Vt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:y});const _=await i.getDimensions(l.floating);return p!==_.width||k!==_.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<"u"}function On(t){return Da(t)?(t.nodeName||"").toLowerCase():"#document"}function At(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Xt(t){var n;return(n=(Da(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Da(t){return fr()?t instanceof Node||t instanceof At(t).Node:!1}function Ut(t){return fr()?t instanceof Element||t instanceof At(t).Element:!1}function rn(t){return fr()?t instanceof HTMLElement||t instanceof At(t).HTMLElement:!1}function Ei(t){return!fr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof At(t).ShadowRoot}function Ao(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Wt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function qu(t){return/^(table|td|th)$/.test(On(t))}function mr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Gu=/transform|translate|scale|rotate|perspective|filter/,Xu=/paint|layout|strict|content/,Fn=t=>!!t&&t!=="none";let Na;function Ma(t){const n=Ut(t)?Wt(t):t;return Fn(n.transform)||Fn(n.translate)||Fn(n.scale)||Fn(n.rotate)||Fn(n.perspective)||!Ta()&&(Fn(n.backdropFilter)||Fn(n.filter))||Gu.test(n.willChange||"")||Xu.test(n.contain||"")}function Ku(t){let n=xn(t);for(;rn(n)&&!Zn(n);){if(Ma(n))return n;if(mr(n))return null;n=xn(n)}return null}function Ta(){return Na==null&&(Na=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Na}function Zn(t){return/^(html|body|#document)$/.test(On(t))}function Wt(t){return At(t).getComputedStyle(t)}function hr(t){return Ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xn(t){if(On(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ei(t)&&t.host||Xt(t);return Ei(n)?n.host:n}function Bi(t){const n=xn(t);return Zn(n)?t.ownerDocument?t.ownerDocument.body:t.body:rn(n)&&Ao(n)?n:Bi(n)}function Do(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Bi(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=At(a);if(s){const l=Pa(i);return n.concat(i,i.visualViewport||[],Ao(a)?a:[],l&&o?Do(l):[])}else return n.concat(a,Do(a,[],o))}function Pa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _i(t){const n=Wt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=rn(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=lr(o)!==s||lr(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function va(t){return Ut(t)?t:t.contextElement}function eo(t){const n=va(t);if(!rn(n))return Gt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=_i(n);let i=(s?lr(o.width):o.width)/r,l=(s?lr(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Yu=Gt(0);function Si(t){const n=At(t);return!Ta()||!n.visualViewport?Yu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ju(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==At(t)?!1:n}function zn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=va(t);let i=Gt(1);n&&(r?Ut(r)&&(i=eo(r)):i=eo(t));const l=Ju(s,o,r)?Si(s):Gt(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 m=At(s),h=r&&Ut(r)?At(r):r;let p=m,k=Pa(p);for(;k&&r&&h!==p;){const x=eo(k),g=k.getBoundingClientRect(),S=Wt(k),E=g.left+(k.clientLeft+parseFloat(S.paddingLeft))*x.x,C=g.top+(k.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,f*=x.y,c+=E,d+=C,p=At(k),k=Pa(p)}}return ur({width:u,height:f,x:c,y:d})}function pr(t,n){const o=hr(t).scrollLeft;return n?n.left+o:zn(Xt(t)).left+o}function Vi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-pr(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=Xt(r),l=n?mr(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=rn(r);if((f||!f&&!s)&&((On(r)!=="body"||Ao(i))&&(c=hr(r)),f)){const h=zn(r);d=eo(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const m=i&&!f&&!s?Vi(i,c):Gt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:o.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Zu(t){return Array.from(t.getClientRects())}function ef(t){const n=Xt(t),o=hr(t),r=t.ownerDocument.body,a=Vt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=Vt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+pr(t);const l=-o.scrollTop;return Wt(r).direction==="rtl"&&(i+=Vt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const Ai=25;function tf(t,n){const o=At(t),r=Xt(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=Ta();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=pr(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(r.clientWidth-f.clientWidth-h);p<=Ai&&(s-=p)}else d<=Ai&&(s+=d);return{width:s,height:i,x:l,y:c}}function nf(t,n){const o=zn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=rn(t)?eo(t):Gt(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 Di(t,n,o){let r;if(n==="viewport")r=tf(t,o);else if(n==="document")r=ef(Xt(t));else if(Ut(n))r=nf(n,o);else{const a=Si(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return ur(r)}function Ni(t,n){const o=xn(t);return o===n||!Ut(o)||Zn(o)?!1:Wt(o).position==="fixed"||Ni(o,n)}function of(t,n){const o=n.get(t);if(o)return o;let r=Do(t,[],!1).filter(l=>Ut(l)&&On(l)!=="body"),a=null;const s=Wt(t).position==="fixed";let i=s?xn(t):t;for(;Ut(i)&&!Zn(i);){const l=Wt(i),c=Ma(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ao(i)&&!c&&Ni(t,i))?r=r.filter(u=>u!==i):a=l,i=xn(i)}return n.set(t,r),r}function rf(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?mr(n)?[]:of(n,this._c):[].concat(o),r],l=Di(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let m=1;m<i.length;m++){const h=Di(n,i[m],a);c=Vt(h.top,c),d=Qn(h.right,d),u=Qn(h.bottom,u),f=Vt(h.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function af(t){const{width:n,height:o}=_i(t);return{width:n,height:o}}function sf(t,n,o){const r=rn(n),a=Xt(n),s=o==="fixed",i=zn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);function d(){c.x=pr(a)}if(r||!r&&!s)if((On(n)!=="body"||Ao(a))&&(l=hr(n)),r){const h=zn(n,!0,s,n);c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?Vi(a,l):Gt(0),f=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function Oa(t){return Wt(t).position==="static"}function Mi(t,n){if(!rn(t)||Wt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Xt(t)===o&&(o=o.ownerDocument.body),o}function Ti(t,n){const o=At(t);if(mr(t))return o;if(!rn(t)){let a=xn(t);for(;a&&!Zn(a);){if(Ut(a)&&!Oa(a))return a;a=xn(a)}return o}let r=Mi(t,n);for(;r&&qu(r)&&Oa(r);)r=Mi(r,n);return r&&Zn(r)&&Oa(r)&&!Ma(r)?o:r||Ku(t)||o}const lf=async function(t){const n=this.getOffsetParent||Ti,o=this.getDimensions,r=await o(t.floating);return{reference:sf(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cf(t){return Wt(t).direction==="rtl"}const df={convertOffsetParentRelativeRectToViewportRelativeRect:Qu,getDocumentElement:Xt,getClippingRect:rf,getOffsetParent:Ti,getElementRects:lf,getClientRects:Zu,getDimensions:af,getScale:eo,isElement:Ut,isRTL:cf};function Pi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function uf(t,n){let o=null,r;const a=Xt(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:m,height:h}=d;if(l||n(),!m||!h)return;const p=cr(f),k=cr(a.clientWidth-(u+m)),x=cr(a.clientHeight-(f+h)),g=cr(u),E={rootMargin:-p+"px "+-k+"px "+-x+"px "+-g+"px",threshold:Vt(0,Qn(1,c))||1};let C=!0;function B(w){const y=w[0].intersectionRatio;if(y!==c){if(!C)return i();y?i(!1,y):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y===1&&!Pi(d,t.getBoundingClientRect())&&i(),C=!1}try{o=new IntersectionObserver(B,{...E,root:a.ownerDocument})}catch{o=new IntersectionObserver(B,E)}o.observe(t)}return i(!0),s}function Fa(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=va(t),u=a||s?[...d?Do(d):[],...n?Do(n):[]]:[];u.forEach(g=>{a&&g.addEventListener("scroll",o,{passive:!0}),s&&g.addEventListener("resize",o)});const f=d&&l?uf(d,o):null;let m=-1,h=null;i&&(h=new ResizeObserver(g=>{let[S]=g;S&&S.target===d&&h&&n&&(h.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=h)==null||E.observe(n)})),o()}),d&&!c&&h.observe(d),n&&h.observe(n));let p,k=c?zn(t):null;c&&x();function x(){const g=zn(t);k&&!Pi(k,g)&&o(),k=g,p=requestAnimationFrame(x)}return o(),()=>{var g;u.forEach(S=>{a&&S.removeEventListener("scroll",o),s&&S.removeEventListener("resize",o)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const za=Uu,Ra=Wu,Ia=Lu,La=Hu,ff=(t,n,o)=>{const r=new Map,a={platform:df,...o},s={...a.platform,_c:r};return Iu(t,n,{...a,platform:s})};function mf(t){return t!=null&&typeof t=="object"&&"$el"in t}function vi(t){if(mf(t)){const n=t.$el;return Da(n)&&On(n)==="#comment"?null:n}return t}function No(t){return typeof t=="function"?t():e.unref(t)}function Oi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Fi(t,n){const o=Oi(t);return Math.round(n*o)/o}function $a(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var y;return(y=No(o.open))!=null?y:!0}),s=e.computed(()=>No(o.middleware)),i=e.computed(()=>{var y;return(y=No(o.placement))!=null?y:"bottom"}),l=e.computed(()=>{var y;return(y=No(o.strategy))!=null?y:"absolute"}),c=e.computed(()=>{var y;return(y=No(o.transform))!=null?y:!0}),d=e.computed(()=>vi(t.value)),u=e.computed(()=>vi(n.value)),f=e.ref(0),m=e.ref(0),h=e.ref(l.value),p=e.ref(i.value),k=e.shallowRef({}),x=e.ref(!1),g=e.computed(()=>{const y={position:h.value,left:"0",top:"0"};if(!u.value)return y;const b=Fi(u.value,f.value),_=Fi(u.value,m.value);return c.value?{...y,transform:"translate("+b+"px, "+_+"px)",...Oi(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:b+"px",top:_+"px"}});let S;function E(){if(d.value==null||u.value==null)return;const y=a.value;ff(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,m.value=b.y,h.value=b.strategy,p.value=b.placement,k.value=b.middlewareData,x.value=y!==!1})}function C(){typeof S=="function"&&(S(),S=void 0)}function B(){if(C(),r===void 0){E();return}if(d.value!=null&&u.value!=null){S=r(d.value,u.value,E);return}}function w(){a.value||(x.value=!1)}return e.watch([s,i,l,a],E,{flush:"sync"}),e.watch([d,u],B,{flush:"sync"}),e.watch(a,w,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(C),{x:e.shallowReadonly(f),y:e.shallowReadonly(m),strategy:e.shallowReadonly(h),placement:e.shallowReadonly(p),middlewareData:e.shallowReadonly(k),isPositioned:e.shallowReadonly(x),floatingStyles:g,update:E}}const hf=["aria-busy"],pf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},gf=["for"],bf={key:0,class:"ml-1 text-destructive"},yf={class:"relative"},xf={key:0,class:"flex items-center text-gray-500 gap-2"},kf=["id","placeholder","disabled","readonly","value"],wf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Cf=["disabled"],Ef={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Bf=["onMouseenter","onClick"],_f={key:0},Sf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Vf={key:0},Af={key:1},Df={key:2},Nf={key:1,class:"mt-1 text-xs text-red-600"},gr=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=G=>{const ue=a[G];return ue===""||ue===!0||ue==="true"||ue===1||ue==="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")),m=e.computed(()=>i("readonly")),h=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=e.computed(()=>f.value||i("aria-required")),k=e.computed(()=>o.error||o.errorMessage||a["error-message"]),x=e.computed(()=>a.placeholder??""),g=e.computed(()=>{const G=a.minChars??a["min-chars"];if(G==null||G==="")return 0;const ue=typeof G=="number"?G:Number.parseInt(String(G),10);return Number.isFinite(ue)&&ue>0?ue:0}),S=e.computed(()=>{const G=a.rules;return Array.isArray(G)?G:[]}),E=e.computed(()=>{const G=a.id||a.label;return G?`app-autocomplete-${G}-${Math.random().toString(36).slice(2,7)}`:void 0}),C=e.ref(o.modelValue),B=e.ref([]),w=e.ref(!1),y=e.ref(!1),b=e.computed(()=>a.items),_=e.computed(()=>{const G=v.value;return G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems?B.value:b.value??[]}),V=e.computed(()=>!!a.loading),D=e.computed(()=>V.value||w.value),N=e.computed(()=>{const{label:G,items:ue,loading:Ee,rules:Ue,"item-title":Me,"item-value":te,itemTitle:ce,itemValue:he,minChars:Se,"min-chars":et,clearable:St,required:gn,"aria-required":ko,disabled:wo,readonly:Ca,visible:gt,"return-object":sr,returnObject:Co,class:Ea,"fetch-items":Eo,fetchItems:Ba,error:Bo,errorMessage:ir,"error-message":P,...j}=a||{};return j}),T=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},v=e.computed(()=>{const G=o.endpoint||{};return{apiModule:o.apiModule||G.apiModule,apiAction:o.apiAction||G.apiAction,apiUrl:G.apiUrl,apiMethod:G.apiMethod||"GET"}}),X=e.ref(null),O=e.ref(null),H=e.ref(null),{floatingStyles:Y}=$a(O,H,{placement:"bottom-start",whileElementsMounted:Fa,middleware:[za(4),Ia(),Ra(),La({apply({rects:G,elements:ue,availableHeight:Ee}){Object.assign(ue.floating.style,{width:`${G.reference.width}px`,maxHeight:`${Ee}px`})}})]}),oe=e.ref(!1),M=e.ref(""),L=e.ref(-1),ee=e.ref(null),Q=e.computed(()=>!g.value||(M.value||"").trim().length>=g.value?"":`Ketik minimal ${g.value} karakter`),W=G=>{if(G==null)return"";if(typeof G=="string"||typeof G=="number")return String(G);const ue=c.value;return typeof ue=="function"?ue(G):(G==null?void 0:G[ue])??(G==null?void 0:G.name)??(G==null?void 0:G.nama)??(G==null?void 0:G.label)??(G==null?void 0:G.title)??"-"},ie=G=>{if(G==null)return null;if(typeof G=="string"||typeof G=="number")return G;const ue=d.value;return typeof ue=="function"?ue(G):(G==null?void 0:G[ue])??(G==null?void 0:G.id)??(G==null?void 0:G.value)??(G==null?void 0:G.code)??null},de=e.computed(()=>{const G=C.value;if(G==null||G==="")return"";if(Array.isArray(G))return G.length?G.map(Ue=>{if(h.value&&typeof Ue=="object"||typeof Ue=="object")return W(Ue);const Me=_.value.find(te=>ie(te)==Ue);return Me?W(Me):String(Ue)}).join(", "):"";if(typeof G=="object")return W(G);const ue=_.value.find(Ee=>ie(Ee)==G);return ue?W(ue):String(G)}),Ce=e.computed(()=>{const G=_.value||[],ue=(M.value||"").trim().toLowerCase(),Ee=(de.value||"").toLowerCase(),Ue=!ue||ue===Ee;let Me=G;if(Ue||(Me=G.filter(te=>W(te).toLowerCase().includes(ue))),Me.length>0){const te=ce=>{const he=ie(ce);return Array.isArray(C.value)?C.value.some(Se=>Se==he):C.value==he};Me=[...Me].sort((ce,he)=>{const Se=te(ce),et=te(he);return Se&&!et?-1:!Se&&et?1:0})}return Me}),Ne=G=>Array.isArray(G)?G.length===0:G==null||G==="",be=G=>{if(ee.value=null,f.value&&Ne(G)&&!S.value.length)return ee.value="This field is required",!1;for(const ue of S.value){const Ee=ue(G);if(Ee===!1)return ee.value="Invalid value",!1;if(typeof Ee=="string")return ee.value=Ee,!1}return!0},J=async()=>{if(u.value||m.value)return;oe.value=!0,L.value=Ce.value.length?0:-1,M.value=de.value||"";const G=v.value,ue=G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ue&&!y.value&&(await He(),L.value=Ce.value.length?0:-1)},F=()=>{oe.value=!1,L.value=-1,M.value=de.value||""},K=G=>{const ue=h.value?G:ie(G);let Ee=ue;Array.isArray(C.value)&&(Ee=[ue]),C.value=Ee,r("update:modelValue",Ee),ee.value=null,be(Ee),M.value=W(G),F()},ae=()=>{B.value=[],y.value=!1,C.value=Array.isArray(C.value)?[]:null,r("update:modelValue",C.value),M.value="",ee.value=null},_e=()=>{l.value=!0,ae(),F(),setTimeout(()=>{l.value=!1},0)},Re=G=>{if(u.value||m.value)return;const ue=G.target.value;M.value=ue,ee.value&&(ee.value=null),oe.value||(oe.value=!0),L.value=Ce.value.length?0:-1;const Ee=v.value.apiModule&&v.value.apiAction||v.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&Ee&&!D.value&&!y.value&&He()},ze=G=>{var Ee;if(u.value||m.value)return;const ue={ArrowDown:()=>{if(G.preventDefault(),!oe.value){J();return}Ce.value.length&&(L.value=Math.min(L.value+1,Ce.value.length-1))},ArrowUp:()=>{!oe.value||!Ce.value.length||(G.preventDefault(),L.value=Math.max(L.value-1,0))},Enter:()=>{if(!oe.value)return;G.preventDefault();const Ue=Ce.value[L.value];Ue&&K(Ue)},Escape:()=>{G.preventDefault(),F()},Tab:()=>{F()}};(Ee=ue[G.key])==null||Ee.call(ue)},He=async()=>{const G=v.value;if(G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems){w.value=!0;try{let Ee;if(o.fetchItems){const Ue=T()||{},Me={page:1,perPage:100,search:(M.value||"").trim(),...Ue,...o.apiParams},te=await o.fetchItems(Me),ce=(te==null?void 0:te.data)??te;Ee=(ce==null?void 0:ce.data)??ce}else{const Me=ct().DCodeApi;if(typeof Me!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const ce={page:1,perPage:100,...T()||{},...o.apiParams};let he;G.apiUrl?he=await Me("","",ce,{_url:G.apiUrl,_method:G.apiMethod||"POST"}):he=await Me(G.apiModule,G.apiAction,ce);const Se=(he==null?void 0:he.data)??he;Ee=(Se==null?void 0:Se.data)??Se}B.value=Array.isArray(Ee)?Ee:[],y.value=!0}catch(Ee){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",Ee),ee.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(Ee==null?void 0:Ee.message)||(Ee==null?void 0:Ee.toString())||"Failed to load options"}`,B.value=[],y.value=!0}finally{w.value=!1}}},Xe=G=>{const ue=ie(G);return h.value?C.value?Array.isArray(C.value)?C.value.some(Ee=>ie(Ee)==ue):ie(C.value)==ue:!1:Array.isArray(C.value)?C.value.some(Ee=>Ee==ue):C.value==ue};e.watch(()=>[T(),v.value,o.apiParams],([G,ue,Ee],[Ue,Me,te])=>{const ce=v.value;if(!(ce.apiModule&&ce.apiAction||ce.apiUrl||o.fetchItems)){ae();return}const Se=JSON.stringify(G??null)===JSON.stringify(Ue??null),et=JSON.stringify(Ee??null)===JSON.stringify(te??null);Se&&et||(ae(),et||He())},{deep:!0}),e.watch(()=>o.modelValue,(G,ue)=>{C.value=G,!l.value&&(G==null||G==="")&&ue!=null&&o.apiModule&&o.apiAction&&(B.value=[],y.value=!1),M.value=de.value||""},{immediate:!0});const ot=v.value;(ot.apiModule&&ot.apiAction||ot.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!Ne(o.modelValue))&&He();const mt=G=>{const ue=X.value,Ee=H.value,Ue=G.target;ue&&ue.contains(Ue)||Ee&&Ee.contains(Ue)||oe.value&&F()},pt=e.computed(()=>{const G=o.modelValue;return G==null?!1:typeof G=="string"?G.trim().length>0:Array.isArray(G)?G.length>0:typeof G=="object"?Object.keys(G).length>0:!0}),Tt=e.computed(()=>!!o.clearable&&pt.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",mt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",mt)}),(G,ue)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:X,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",pf)):e.createCommentVNode("",!0),ue[6]||(ue[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:E.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),p.value?(e.openBlock(),e.createElementBlock("span",bf,"*")):e.createCommentVNode("",!0)],8,gf)):e.createCommentVNode("",!0),e.createElementVNode("div",yf,[e.createElementVNode("div",{ref_key:"reference",ref:O,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||m.value?"opacity-60 cursor-not-allowed":"",ee.value||k.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||G.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",xf,[e.renderSlot(G.$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:E.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||m.value?"cursor-not-allowed":"cursor-text"],placeholder:x.value,disabled:u.value,readonly:m.value,value:oe.value?M.value:de.value||M.value,onFocus:ue[0]||(ue[0]=()=>{oe.value||J()}),onClick:ue[1]||(ue[1]=()=>{oe.value||J()}),onInput:Re,onKeydown:ze,onBlur:ue[2]||(ue[2]=()=>be(C.value))}),null,16,kf),D.value?(e.openBlock(),e.createElementBlock("svg",wf,[...ue[7]||(ue[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)])])):Tt.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:ue[3]||(ue[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(_e,["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||m.value,onClick:ue[4]||(ue[4]=Ee=>oe.value?F():J()),"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":oe.value}])},null,8,["class"])],8,Cf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[oe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:H,style:e.normalizeStyle(e.unref(Y)),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",Ef,[Ce.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ce.value,(Ee,Ue)=>(e.openBlock(),e.createElementBlock("button",{key:ie(Ee)??Ue,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",Ue===L.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Me=>L.value=Ue,onMousedown:ue[5]||(ue[5]=e.withModifiers(()=>{},["prevent"])),onClick:Me=>K(Ee)},[e.createTextVNode(e.toDisplayString(W(Ee))+" ",1),Xe(Ee)?(e.openBlock(),e.createElementBlock("span",_f," ✓ ")):e.createCommentVNode("",!0)],42,Bf))),128)):e.renderSlot(G.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",Sf,[D.value?(e.openBlock(),e.createElementBlock("span",Vf,"Loading data…")):Q.value?(e.openBlock(),e.createElementBlock("span",Af,e.toDisplayString(Q.value),1)):(e.openBlock(),e.createElementBlock("span",Df,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),ee.value||k.value?(e.openBlock(),e.createElementBlock("p",Nf,e.toDisplayString(ee.value||k.value),1)):e.createCommentVNode("",!0)],64))],10,hf)),[[e.vShow,t.visible]])}}),Mf=["aria-busy"],Tf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Pf=["for"],vf={key:0,class:"ml-1 text-destructive"},Of={class:"relative"},Ff={key:0,class:"flex items-center text-gray-500 gap-2"},zf=["id","placeholder","disabled","value"],Rf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},If=["disabled"],Lf={key:0,class:"p-3 space-y-2"},$f=["onMouseenter","onClick"],jf={class:"flex items-center space-x-3"},Uf={class:"flex-1"},Wf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Hf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},qf={key:0},Gf={key:2,class:"p-3 text-center"},Xf={class:"inline-flex items-center space-x-2"},Kf={class:"text-sm text-gray-500"},Yf={key:3,class:"p-3 text-center"},Jf={class:"text-xs text-gray-400"},Qf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Zf={key:1,class:"mt-1 text-xs text-red-600"},em={key:2,class:"mt-1 text-xs text-gray-500"},zi=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 L=o.label||o.placeholder;return L?`app-infinite-autocomplete-${L}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),m=e.ref([]),h=e.ref(!1),p=e.ref(!1),k=e.ref(-1),x=e.ref(1),g=e.ref(!0),S=e.ref(0),E=e.ref(),{floatingStyles:C}=$a(c,d,{placement:"bottom-start",whileElementsMounted:Fa,middleware:[za(4),Ia(),Ra(),La({apply({rects:L,elements:ee}){Object.assign(ee.floating.style,{width:`${L.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const B=e.computed(()=>f.value?m.value.filter(L=>_(L).toLowerCase().includes(f.value.toLowerCase())):m.value),w=e.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return _(o.modelValue);{const L=m.value.find(ee=>V(ee)===o.modelValue);return L?_(L):String(o.modelValue)}}return""}),y=()=>{p.value=!0},b=()=>{p.value=!1},_=L=>typeof o.itemTitle=="function"?o.itemTitle(L):L[o.itemTitle]||"",V=L=>typeof o.itemValue=="function"?o.itemValue(L):L[o.itemValue]||L,D=L=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(L):L[o.itemSubtitle]||"":"",N=L=>o.modelValue?o.returnObject?V(L)===V(o.modelValue):V(L)===o.modelValue:!1,T=L=>{var Q;const ee=o.returnObject?L:V(L);r("update:modelValue",ee),r("select",L),p.value=!1,f.value="",(Q=s.value)==null||Q.blur()},v=()=>{var L;r("update:modelValue",null),f.value="",(L=s.value)==null||L.focus()},X=L=>{p.value=!0,r("focus",L),o.autoFetchOnOpen&&!h.value&&(o.refreshOnOpen||m.value.length===0)&&M(!0)},O=L=>{setTimeout(()=>{p.value=!1,r("blur",L)},200)},H=L=>{const ee=L.target;f.value=ee.value,E.value&&clearTimeout(E.value),E.value=setTimeout(()=>{r("search",f.value),x.value=1,g.value=!0,M(!0)},o.debounceMs)},Y=L=>{if(p.value)switch(L.key){case"ArrowDown":L.preventDefault(),k.value=Math.min(k.value+1,B.value.length-1);break;case"ArrowUp":L.preventDefault(),k.value=Math.max(k.value-1,0);break;case"Enter":L.preventDefault(),k.value>=0&&B.value[k.value]&&T(B.value[k.value]);break;case"Escape":p.value=!1;break}},oe=L=>{if(!g.value||h.value)return;const ee=L.target,{scrollTop:Q,scrollHeight:W,clientHeight:ie}=ee;Q+ie>=W-o.threshold&&M()},M=async(L=!1)=>{var ee,Q;if(!h.value){h.value=!0;try{let W=[];if(o.fetchItems)W=await o.fetchItems();else{const ie=ct(),de=((ee=o.endpoint)==null?void 0:ee.apiModule)||o.apiModule,Ce=((Q=o.endpoint)==null?void 0:Q.apiAction)||o.apiAction;if(!de||!Ce)throw new Error("API module and action are required");const Ne={page:L?1:x.value,pageSize:o.pageSize,search:f.value,...o.apiParams},be=await ie.apiUrl(`/${de}/${Ce}`,"GET",Ne);W=be.data||be.items||be||[],S.value=be.total||be.totalItems||W.length}L?(m.value=W,x.value=1):(m.value.push(...W),x.value++),g.value=W.length>=o.pageSize,g.value||r("end-of-results"),r("load-more",{items:W,page:x.value,hasMore:g.value,total:S.value})}catch(W){console.error("Error fetching items:",W),r("error",W)}finally{h.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&M()}),e.onUnmounted(()=>{E.value&&clearTimeout(E.value)}),e.watch(()=>o.modelValue,L=>{L||(f.value="")}),(L,ee)=>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",Tf)):e.createCommentVNode("",!0),ee[3]||(ee[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,Pf)):e.createCommentVNode("",!0),e.createElementVNode("div",Of,[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",Ff,[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},L.$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:w.value,onFocus:X,onBlur:O,onInput:H,onKeydown:Y}),null,16,zf),h.value?(e.openBlock(),e.createElementBlock("svg",Rf,[...ee[4]||(ee[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:ee[0]||(ee[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(v,["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:ee[1]||(ee[1]=Q=>p.value?b():y()),"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":p.value}])},null,8,["class"])],8,If))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.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:oe},[h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Lf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Q=>e.createElementVNode("div",{key:Q,class:"flex items-center space-x-3"},[...ee[5]||(ee[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))])):B.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,(Q,W)=>(e.openBlock(),e.createElementBlock("button",{key:V(Q)??W,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",W===k.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ie=>k.value=W,onMousedown:ee[2]||(ee[2]=e.withModifiers(()=>{},["prevent"])),onClick:ie=>T(Q)},[e.renderSlot(L.$slots,"item",{item:Q,index:W},()=>[e.createElementVNode("div",jf,[e.createElementVNode("div",Uf,[e.createElementVNode("div",Wf,e.toDisplayString(_(Q)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Hf,e.toDisplayString(D(Q)),1)):e.createCommentVNode("",!0)])])]),N(Q)?(e.openBlock(),e.createElementBlock("span",qf," ✓ ")):e.createCommentVNode("",!0)],42,$f))),128)):e.createCommentVNode("",!0),h.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Gf,[e.createElementVNode("div",Xf,[ee[6]||(ee[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Kf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!g.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Yf,[e.createElementVNode("div",Jf,e.toDisplayString(t.endOfResultsText),1)])):!h.value&&m.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",Zf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",em,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Mf)),[[e.vShow,t.visible]])}});function Ri(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=Ri(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Ii(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Ri(t))&&(r&&(r+=" "),r+=n);return r}const tm=(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},nm=(t,n)=>({classGroupId:t,validator:n}),Li=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),br="-",$i=[],om="arbitrary..",rm=t=>{const n=sm(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return am(i);const l=i.split(br),c=l[0]===""&&l.length>1?1:0;return ji(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?tm(d,c):c:d||$i}return o[i]||$i}}},ji=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=ji(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(br):t.slice(n).join(br),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},am=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?om+r:void 0})(),sm=t=>{const{theme:n,classGroups:o}=t;return im(o,n)},im=(t,n)=>{const o=Li();for(const r in t){const a=t[r];ja(a,o,r,n)}return o},ja=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];lm(i,n,o,r)}},lm=(t,n,o,r)=>{if(typeof t=="string"){cm(t,n,o);return}if(typeof t=="function"){dm(t,n,o,r);return}um(t,n,o,r)},cm=(t,n,o)=>{const r=t===""?n:Ui(n,t);r.classGroupId=o},dm=(t,n,o,r)=>{if(fm(t)){ja(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(nm(o,t))},um=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];ja(c,Ui(n,l),o,r)}},Ui=(t,n)=>{let o=t;const r=n.split(br),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Li(),o.nextPart.set(i,l)),o=l}return o},fm=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,mm=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)}}},Ua="!",Wi=":",hm=[],Hi=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),pm=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 k=0;k<u;k++){const x=a[k];if(i===0&&l===0){if(x===Wi){s.push(a.slice(c,k)),c=k+1;continue}if(x==="/"){d=k;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const f=s.length===0?a:a.slice(c);let m=f,h=!1;f.endsWith(Ua)?(m=f.slice(0,-1),h=!0):f.startsWith(Ua)&&(m=f.slice(1),h=!0);const p=d&&d>c?d-c:void 0;return Hi(s,h,m,p)};if(n){const a=n+Wi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Hi(hm,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},gm=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}},bm=t=>({cache:mm(t.cacheSize),parseClassName:pm(t),sortModifiers:gm(t),...rm(t)}),ym=/\s+/,xm=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(ym);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:m,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:k}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let x=!!k,g=r(x?p.substring(0,k):p);if(!g){if(!x){c=u+(c.length>0?" "+c:c);continue}if(g=r(p),!g){c=u+(c.length>0?" "+c:c);continue}x=!1}const S=m.length===0?"":m.length===1?m[0]:s(m).join(":"),E=h?S+Ua:S,C=E+g;if(i.indexOf(C)>-1)continue;i.push(C);const B=a(g,x);for(let w=0;w<B.length;++w){const y=B[w];i.push(E+y)}c=u+(c.length>0?" "+c:c)}return c},km=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=qi(o))&&(a&&(a+=" "),a+=r);return a},qi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=qi(t[r]))&&(o&&(o+=" "),o+=n);return o},wm=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=bm(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=xm(c,o);return a(c,u),u};return s=i,(...c)=>s(km(...c))},Cm=[],ut=t=>{const n=o=>o[t]||Cm;return n.isThemeGetter=!0,n},Gi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Em=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_m=/\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$/,Sm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Am=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kn=t=>Em.test(t),Pe=t=>!!t&&!Number.isNaN(Number(t)),wn=t=>!!t&&Number.isInteger(Number(t)),Wa=t=>t.endsWith("%")&&Pe(t.slice(0,-1)),an=t=>Bm.test(t),Ki=()=>!0,Dm=t=>_m.test(t)&&!Sm.test(t),Ha=()=>!1,Nm=t=>Vm.test(t),Mm=t=>Am.test(t),Tm=t=>!ye(t)&&!xe(t),Pm=t=>Cn(t,tl,Ha),ye=t=>Gi.test(t),Rn=t=>Cn(t,nl,Dm),Yi=t=>Cn(t,$m,Pe),vm=t=>Cn(t,rl,Ki),Om=t=>Cn(t,ol,Ha),Ji=t=>Cn(t,Zi,Ha),Fm=t=>Cn(t,el,Mm),yr=t=>Cn(t,al,Nm),xe=t=>Xi.test(t),Mo=t=>In(t,nl),zm=t=>In(t,ol),Qi=t=>In(t,Zi),Rm=t=>In(t,tl),Im=t=>In(t,el),xr=t=>In(t,al,!0),Lm=t=>In(t,rl,!0),Cn=(t,n,o)=>{const r=Gi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},In=(t,n,o=!1)=>{const r=Xi.exec(t);return r?r[1]?n(r[1]):o:!1},Zi=t=>t==="position"||t==="percentage",el=t=>t==="image"||t==="url",tl=t=>t==="length"||t==="size"||t==="bg-size",nl=t=>t==="length",$m=t=>t==="number",ol=t=>t==="family-name",rl=t=>t==="number"||t==="weight",al=t=>t==="shadow",jm=wm(()=>{const t=ut("color"),n=ut("font"),o=ut("text"),r=ut("font-weight"),a=ut("tracking"),s=ut("leading"),i=ut("breakpoint"),l=ut("container"),c=ut("spacing"),d=ut("radius"),u=ut("shadow"),f=ut("inset-shadow"),m=ut("text-shadow"),h=ut("drop-shadow"),p=ut("blur"),k=ut("perspective"),x=ut("aspect"),g=ut("ease"),S=ut("animate"),E=()=>["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"],B=()=>[...C(),xe,ye],w=()=>["auto","hidden","clip","visible","scroll"],y=()=>["auto","contain","none"],b=()=>[xe,ye,c],_=()=>[kn,"full","auto",...b()],V=()=>[wn,"none","subgrid",xe,ye],D=()=>["auto",{span:["full",wn,xe,ye]},wn,xe,ye],N=()=>[wn,"auto",xe,ye],T=()=>["auto","min","max","fr",xe,ye],v=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...b()],H=()=>[kn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],Y=()=>[kn,"screen","full","dvw","lvw","svw","min","max","fit",...b()],oe=()=>[kn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],M=()=>[t,xe,ye],L=()=>[...C(),Qi,Ji,{position:[xe,ye]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",Rm,Pm,{size:[xe,ye]}],W=()=>[Wa,Mo,Rn],ie=()=>["","none","full",d,xe,ye],de=()=>["",Pe,Mo,Rn],Ce=()=>["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"],be=()=>[Pe,Wa,Qi,Ji],J=()=>["","none",p,xe,ye],F=()=>["none",Pe,xe,ye],K=()=>["none",Pe,xe,ye],ae=()=>[Pe,xe,ye],_e=()=>[kn,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[an],breakpoint:[an],color:[Ki],container:[an],"drop-shadow":[an],ease:["in","out","in-out"],font:[Tm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[an],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[an],shadow:[an],spacing:["px",Pe],text:[an],"text-shadow":[an],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kn,ye,xe,x]}],container:["container"],columns:[{columns:[Pe,ye,xe,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:B()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:y()}],"overscroll-x":[{"overscroll-x":y()}],"overscroll-y":[{"overscroll-y":y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[wn,"auto",xe,ye]}],basis:[{basis:[kn,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,kn,"auto","initial","none",ye]}],grow:[{grow:["",Pe,xe,ye]}],shrink:[{shrink:["",Pe,xe,ye]}],order:[{order:[wn,"first","last","none",xe,ye]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:D()}],"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":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...v(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...v()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":v()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],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:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"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",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],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,Mo,Rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Lm,vm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wa,ye]}],"font-family":[{font:[zm,Om,n]}],"font-features":[{"font-features":[ye]}],"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,xe,ye]}],"line-clamp":[{"line-clamp":[Pe,"none",xe,Yi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",xe,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",xe,Rn]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Pe,"auto",xe,ye]}],"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",xe,ye]}],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",xe,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wn,xe,ye],radial:["",xe,ye],conic:[wn,xe,ye]},Im,Fm]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],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:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,xe,ye]}],"outline-w":[{outline:["",Pe,Mo,Rn]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,xr,yr]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",f,xr,yr]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Pe,Rn]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",m,xr,yr]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Pe,xe,ye]}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[xe,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ye]}],filter:[{filter:["","none",xe,ye]}],blur:[{blur:J()}],brightness:[{brightness:[Pe,xe,ye]}],contrast:[{contrast:[Pe,xe,ye]}],"drop-shadow":[{"drop-shadow":["","none",h,xr,yr]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Pe,xe,ye]}],"hue-rotate":[{"hue-rotate":[Pe,xe,ye]}],invert:[{invert:["",Pe,xe,ye]}],saturate:[{saturate:[Pe,xe,ye]}],sepia:[{sepia:["",Pe,xe,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ye]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,xe,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,xe,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,xe,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,xe,ye]}],"backdrop-invert":[{"backdrop-invert":["",Pe,xe,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,xe,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,xe,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,xe,ye]}],"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",xe,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",xe,ye]}],ease:[{ease:["linear","initial",g,xe,ye]}],delay:[{delay:[Pe,xe,ye]}],animate:[{animate:["none",S,xe,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xe,ye]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[xe,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",xe,ye]}],"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",xe,ye]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Pe,Mo,Rn,Yi]}],stroke:[{stroke:["none",...M()]}],"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 Oe(...t){return jm(Ii(t))}function sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qa={},Ga={},kr={exports:{}},il;function Um(){if(il)return kr.exports;il=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 kr.exports=n(),kr.exports.createColors=n,kr.exports}var ll;function Wm(){return ll||(ll=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(Um());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(m=>console.warn(d,"-",m)))}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])}}})(Ga)),Ga}var cl;function Hm(){return cl||(cl=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Wm());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}}})(qa)),qa}var Xa,dl;function qm(){if(dl)return Xa;dl=1;let t=Hm();return Xa=(t.__esModule?t:{default:t}).default,Xa}var Gm=qm();const Xm=sl(Gm),ul=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fl=Ii,wr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return fl(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 m=ul(u)||ul(f);return a[d][m]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(p=>{let[k,x]=p;return Array.isArray(x)?x.includes({...s,...l}[k]):{...s,...l}[k]===x})?[...d,f,m]:d},[]);return fl(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Ht=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(Be.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(Oe)(e.unref(to)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),to=wr("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"}}),ml=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=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),hl=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=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Oe)("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}))}}),pl=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(Be.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),gl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Km={class:"relative z-10"},Ym="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",Jm=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&&$t[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Q=String(o.variant||"default").toLowerCase();return Q==="tonal"?"secondary":Q==="elevated"?"default":Q}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Q,...W}=n;return W}),u=e.computed(()=>Oe(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),m=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),h=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=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}`:""),k=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(()=>Oe("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,m.value,h.value,f.value)),g=e.computed(()=>{const W=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),S=e.computed(()=>{const W=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),E=e.computed(()=>!!g.value),C=e.computed(()=>/\bborder-/.test(u.value??"")),B=e.computed(()=>/\bhover:/.test(u.value??"")),w=e.computed(()=>{const Q=u.value??"";return i.value!=="outline"?Q:Q.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),y=e.ref(null),b=Q=>{const W=Q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return W?{r:Number(W[1]),g:Number(W[2]),b:Number(W[3]),a:W[4]?Number(W[4]):1}:null},_=(Q,W)=>{const ie=b(Q);if(!ie)return Q;const de=Ce=>Math.max(0,Math.min(255,Math.round(Ce)));return`rgba(${de(ie.r*(1-W))}, ${de(ie.g*(1-W))}, ${de(ie.b*(1-W))}, ${ie.a})`},V=Q=>{if(globalThis.window===void 0)return null;const W=document.createElement("div");W.className=Q,W.style.position="absolute",W.style.visibility="hidden",W.style.pointerEvents="none",W.style.width="1px",W.style.height="1px",document.body.appendChild(W);const ie=globalThis.getComputedStyle(W).backgroundColor;return W.remove(),!ie||ie==="transparent"||ie==="rgba(0, 0, 0, 0)"?null:ie},D=[50,100,200,300,400,500,600,700,800,900,950],N=Q=>{const W=D.indexOf(Q);return W===-1?Q:D[Math.min(D.length-1,W+2)]},T=(Q,W)=>{const ie=Xm[Q];if(!ie)return null;if(typeof ie=="string")return ie;if(!W)return null;const de=ie[W];return typeof de=="string"?de:null},v=(Q,W=!1)=>{if(!Q)return null;const ie=W?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,de=Q.match(ie);return de?{colorName:de[1],shade:de[2]?Number.parseInt(de[2],10):null}:null},X=()=>{const Q=g.value;if(!Q){y.value=null;return}const W=v(Q),ie=W==null?void 0:W.colorName,de=(W==null?void 0:W.shade)??null,Ce=(ie?T(ie,de):null)??V(Q);if(!Ce){y.value=null;return}let Ne;const be=v(S.value,!0),J=be?T(be.colorName,be.shade??null):null;if(J)Ne=J;else if(ie&&de){const F=N(de);Ne=T(ie,F)??_(Ce,.2)}else Ne=_(Ce,.2);y.value={"--btn-color":Ce,"--btn-color-hover":Ne}};e.onMounted(()=>{X()}),e.watch([g,S],async()=>{await e.nextTick(),X()});const O=e.computed(()=>{const Q=/\bdark:bg-/.test(u.value??"");return!E.value||i.value==="outline"||Q?"":y.value?"dcode-btn--fill dcode-btn--fill-hover":B.value?"":"hover:brightness-90"}),H=e.computed(()=>{if(!E.value||i.value!=="outline")return"";const Q=["dcode-btn--outline","dcode-btn--outline-hover"];return C.value||Q.push("border"),!y.value&&!B.value&&Q.push("hover:brightness-90"),Q.join(" ")}),Y=e.computed(()=>y.value??void 0),oe={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"}},M={"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"}},L=e.computed(()=>{const Q=[],W=l.value,ie=String(o.borderColor||"").toLowerCase(),de=W?oe[W]:null,Ce=W?M[W]:null,Ne=ie?oe[ie]:null;return W&&(de?Ne&&ie!==W?(Q.push(de.bg,Ne.hoverBg),o.textColor||Q.push(de.text,Ne.hoverText)):(Q.push(de.bg,de.hoverBg),o.textColor||Q.push(de.text,de.hoverText)):Ce?(Q.push(Ce.bg,Ce.hover),o.textColor||Q.push(Ce.text)):W==="transparent"?Ne?(Q.push("bg-transparent",Ne.hoverBg),o.textColor||Q.push("text-inherit",Ne.hoverText)):Q.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Q.push(W)),ie?Ne?Q.push(Ne.border,Ne.hoverBorder):Q.push(ie):de&&i.value!=="ghost"&&i.value!=="link"&&Q.push(de.border,de.hoverBorder),o.textColor&&Q.push(o.textColor),Q.join(" ")}),ee=e.computed(()=>Oe(Ym,p.value,k.value,w.value,O.value,H.value,L.value));return(Q,W)=>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(pl),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ml),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ht),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:Y.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(hl),{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",Km,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Ht),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ee.value,style:Y.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Q.$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)}}),Dt=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Ke=Dt(Jm,[["__scopeId","data-v-fed1b675"]]),Qm={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"},Zm={class:"flex flex-col gap-1"},eh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},th={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},nh={key:0,class:"flex items-center gap-2"},oh={name:"DCodeCard"},bl=e.defineComponent({...oh,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",Qm,[e.createElementVNode("div",Zm,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",eh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",th,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",nh,[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))}}),rh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ah={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},sh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},ih={class:"flex items-center justify-between"},lh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},ch={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},dh={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},uh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},fh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},mh={class:"flex items-center justify-between"},hh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},ph={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},gh={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Ka=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}=Ot.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",rh,[e.createElementVNode("div",ah,[e.createElementVNode("div",sh,[e.createElementVNode("div",ih,[e.createElementVNode("h3",lh,[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",ch,[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",dh,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",uh,[e.createElementVNode("div",fh,[e.createElementVNode("div",mh,[e.createElementVNode("h3",hh,[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",ph,[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",gh,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),bh=["aria-busy"],yh={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},xh={key:1,class:"flex justify-end"},kh=["for"],wh={key:0,class:"ml-1 text-destructive"},Ch={class:"relative w-full group"},Eh={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},Bh={key:1},_h=["id","value","placeholder"],Sh={key:1,class:"absolute inset-y-0 right-4 flex items-center"},Vh={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Ah={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"},Dh={key:1,class:"text-xs text-destructive"},no=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 F;return((F=l.valueType)==null?void 0:F.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 F=o.required,K=o["aria-required"];return F===""||F===!0||F==="true"||(K==="true"||K===!0)}),m=e.computed(()=>{const{label:F,class:K,id:ae,required:_e,"aria-required":Re,...ze}=o;return ze}),h=e.computed(()=>{var K,ae;const F={...m.value};return((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&(F.type="text",F.inputmode="numeric",F.pattern="[0-9]*"),((ae=l.valueType)==null?void 0:ae.toLowerCase())==="email"&&(F.type="email",F.inputmode="email"),r.value&&(F.type=a.value?"text":"password"),l.disabled&&(F.disabled=!0),l.maxLength&&(F.maxlength=l.maxLength),l.minLength&&(F.minlength=l.minLength),l.maxValue&&(F.max=l.maxValue),l.minValue&&(F.min=l.minValue),F}),p=e.computed(()=>{const F=l.modelValue;return F==null||String(F).length===0}),k=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),x=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),g=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,F=>{const K=String(F??"");K!==g.value&&(g.value=K)});const S=e.ref(!1),E=e.ref(!1),C=F=>F.split(/(\s+)/).map(K=>{if(K.trim()==="")return K;const ae=K.toLowerCase();return ae.charAt(0).toUpperCase()+ae.slice(1)}).join(""),B=F=>{const K=F.toLowerCase(),ae=K.search(new RegExp("\\p{L}","u"));return ae<0?K:K.slice(0,ae)+K.charAt(ae).toUpperCase()+K.slice(ae+1)},w=F=>{switch(l.textCase){case"uppercase":return F.toUpperCase();case"lowercase":return F.toLowerCase();case"titlecase":return C(F);case"sentencecase":return B(F);case"none":default:return F}},y=F=>{if(!F)return null;const K=Array.isArray(F)?F.join(""):F;return K?new Set(K):null},b=e.computed(()=>y(l.allowChars)),_=(F,K)=>(F.lastIndex=0,F.test(K)),V=F=>{var Xe;const K=(Xe=l.valueType)==null?void 0:Xe.toLowerCase();if(K==="free"||K==="email"||K==="password")return!0;const ae=F===" ",_e=/\d/.test(F),Re=new RegExp("\\p{L}","u").test(F),ze=new RegExp("\\p{N}","u").test(F),He=/[\/\-_.,]/.test(F);return K==="number"?_e:K==="letter"?Re||He||l.allowSpaces&&ae:K==="letternumber"?Re||ze||He||l.allowSpaces&&ae:!0},D=F=>{let K="";for(const ae of F){const _e=!!b.value&&b.value.has(ae);l.pattern&&!_e&&!_(l.pattern,ae)||!_e&&!V(ae)||(K+=ae)}return K},N=e.computed(()=>{const F=l.maxLength??o.maxlength??o.maxLength;let K=Number.NaN;return typeof F=="number"?K=F:typeof F=="string"&&(K=Number.parseInt(F,10)),Number.isFinite(K)&&K>0?K:-1}),T=e.computed(()=>g.value.length),v=e.computed(()=>l.showCharCount?N.value>0:!1),X=F=>N.value>0?F.slice(0,N.value):F,O=F=>{const K=D(F),ae=l.applyTextCaseToValue?w(K):K;return X(ae)};let H=null;const Y=F=>{var K;if(F==="")return null;if(((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&l.returnNumber){const ae=Number(F);return Number.isFinite(ae)?ae:null}return F},oe=F=>{g.value=F,i("update:modelValue",Y(F))},M=(F,K)=>{const ae=X(K);E.value=!0,F.value=ae,oe(ae),queueMicrotask(()=>E.value=!1)},L=(F,K)=>{const ae=F.selectionStart??F.value.length,_e=F.selectionEnd??F.value.length;if(N.value>0){const Re=F.value.length-(_e-ae),ze=N.value-Re;if(ze<=0)return;K=K.slice(0,ze)}F.setRangeText(K,ae,_e,"end"),M(F,O(F.value))},ee=F=>{var _e;if(!H||S.value||E.value||!((_e=F.inputType)!=null&&_e.startsWith("insert")))return;const K=F.data;if(K==null)return;const ae=O(K);ae!==K&&(F.preventDefault(),ae.length>0&&L(H,ae))},Q=F=>{var _e;if(!H||S.value||E.value)return;const K=((_e=F.clipboardData)==null?void 0:_e.getData("text"))??"",ae=O(K);ae!==K&&(F.preventDefault(),ae.length>0&&L(H,ae))},W=F=>{if(!H||S.value||E.value)return;const K=F.target,ae=K.value??"",_e=O(ae);_e===ae?oe(_e):M(K,_e)},ie=()=>S.value=!0,de=()=>{if(S.value=!1,!H)return;const F=H.value??"",K=O(F);K===F?oe(K):M(H,K)};e.onMounted(()=>{if(H=document.getElementById(u.value),!H)return;H.addEventListener("beforeinput",ee),H.addEventListener("paste",Q),H.addEventListener("input",W),H.addEventListener("compositionstart",ie),H.addEventListener("compositionend",de);const F=H.value??"",K=O(F);K===F?oe(K):M(H,K)}),e.onBeforeUnmount(()=>{H&&(H.removeEventListener("beforeinput",ee),H.removeEventListener("paste",Q),H.removeEventListener("input",W),H.removeEventListener("compositionstart",ie),H.removeEventListener("compositionend",de),H=null)});const Ce=()=>{g.value="",H&&(H.value=""),i("update:modelValue",null),i("clear")},Ne=e.computed(()=>v.value&&T.value>0),be=e.computed(()=>`${T.value} / ${N.value}`),J=e.computed(()=>!!l.error);return(F,K)=>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",yh)):e.createCommentVNode("",!0),K[1]||(K[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)),v.value?(e.openBlock(),e.createElementBlock("div",xh,[...K[0]||(K[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",wh,"*")):e.createCommentVNode("",!0)],8,kh)):e.createCommentVNode("",!0),e.createElementVNode("div",Ch,[l.icon||l.prependInner||F.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Eh,[e.renderSlot(F.$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",Bh,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:g.value},h.value,{placeholder:l.placeholder,style:`text-transform: ${x.value}; padding-left: ${l.icon||l.prependInner||F.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${k.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",J.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,_h),r.value?(e.openBlock(),e.createElementBlock("div",Sh,[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),k.value&&!r.value?(e.openBlock(),e.createElementBlock("div",Vh,[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),Ne.value&&!J.value?(e.openBlock(),e.createElementBlock("p",Ah,e.toDisplayString(be.value),1)):e.createCommentVNode("",!0)]),J.value?(e.openBlock(),e.createElementBlock("p",Dh,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,bh)),[[e.vShow,t.visible]])}}),Nh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Mh={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"},Th={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Ph={class:"flex items-center justify-between"},vh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Oh={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"},Fh={class:"p-6 flex-1"},zh={class:"flex flex-col gap-4"},Rh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ih={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"},Lh={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},$h={class:"flex items-center justify-between"},jh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Uh={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"},Wh={class:"p-6 flex-1"},Hh={class:"flex flex-col gap-4"},qh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ya=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=Ot.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",Nh,[e.createElementVNode("div",Mh,[e.createElementVNode("div",Th,[e.createElementVNode("div",Ph,[e.createElementVNode("h3",vh,[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",Oh,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Fh,[e.createElementVNode("div",zh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(no,{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",Rh)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ih,[e.createElementVNode("div",Lh,[e.createElementVNode("div",$h,[e.createElementVNode("h3",jh,[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",Uh,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Wh,[e.createElementVNode("div",Hh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(no,{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",qh,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
1
+ (function(ae,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):(ae=typeof globalThis<"u"?globalThis:ae||self,e(ae.DynamicUI={},ae.Vue,ae.LucideIcons,ae.rekaUi,ae.core,ae.VueI18n,ae.VueDatePicker,ae.Uppy,ae.UppyDashboard,ae.UppyImageEditor,ae.VueRouter,ae.Vue3Lottie))})(this,(function(ae,e,te,fe,We,gt,Jd,Qd,Us,Zd,un,eu){"use strict";var NA=Object.defineProperty;var MA=(ae,e,te)=>e in ae?NA(ae,e,{enumerable:!0,configurable:!0,writable:!0,value:te}):ae[e]=te;var de=(ae,e,te)=>MA(ae,typeof e!="symbol"?e+"":e,te);var Hr;function tu(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 At=tu(te);let Ct={};function Ws(t){Ct={...Ct,...t}}function nu(){return Ct}function ou(){return Ct.apiBaseUrl?Ct.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function ru(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Ct.getAuthToken?n=Ct.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}`),Ct.getHeaders){const o=Ct.getHeaders();return{...t,...o}}return t}function au(){Ct.onUnauthorized&&Ct.onUnauthorized()}async function su(t,n,o,r){const a=nu();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=ou(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...ru(),...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 k=new URLSearchParams;Object.entries(o).forEach(([w,p])=>{p!=null&&k.append(w,String(p))});const C=k.toString();C&&(f=`${d}${d.includes("?")?"&":"?"}${C}`)}const m=await fetch(f,u);if(m.status===401&&au(),!m.ok){const k=await m.text();throw new Error(`HTTP ${m.status}: ${k}`)}return(m.headers.get("content-type")||"").includes("application/json")?m.json():{status:!0,data:await m.text()}}function Ke(){const t=(n,o,r,a)=>{let s=n,i=o,l=r,c=a;return a&&typeof a=="object"?(a._url&&(s=a._url,i=a._method||i||"POST",a._data&&(l={...l||{},...a._data})),a.headers&&(c=a.headers)):n&&o&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(o.toUpperCase())||(s=`${n.endsWith("/")?n.slice(0,-1):n}/${o}`,i="POST")),su(s,i,l,c)};return{apiUrl:t,DCodeApi:t}}const Pn=Math.min,dt=Math.max,Po=Math.round,To=Math.floor,Vt=t=>({x:t,y:t}),iu={left:"right",right:"left",bottom:"top",top:"bottom"};function Hs(t,n,o){return dt(t,Pn(n,o))}function Jn(t,n){return typeof t=="function"?t(n):t}function Qt(t){return t.split("-")[0]}function Qn(t){return t.split("-")[1]}function qs(t){return t==="x"?"y":"x"}function Gs(t){return t==="y"?"height":"width"}function It(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function Ks(t){return qs(It(t))}function lu(t,n,o){o===void 0&&(o=!1);const r=Qn(t),a=Ks(t),s=Gs(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=vo(i)),[i,vo(i)]}function cu(t){const n=vo(t);return[ta(t),n,ta(n)]}function ta(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Xs=["left","right"],Ys=["right","left"],du=["top","bottom"],uu=["bottom","top"];function fu(t,n,o){switch(t){case"top":case"bottom":return o?n?Ys:Xs:n?Xs:Ys;case"left":case"right":return n?du:uu;default:return[]}}function mu(t,n,o,r){const a=Qn(t);let s=fu(Qt(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(ta)))),s}function vo(t){const n=Qt(t);return iu[n]+t.slice(n.length)}function hu(t){return{top:0,right:0,bottom:0,left:0,...t}}function pu(t){return typeof t!="number"?hu(t):{top:t,right:t,bottom:t,left:t}}function Oo(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 Js(t,n,o){let{reference:r,floating:a}=t;const s=It(n),i=Ks(n),l=Gs(i),c=Qt(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Qn(n)){case"start":h[i]-=m*(o&&d?-1:1);break;case"end":h[i]+=m*(o&&d?-1:1);break}return h}async function gu(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:m=!1,padding:h=0}=Jn(n,t),k=pu(h),w=l[m?f==="floating"?"reference":"floating":f],p=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),A=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},V=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:D,strategy:c}):A);return{top:(p.top-V.top+k.top)/S.y,bottom:(V.bottom-p.bottom+k.bottom)/S.y,left:(p.left-V.left+k.left)/S.x,right:(V.right-p.right+k.right)/S.x}}const bu=50,yu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:gu},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}=Js(d,r,c),m=r,h=0;const k={};for(let C=0;C<s.length;C++){const w=s[C];if(!w)continue;const{name:p,fn:A}=w,{x:D,y:S,data:V,reset:B}=await A({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:k,rects:d,platform:l,elements:{reference:t,floating:n}});u=D??u,f=S??f,k[p]={...k[p],...V},B&&h<bu&&(h++,typeof B=="object"&&(B.placement&&(m=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:f}=Js(d,m,c)),C=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:k}},xu=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:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:C=!0,...w}=Jn(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=Qt(a),A=It(l),D=Qt(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),V=m||(D||!C?[vo(l)]:cu(l)),B=k!=="none";!m&&B&&V.push(...mu(l,C,k,S));const g=[l,...V],b=await c.detectOverflow(n,w),_=[];let y=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(b[p]),f){const T=lu(a,i,S);_.push(b[T[0]],b[T[1]])}if(y=[...y,{placement:a,overflows:_}],!_.every(T=>T<=0)){var x,E;const T=(((x=s.flip)==null?void 0:x.index)||0)+1,$=g[T];if($&&(!(f==="alignment"?A!==It($):!1)||y.every(j=>It(j.placement)===A?j.overflows[0]>0:!0)))return{data:{index:T,overflows:y},reset:{placement:$}};let v=(E=y.filter(I=>I.overflows[0]<=0).sort((I,j)=>I.overflows[1]-j.overflows[1])[0])==null?void 0:E.placement;if(!v)switch(h){case"bestFit":{var M;const I=(M=y.filter(j=>{if(B){const U=It(j.placement);return U===A||U==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(U=>U>0).reduce((U,P)=>U+P,0)]).sort((j,U)=>j[1]-U[1])[0])==null?void 0:M[0];I&&(v=I);break}case"initialPlacement":v=l;break}if(a!==v)return{reset:{placement:v}}}return{}}}},ku=new Set(["left","top"]);async function wu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=Qt(o),l=Qn(o),c=It(o)==="y",d=ku.has(i)?-1:1,u=s&&c?-1:1,f=Jn(n,t);let{mainAxis:m,crossAxis:h,alignmentAxis:k}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof k=="number"&&(h=l==="end"?k*-1:k),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Cu=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 wu(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}}}}},Bu=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:A,y:D}=p;return{x:A,y:D}}},...d}=Jn(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),m=It(Qt(a)),h=qs(m);let k=u[h],C=u[m];if(i){const p=h==="y"?"top":"left",A=h==="y"?"bottom":"right",D=k+f[p],S=k-f[A];k=Hs(D,k,S)}if(l){const p=m==="y"?"top":"left",A=m==="y"?"bottom":"right",D=C+f[p],S=C-f[A];C=Hs(D,C,S)}const w=c.fn({...n,[h]:k,[m]:C});return{...w,data:{x:w.x-o,y:w.y-r,enabled:{[h]:i,[m]:l}}}}}},Eu=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}=Jn(t,n),u=await i.detectOverflow(n,d),f=Qt(a),m=Qn(a),h=It(a)==="y",{width:k,height:C}=s.floating;let w,p;f==="top"||f==="bottom"?(w=f,p=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,w=m==="end"?"top":"bottom");const A=C-u.top-u.bottom,D=k-u.left-u.right,S=Pn(C-u[w],A),V=Pn(k-u[p],D),B=!n.middlewareData.shift;let g=S,b=V;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=D),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(g=A),B&&!m){const y=dt(u.left,0),x=dt(u.right,0),E=dt(u.top,0),M=dt(u.bottom,0);h?b=k-2*(y!==0||x!==0?y+x:dt(u.left,u.right)):g=C-2*(E!==0||M!==0?E+M:dt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:g});const _=await i.getDimensions(l.floating);return k!==_.width||C!==_.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<"u"}function fn(t){return na(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Dt(t){var n;return(n=(na(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function na(t){return Fo()?t instanceof Node||t instanceof ut(t).Node:!1}function Bt(t){return Fo()?t instanceof Element||t instanceof ut(t).Element:!1}function Lt(t){return Fo()?t instanceof HTMLElement||t instanceof ut(t).HTMLElement:!1}function Qs(t){return!Fo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Zn(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Et(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function _u(t){return/^(table|td|th)$/.test(fn(t))}function zo(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Su=/transform|translate|scale|rotate|perspective|filter/,Au=/paint|layout|strict|content/,mn=t=>!!t&&t!=="none";let oa;function ra(t){const n=Bt(t)?Et(t):t;return mn(n.transform)||mn(n.translate)||mn(n.scale)||mn(n.rotate)||mn(n.perspective)||!aa()&&(mn(n.backdropFilter)||mn(n.filter))||Su.test(n.willChange||"")||Au.test(n.contain||"")}function Vu(t){let n=Zt(t);for(;Lt(n)&&!Tn(n);){if(ra(n))return n;if(zo(n))return null;n=Zt(n)}return null}function aa(){return oa==null&&(oa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),oa}function Tn(t){return/^(html|body|#document)$/.test(fn(t))}function Et(t){return ut(t).getComputedStyle(t)}function Ro(t){return Bt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zt(t){if(fn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Qs(t)&&t.host||Dt(t);return Qs(n)?n.host:n}function Zs(t){const n=Zt(t);return Tn(n)?t.ownerDocument?t.ownerDocument.body:t.body:Lt(n)&&Zn(n)?n:Zs(n)}function eo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Zs(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=ut(a);if(s){const l=sa(i);return n.concat(i,i.visualViewport||[],Zn(a)?a:[],l&&o?eo(l):[])}else return n.concat(a,eo(a,[],o))}function sa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ei(t){const n=Et(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Lt(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=Po(o)!==s||Po(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function ia(t){return Bt(t)?t:t.contextElement}function vn(t){const n=ia(t);if(!Lt(n))return Vt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=ei(n);let i=(s?Po(o.width):o.width)/r,l=(s?Po(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Du=Vt(0);function ti(t){const n=ut(t);return!aa()||!n.visualViewport?Du:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Nu(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==ut(t)?!1:n}function hn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=ia(t);let i=Vt(1);n&&(r?Bt(r)&&(i=vn(r)):i=vn(t));const l=Nu(s,o,r)?ti(s):Vt(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 m=ut(s),h=r&&Bt(r)?ut(r):r;let k=m,C=sa(k);for(;C&&r&&h!==k;){const w=vn(C),p=C.getBoundingClientRect(),A=Et(C),D=p.left+(C.clientLeft+parseFloat(A.paddingLeft))*w.x,S=p.top+(C.clientTop+parseFloat(A.paddingTop))*w.y;c*=w.x,d*=w.y,u*=w.x,f*=w.y,c+=D,d+=S,k=ut(C),C=sa(k)}}return Oo({width:u,height:f,x:c,y:d})}function Io(t,n){const o=Ro(t).scrollLeft;return n?n.left+o:hn(Dt(t)).left+o}function ni(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-Io(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Mu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Dt(r),l=n?zo(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Vt(1);const u=Vt(0),f=Lt(r);if((f||!f&&!s)&&((fn(r)!=="body"||Zn(i))&&(c=Ro(r)),f)){const h=hn(r);d=vn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const m=i&&!f&&!s?ni(i,c):Vt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:o.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Pu(t){return Array.from(t.getClientRects())}function Tu(t){const n=Dt(t),o=Ro(t),r=t.ownerDocument.body,a=dt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=dt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+Io(t);const l=-o.scrollTop;return Et(r).direction==="rtl"&&(i+=dt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const oi=25;function vu(t,n){const o=ut(t),r=Dt(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=aa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Io(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,k=Math.abs(r.clientWidth-f.clientWidth-h);k<=oi&&(s-=k)}else d<=oi&&(s+=d);return{width:s,height:i,x:l,y:c}}function Ou(t,n){const o=hn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=Lt(t)?vn(t):Vt(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 ri(t,n,o){let r;if(n==="viewport")r=vu(t,o);else if(n==="document")r=Tu(Dt(t));else if(Bt(n))r=Ou(n,o);else{const a=ti(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Oo(r)}function ai(t,n){const o=Zt(t);return o===n||!Bt(o)||Tn(o)?!1:Et(o).position==="fixed"||ai(o,n)}function Fu(t,n){const o=n.get(t);if(o)return o;let r=eo(t,[],!1).filter(l=>Bt(l)&&fn(l)!=="body"),a=null;const s=Et(t).position==="fixed";let i=s?Zt(t):t;for(;Bt(i)&&!Tn(i);){const l=Et(i),c=ra(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Zn(i)&&!c&&ai(t,i))?r=r.filter(u=>u!==i):a=l,i=Zt(i)}return n.set(t,r),r}function zu(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?zo(n)?[]:Fu(n,this._c):[].concat(o),r],l=ri(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let m=1;m<i.length;m++){const h=ri(n,i[m],a);c=dt(h.top,c),d=Pn(h.right,d),u=Pn(h.bottom,u),f=dt(h.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Ru(t){const{width:n,height:o}=ei(t);return{width:n,height:o}}function Iu(t,n,o){const r=Lt(n),a=Dt(n),s=o==="fixed",i=hn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Vt(0);function d(){c.x=Io(a)}if(r||!r&&!s)if((fn(n)!=="body"||Zn(a))&&(l=Ro(n)),r){const h=hn(n,!0,s,n);c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?ni(a,l):Vt(0),f=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function la(t){return Et(t).position==="static"}function si(t,n){if(!Lt(t)||Et(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Dt(t)===o&&(o=o.ownerDocument.body),o}function ii(t,n){const o=ut(t);if(zo(t))return o;if(!Lt(t)){let a=Zt(t);for(;a&&!Tn(a);){if(Bt(a)&&!la(a))return a;a=Zt(a)}return o}let r=si(t,n);for(;r&&_u(r)&&la(r);)r=si(r,n);return r&&Tn(r)&&la(r)&&!ra(r)?o:r||Vu(t)||o}const Lu=async function(t){const n=this.getOffsetParent||ii,o=this.getDimensions,r=await o(t.floating);return{reference:Iu(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $u(t){return Et(t).direction==="rtl"}const ju={convertOffsetParentRelativeRectToViewportRelativeRect:Mu,getDocumentElement:Dt,getClippingRect:zu,getOffsetParent:ii,getElementRects:Lu,getClientRects:Pu,getDimensions:Ru,getScale:vn,isElement:Bt,isRTL:$u};function li(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Uu(t,n){let o=null,r;const a=Dt(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:m,height:h}=d;if(l||n(),!m||!h)return;const k=To(f),C=To(a.clientWidth-(u+m)),w=To(a.clientHeight-(f+h)),p=To(u),D={rootMargin:-k+"px "+-C+"px "+-w+"px "+-p+"px",threshold:dt(0,Pn(1,c))||1};let S=!0;function V(B){const g=B[0].intersectionRatio;if(g!==c){if(!S)return i();g?i(!1,g):r=setTimeout(()=>{i(!1,1e-7)},1e3)}g===1&&!li(d,t.getBoundingClientRect())&&i(),S=!1}try{o=new IntersectionObserver(V,{...D,root:a.ownerDocument})}catch{o=new IntersectionObserver(V,D)}o.observe(t)}return i(!0),s}function ca(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=ia(t),u=a||s?[...d?eo(d):[],...n?eo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?Uu(d,o):null;let m=-1,h=null;i&&(h=new ResizeObserver(p=>{let[A]=p;A&&A.target===d&&h&&n&&(h.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var D;(D=h)==null||D.observe(n)})),o()}),d&&!c&&h.observe(d),n&&h.observe(n));let k,C=c?hn(t):null;c&&w();function w(){const p=hn(t);C&&!li(C,p)&&o(),C=p,k=requestAnimationFrame(w)}return o(),()=>{var p;u.forEach(A=>{a&&A.removeEventListener("scroll",o),s&&A.removeEventListener("resize",o)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,c&&cancelAnimationFrame(k)}}const da=Cu,ua=Bu,fa=xu,ma=Eu,Wu=(t,n,o)=>{const r=new Map,a={platform:ju,...o},s={...a.platform,_c:r};return yu(t,n,{...a,platform:s})};function Hu(t){return t!=null&&typeof t=="object"&&"$el"in t}function ci(t){if(Hu(t)){const n=t.$el;return na(n)&&fn(n)==="#comment"?null:n}return t}function to(t){return typeof t=="function"?t():e.unref(t)}function di(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ui(t,n){const o=di(t);return Math.round(n*o)/o}function ha(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var g;return(g=to(o.open))!=null?g:!0}),s=e.computed(()=>to(o.middleware)),i=e.computed(()=>{var g;return(g=to(o.placement))!=null?g:"bottom"}),l=e.computed(()=>{var g;return(g=to(o.strategy))!=null?g:"absolute"}),c=e.computed(()=>{var g;return(g=to(o.transform))!=null?g:!0}),d=e.computed(()=>ci(t.value)),u=e.computed(()=>ci(n.value)),f=e.ref(0),m=e.ref(0),h=e.ref(l.value),k=e.ref(i.value),C=e.shallowRef({}),w=e.ref(!1),p=e.computed(()=>{const g={position:h.value,left:"0",top:"0"};if(!u.value)return g;const b=ui(u.value,f.value),_=ui(u.value,m.value);return c.value?{...g,transform:"translate("+b+"px, "+_+"px)",...di(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:b+"px",top:_+"px"}});let A;function D(){if(d.value==null||u.value==null)return;const g=a.value;Wu(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,m.value=b.y,h.value=b.strategy,k.value=b.placement,C.value=b.middlewareData,w.value=g!==!1})}function S(){typeof A=="function"&&(A(),A=void 0)}function V(){if(S(),r===void 0){D();return}if(d.value!=null&&u.value!=null){A=r(d.value,u.value,D);return}}function B(){a.value||(w.value=!1)}return e.watch([s,i,l,a],D,{flush:"sync"}),e.watch([d,u],V,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(S),{x:e.shallowReadonly(f),y:e.shallowReadonly(m),strategy:e.shallowReadonly(h),placement:e.shallowReadonly(k),middlewareData:e.shallowReadonly(C),isPositioned:e.shallowReadonly(w),floatingStyles:p,update:D}}const qu=["aria-busy"],Gu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Ku=["for"],Xu={key:0,class:"ml-1 text-destructive"},Yu={class:"relative"},Ju={key:0,class:"flex items-center text-gray-500 gap-2"},Qu=["id","placeholder","disabled","readonly","value"],Zu={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},ef=["disabled"],tf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},nf=["onMouseenter","onClick"],of={key:0},rf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},af={key:0},sf={key:1},lf={key:2},cf={key:1,class:"mt-1 text-xs text-red-600"},Lo=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=H=>{const re=a[H];return re===""||re===!0||re==="true"||re===1||re==="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")),m=e.computed(()=>i("readonly")),h=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),k=e.computed(()=>f.value||i("aria-required")),C=e.computed(()=>o.error||o.errorMessage||a["error-message"]),w=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const H=a.minChars??a["min-chars"];if(H==null||H==="")return 0;const re=typeof H=="number"?H:Number.parseInt(String(H),10);return Number.isFinite(re)&&re>0?re:0}),A=e.computed(()=>{const H=a.rules;return Array.isArray(H)?H:[]}),D=e.computed(()=>{const H=a.id||a.label;return H?`app-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),S=e.ref(o.modelValue),V=e.ref([]),B=e.ref(!1),g=e.ref(!1),b=e.computed(()=>a.items),_=e.computed(()=>{const H=T.value;return H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems?V.value:b.value??[]}),y=e.computed(()=>!!a.loading),x=e.computed(()=>y.value||B.value),E=e.computed(()=>{const{label:H,items:re,loading:pe,rules:Ie,"item-title":Ee,"item-value":Q,itemTitle:oe,itemValue:se,minChars:xe,"min-chars":He,clearable:zt,required:qr,"aria-required":Fd,disabled:Gr,readonly:zd,visible:rt,"return-object":Rd,returnObject:Kr,class:Id,"fetch-items":Xr,fetchItems:Ld,error:$s,errorMessage:$d,"error-message":jd,...Yr}=a||{};return Yr}),M=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=e.computed(()=>{const H=o.endpoint||{};return{apiModule:o.apiModule||H.apiModule,apiAction:o.apiAction||H.apiAction,apiUrl:H.apiUrl,apiMethod:H.apiMethod||"GET"}}),$=e.ref(null),v=e.ref(null),I=e.ref(null),{floatingStyles:j}=ha(v,I,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:H,elements:re,availableHeight:pe}){Object.assign(re.floating.style,{width:`${H.reference.width}px`,maxHeight:`${pe}px`})}})]}),U=e.ref(!1),P=e.ref(""),R=e.ref(-1),G=e.ref(null),q=e.computed(()=>!p.value||(P.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),W=H=>{if(H==null)return"";if(typeof H=="string"||typeof H=="number")return String(H);const re=c.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.name)??(H==null?void 0:H.nama)??(H==null?void 0:H.label)??(H==null?void 0:H.title)??"-"},Z=H=>{if(H==null)return null;if(typeof H=="string"||typeof H=="number")return H;const re=d.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.id)??(H==null?void 0:H.value)??(H==null?void 0:H.code)??null},ne=e.computed(()=>{const H=S.value;if(H==null||H==="")return"";if(Array.isArray(H))return H.length?H.map(Ie=>{if(h.value&&typeof Ie=="object"||typeof Ie=="object")return W(Ie);const Ee=_.value.find(Q=>Z(Q)==Ie);return Ee?W(Ee):String(Ie)}).join(", "):"";if(typeof H=="object")return W(H);const re=_.value.find(pe=>Z(pe)==H);return re?W(re):String(H)}),ue=e.computed(()=>{const H=_.value||[],re=(P.value||"").trim().toLowerCase(),pe=(ne.value||"").toLowerCase(),Ie=!re||re===pe;let Ee=H;if(Ie||(Ee=H.filter(Q=>W(Q).toLowerCase().includes(re))),Ee.length>0){const Q=oe=>{const se=Z(oe);return Array.isArray(S.value)?S.value.some(xe=>xe==se):S.value==se};Ee=[...Ee].sort((oe,se)=>{const xe=Q(oe),He=Q(se);return xe&&!He?-1:!xe&&He?1:0})}return Ee}),ke=H=>Array.isArray(H)?H.length===0:H==null||H==="",me=H=>{if(G.value=null,f.value&&ke(H)&&!A.value.length)return G.value="This field is required",!1;for(const re of A.value){const pe=re(H);if(pe===!1)return G.value="Invalid value",!1;if(typeof pe=="string")return G.value=pe,!1}return!0},X=async()=>{if(u.value||m.value)return;U.value=!0,R.value=ue.value.length?0:-1,P.value=ne.value||"";const H=T.value,re=H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems;o.autoFetchOnOpen&&re&&!g.value&&(await ze(),R.value=ue.value.length?0:-1)},O=()=>{U.value=!1,R.value=-1,P.value=ne.value||""},K=H=>{const re=h.value?H:Z(H);let pe=re;Array.isArray(S.value)&&(pe=[re]),S.value=pe,r("update:modelValue",pe),G.value=null,me(pe),P.value=W(H),O()},ee=()=>{V.value=[],g.value=!1,S.value=Array.isArray(S.value)?[]:null,r("update:modelValue",S.value),P.value="",G.value=null},he=()=>{l.value=!0,ee(),O(),setTimeout(()=>{l.value=!1},0)},Ve=H=>{if(u.value||m.value)return;const re=H.target.value;P.value=re,G.value&&(G.value=null),U.value||(U.value=!0),R.value=ue.value.length?0:-1;const pe=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&pe&&!x.value&&!g.value&&ze()},Ne=H=>{var pe;if(u.value||m.value)return;const re={ArrowDown:()=>{if(H.preventDefault(),!U.value){X();return}ue.value.length&&(R.value=Math.min(R.value+1,ue.value.length-1))},ArrowUp:()=>{!U.value||!ue.value.length||(H.preventDefault(),R.value=Math.max(R.value-1,0))},Enter:()=>{if(!U.value)return;H.preventDefault();const Ie=ue.value[R.value];Ie&&K(Ie)},Escape:()=>{H.preventDefault(),O()},Tab:()=>{O()}};(pe=re[H.key])==null||pe.call(re)},ze=async()=>{const H=T.value;if(H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems){B.value=!0;try{let pe;if(o.fetchItems){const Ie=M()||{},Ee={page:1,perPage:100,search:(P.value||"").trim(),...Ie,...o.apiParams},Q=await o.fetchItems(Ee),oe=(Q==null?void 0:Q.data)??Q;pe=(oe==null?void 0:oe.data)??oe}else{const Ee=Ke().DCodeApi;if(typeof Ee!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const oe={page:1,perPage:100,...M()||{},...o.apiParams};let se;H.apiUrl?se=await Ee("","",oe,{_url:H.apiUrl,_method:H.apiMethod||"POST"}):se=await Ee(H.apiModule,H.apiAction,oe);const xe=(se==null?void 0:se.data)??se;pe=(xe==null?void 0:xe.data)??xe}V.value=Array.isArray(pe)?pe:[],g.value=!0}catch(pe){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",pe),G.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(pe==null?void 0:pe.message)||(pe==null?void 0:pe.toString())||"Failed to load options"}`,V.value=[],g.value=!0}finally{B.value=!1}}},Re=H=>{const re=Z(H);return h.value?S.value?Array.isArray(S.value)?S.value.some(pe=>Z(pe)==re):Z(S.value)==re:!1:Array.isArray(S.value)?S.value.some(pe=>pe==re):S.value==re};e.watch(()=>[M(),T.value,o.apiParams],([H,re,pe],[Ie,Ee,Q])=>{const oe=T.value;if(!(oe.apiModule&&oe.apiAction||oe.apiUrl||o.fetchItems)){ee();return}const xe=JSON.stringify(H??null)===JSON.stringify(Ie??null),He=JSON.stringify(pe??null)===JSON.stringify(Q??null);xe&&He||(ee(),He||ze())},{deep:!0}),e.watch(()=>o.modelValue,(H,re)=>{S.value=H,!l.value&&(H==null||H==="")&&re!=null&&o.apiModule&&o.apiAction&&(V.value=[],g.value=!1),P.value=ne.value||""},{immediate:!0});const Ue=T.value;(Ue.apiModule&&Ue.apiAction||Ue.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ke(o.modelValue))&&ze();const Ze=H=>{const re=$.value,pe=I.value,Ie=H.target;re&&re.contains(Ie)||pe&&pe.contains(Ie)||U.value&&O()},ct=e.computed(()=>{const H=o.modelValue;return H==null?!1:typeof H=="string"?H.trim().length>0:Array.isArray(H)?H.length>0:typeof H=="object"?Object.keys(H).length>0:!0}),St=e.computed(()=>!!o.clearable&&ct.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",Ze)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ze)}),(H,re)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:$,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",Gu)):e.createCommentVNode("",!0),re[6]||(re[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:D.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),k.value?(e.openBlock(),e.createElementBlock("span",Xu,"*")):e.createCommentVNode("",!0)],8,Ku)):e.createCommentVNode("",!0),e.createElementVNode("div",Yu,[e.createElementVNode("div",{ref_key:"reference",ref:v,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||m.value?"opacity-60 cursor-not-allowed":"",G.value||C.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||H.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Ju,[e.renderSlot(H.$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(E.value,{id:D.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||m.value?"cursor-not-allowed":"cursor-text"],placeholder:w.value,disabled:u.value,readonly:m.value,value:U.value?P.value:ne.value||P.value,onFocus:re[0]||(re[0]=()=>{U.value||X()}),onClick:re[1]||(re[1]=()=>{U.value||X()}),onInput:Ve,onKeydown:Ne,onBlur:re[2]||(re[2]=()=>me(S.value))}),null,16,Qu),x.value?(e.openBlock(),e.createElementBlock("svg",Zu,[...re[7]||(re[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)])])):St.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:re[3]||(re[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(he,["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||m.value,onClick:re[4]||(re[4]=pe=>U.value?O():X()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":U.value}])},null,8,["class"])],8,ef))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:I,style:e.normalizeStyle(e.unref(j)),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",tf,[ue.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue.value,(pe,Ie)=>(e.openBlock(),e.createElementBlock("button",{key:Z(pe)??Ie,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",Ie===R.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ee=>R.value=Ie,onMousedown:re[5]||(re[5]=e.withModifiers(()=>{},["prevent"])),onClick:Ee=>K(pe)},[e.createTextVNode(e.toDisplayString(W(pe))+" ",1),Re(pe)?(e.openBlock(),e.createElementBlock("span",of," ✓ ")):e.createCommentVNode("",!0)],42,nf))),128)):e.renderSlot(H.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",rf,[x.value?(e.openBlock(),e.createElementBlock("span",af,"Loading data…")):q.value?(e.openBlock(),e.createElementBlock("span",sf,e.toDisplayString(q.value),1)):(e.openBlock(),e.createElementBlock("span",lf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),G.value||C.value?(e.openBlock(),e.createElementBlock("p",cf,e.toDisplayString(G.value||C.value),1)):e.createCommentVNode("",!0)],64))],10,qu)),[[e.vShow,t.visible]])}}),df=["aria-busy"],uf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ff=["for"],mf={key:0,class:"ml-1 text-destructive"},hf={class:"relative"},pf={key:0,class:"flex items-center text-gray-500 gap-2"},gf=["id","placeholder","disabled","value"],bf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},yf=["disabled"],xf={key:0,class:"p-3 space-y-2"},kf=["onMouseenter","onClick"],wf={class:"flex items-center space-x-3"},Cf={class:"flex-1"},Bf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ef={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},_f={key:0},Sf={key:2,class:"p-3 text-center"},Af={class:"inline-flex items-center space-x-2"},Vf={class:"text-sm text-gray-500"},Df={key:3,class:"p-3 text-center"},Nf={class:"text-xs text-gray-400"},Mf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Pf={key:1,class:"mt-1 text-xs text-red-600"},Tf={key:2,class:"mt-1 text-xs text-gray-500"},fi=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 R=o.label||o.placeholder;return R?`app-infinite-autocomplete-${R}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),m=e.ref([]),h=e.ref(!1),k=e.ref(!1),C=e.ref(-1),w=e.ref(1),p=e.ref(!0),A=e.ref(0),D=e.ref(),{floatingStyles:S}=ha(c,d,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:R,elements:G}){Object.assign(G.floating.style,{width:`${R.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const V=e.computed(()=>f.value?m.value.filter(R=>_(R).toLowerCase().includes(f.value.toLowerCase())):m.value),B=e.computed(()=>{if(k.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return _(o.modelValue);{const R=m.value.find(G=>y(G)===o.modelValue);return R?_(R):String(o.modelValue)}}return""}),g=()=>{k.value=!0},b=()=>{k.value=!1},_=R=>typeof o.itemTitle=="function"?o.itemTitle(R):R[o.itemTitle]||"",y=R=>typeof o.itemValue=="function"?o.itemValue(R):R[o.itemValue]||R,x=R=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(R):R[o.itemSubtitle]||"":"",E=R=>o.modelValue?o.returnObject?y(R)===y(o.modelValue):y(R)===o.modelValue:!1,M=R=>{var q;const G=o.returnObject?R:y(R);r("update:modelValue",G),r("select",R),k.value=!1,f.value="",(q=s.value)==null||q.blur()},T=()=>{var R;r("update:modelValue",null),f.value="",(R=s.value)==null||R.focus()},$=R=>{k.value=!0,r("focus",R),o.autoFetchOnOpen&&!h.value&&(o.refreshOnOpen||m.value.length===0)&&P(!0)},v=R=>{setTimeout(()=>{k.value=!1,r("blur",R)},200)},I=R=>{const G=R.target;f.value=G.value,D.value&&clearTimeout(D.value),D.value=setTimeout(()=>{r("search",f.value),w.value=1,p.value=!0,P(!0)},o.debounceMs)},j=R=>{if(k.value)switch(R.key){case"ArrowDown":R.preventDefault(),C.value=Math.min(C.value+1,V.value.length-1);break;case"ArrowUp":R.preventDefault(),C.value=Math.max(C.value-1,0);break;case"Enter":R.preventDefault(),C.value>=0&&V.value[C.value]&&M(V.value[C.value]);break;case"Escape":k.value=!1;break}},U=R=>{if(!p.value||h.value)return;const G=R.target,{scrollTop:q,scrollHeight:W,clientHeight:Z}=G;q+Z>=W-o.threshold&&P()},P=async(R=!1)=>{var G,q;if(!h.value){h.value=!0;try{let W=[];if(o.fetchItems)W=await o.fetchItems();else{const Z=Ke(),ne=((G=o.endpoint)==null?void 0:G.apiModule)||o.apiModule,ue=((q=o.endpoint)==null?void 0:q.apiAction)||o.apiAction;if(!ne||!ue)throw new Error("API module and action are required");const ke={page:R?1:w.value,pageSize:o.pageSize,search:f.value,...o.apiParams},me=await Z.apiUrl(`/${ne}/${ue}`,"GET",ke);W=me.data||me.items||me||[],A.value=me.total||me.totalItems||W.length}R?(m.value=W,w.value=1):(m.value.push(...W),w.value++),p.value=W.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:W,page:w.value,hasMore:p.value,total:A.value})}catch(W){console.error("Error fetching items:",W),r("error",W)}finally{h.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&P()}),e.onUnmounted(()=>{D.value&&clearTimeout(D.value)}),e.watch(()=>o.modelValue,R=>{R||(f.value="")}),(R,G)=>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",uf)):e.createCommentVNode("",!0),G[3]||(G[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",mf,"*")):e.createCommentVNode("",!0)],8,ff)):e.createCommentVNode("",!0),e.createElementVNode("div",hf,[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",pf,[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},R.$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:$,onBlur:v,onInput:I,onKeydown:j}),null,16,gf),h.value?(e.openBlock(),e.createElementBlock("svg",bf,[...G[4]||(G[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:G[0]||(G[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:G[1]||(G[1]=q=>k.value?b():g()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":k.value}])},null,8,["class"])],8,yf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[k.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(S)),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:U},[h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",xf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,q=>e.createElementVNode("div",{key:q,class:"flex items-center space-x-3"},[...G[5]||(G[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))])):V.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(V.value,(q,W)=>(e.openBlock(),e.createElementBlock("button",{key:y(q)??W,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",W===C.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Z=>C.value=W,onMousedown:G[2]||(G[2]=e.withModifiers(()=>{},["prevent"])),onClick:Z=>M(q)},[e.renderSlot(R.$slots,"item",{item:q,index:W},()=>[e.createElementVNode("div",wf,[e.createElementVNode("div",Cf,[e.createElementVNode("div",Bf,e.toDisplayString(_(q)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Ef,e.toDisplayString(x(q)),1)):e.createCommentVNode("",!0)])])]),E(q)?(e.openBlock(),e.createElementBlock("span",_f," ✓ ")):e.createCommentVNode("",!0)],42,kf))),128)):e.createCommentVNode("",!0),h.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Sf,[e.createElementVNode("div",Af,[G[6]||(G[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Vf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Df,[e.createElementVNode("div",Nf,e.toDisplayString(t.endOfResultsText),1)])):!h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Mf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Pf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Tf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,df)),[[e.vShow,t.visible]])}});function mi(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=mi(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function hi(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=mi(t))&&(r&&(r+=" "),r+=n);return r}const vf=(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},Of=(t,n)=>({classGroupId:t,validator:n}),pi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),$o="-",gi=[],Ff="arbitrary..",zf=t=>{const n=If(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Rf(i);const l=i.split($o),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?vf(d,c):c:d||gi}return o[i]||gi}}},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($o):t.slice(n).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Rf=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?Ff+r:void 0})(),If=t=>{const{theme:n,classGroups:o}=t;return Lf(o,n)},Lf=(t,n)=>{const o=pi();for(const r in t){const a=t[r];pa(a,o,r,n)}return o},pa=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];$f(i,n,o,r)}},$f=(t,n,o,r)=>{if(typeof t=="string"){jf(t,n,o);return}if(typeof t=="function"){Uf(t,n,o,r);return}Wf(t,n,o,r)},jf=(t,n,o)=>{const r=t===""?n:yi(n,t);r.classGroupId=o},Uf=(t,n,o,r)=>{if(Hf(t)){pa(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Of(o,t))},Wf=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];pa(c,yi(n,l),o,r)}},yi=(t,n)=>{let o=t;const r=n.split($o),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=pi(),o.nextPart.set(i,l)),o=l}return o},Hf=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,qf=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)}}},ga="!",xi=":",Gf=[],ki=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),Kf=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 C=0;C<u;C++){const w=a[C];if(i===0&&l===0){if(w===xi){s.push(a.slice(c,C)),c=C+1;continue}if(w==="/"){d=C;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const f=s.length===0?a:a.slice(c);let m=f,h=!1;f.endsWith(ga)?(m=f.slice(0,-1),h=!0):f.startsWith(ga)&&(m=f.slice(1),h=!0);const k=d&&d>c?d-c:void 0;return ki(s,h,m,k)};if(n){const a=n+xi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):ki(Gf,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},Xf=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}},Yf=t=>({cache:qf(t.cacheSize),parseClassName:Kf(t),sortModifiers:Xf(t),...zf(t)}),Jf=/\s+/,Qf=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(Jf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:m,hasImportantModifier:h,baseClassName:k,maybePostfixModifierPosition:C}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let w=!!C,p=r(w?k.substring(0,C):k);if(!p){if(!w){c=u+(c.length>0?" "+c:c);continue}if(p=r(k),!p){c=u+(c.length>0?" "+c:c);continue}w=!1}const A=m.length===0?"":m.length===1?m[0]:s(m).join(":"),D=h?A+ga:A,S=D+p;if(i.indexOf(S)>-1)continue;i.push(S);const V=a(p,w);for(let B=0;B<V.length;++B){const g=V[B];i.push(D+g)}c=u+(c.length>0?" "+c:c)}return c},Zf=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=wi(o))&&(a&&(a+=" "),a+=r);return a},wi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=wi(t[r]))&&(o&&(o+=" "),o+=n);return o},em=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=Yf(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=Qf(c,o);return a(c,u),u};return s=i,(...c)=>s(Zf(...c))},tm=[],Ye=t=>{const n=o=>o[t]||tm;return n.isThemeGetter=!0,n},Ci=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,om=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rm=/\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$/,am=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,im=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,en=t=>nm.test(t),Ce=t=>!!t&&!Number.isNaN(Number(t)),tn=t=>!!t&&Number.isInteger(Number(t)),ba=t=>t.endsWith("%")&&Ce(t.slice(0,-1)),$t=t=>om.test(t),Ei=()=>!0,lm=t=>rm.test(t)&&!am.test(t),ya=()=>!1,cm=t=>sm.test(t),dm=t=>im.test(t),um=t=>!le(t)&&!ce(t),fm=t=>nn(t,Ni,ya),le=t=>Ci.test(t),pn=t=>nn(t,Mi,lm),_i=t=>nn(t,km,Ce),mm=t=>nn(t,Ti,Ei),hm=t=>nn(t,Pi,ya),Si=t=>nn(t,Vi,ya),pm=t=>nn(t,Di,dm),jo=t=>nn(t,vi,cm),ce=t=>Bi.test(t),no=t=>gn(t,Mi),gm=t=>gn(t,Pi),Ai=t=>gn(t,Vi),bm=t=>gn(t,Ni),ym=t=>gn(t,Di),Uo=t=>gn(t,vi,!0),xm=t=>gn(t,Ti,!0),nn=(t,n,o)=>{const r=Ci.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},gn=(t,n,o=!1)=>{const r=Bi.exec(t);return r?r[1]?n(r[1]):o:!1},Vi=t=>t==="position"||t==="percentage",Di=t=>t==="image"||t==="url",Ni=t=>t==="length"||t==="size"||t==="bg-size",Mi=t=>t==="length",km=t=>t==="number",Pi=t=>t==="family-name",Ti=t=>t==="number"||t==="weight",vi=t=>t==="shadow",wm=em(()=>{const t=Ye("color"),n=Ye("font"),o=Ye("text"),r=Ye("font-weight"),a=Ye("tracking"),s=Ye("leading"),i=Ye("breakpoint"),l=Ye("container"),c=Ye("spacing"),d=Ye("radius"),u=Ye("shadow"),f=Ye("inset-shadow"),m=Ye("text-shadow"),h=Ye("drop-shadow"),k=Ye("blur"),C=Ye("perspective"),w=Ye("aspect"),p=Ye("ease"),A=Ye("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],V=()=>[...S(),ce,le],B=()=>["auto","hidden","clip","visible","scroll"],g=()=>["auto","contain","none"],b=()=>[ce,le,c],_=()=>[en,"full","auto",...b()],y=()=>[tn,"none","subgrid",ce,le],x=()=>["auto",{span:["full",tn,ce,le]},tn,ce,le],E=()=>[tn,"auto",ce,le],M=()=>["auto","min","max","fr",ce,le],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],v=()=>["auto",...b()],I=()=>[en,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],j=()=>[en,"screen","full","dvw","lvw","svw","min","max","fit",...b()],U=()=>[en,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],P=()=>[t,ce,le],R=()=>[...S(),Ai,Si,{position:[ce,le]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",bm,fm,{size:[ce,le]}],W=()=>[ba,no,pn],Z=()=>["","none","full",d,ce,le],ne=()=>["",Ce,no,pn],ue=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Ce,ba,Ai,Si],X=()=>["","none",k,ce,le],O=()=>["none",Ce,ce,le],K=()=>["none",Ce,ce,le],ee=()=>[Ce,ce,le],he=()=>[en,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$t],breakpoint:[$t],color:[Ei],container:[$t],"drop-shadow":[$t],ease:["in","out","in-out"],font:[um],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$t],shadow:[$t],spacing:["px",Ce],text:[$t],"text-shadow":[$t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",en,le,ce,w]}],container:["container"],columns:[{columns:[Ce,le,ce,l]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:V()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:g()}],"overscroll-x":[{"overscroll-x":g()}],"overscroll-y":[{"overscroll-y":g()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[tn,"auto",ce,le]}],basis:[{basis:[en,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,en,"auto","initial","none",le]}],grow:[{grow:["",Ce,ce,le]}],shrink:[{shrink:["",Ce,ce,le]}],order:[{order:[tn,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:x()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:x()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],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:v()}],mx:[{mx:v()}],my:[{my:v()}],ms:[{ms:v()}],me:[{me:v()}],mbs:[{mbs:v()}],mbe:[{mbe:v()}],mt:[{mt:v()}],mr:[{mr:v()}],mb:[{mb:v()}],ml:[{ml:v()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[l,"screen",...I()]}],"min-w":[{"min-w":[l,"screen","none",...I()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",o,no,pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xm,mm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ba,le]}],"font-family":[{font:[gm,hm,n]}],"font-features":[{"font-features":[le]}],"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,ce,le]}],"line-clamp":[{"line-clamp":[Ce,"none",ce,_i]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ce,pn]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ce,"auto",ce,le]}],"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",ce,le]}],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",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tn,ce,le],radial:["",ce,le],conic:[tn,ce,le]},ym,pm]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ce,le]}],"outline-w":[{outline:["",Ce,no,pn]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Uo,jo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",f,Uo,jo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ce,pn]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",m,Uo,jo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ce,ce,le]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"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":[Ce]}],"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":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"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":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"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":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"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":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"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":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"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":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"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":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"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":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"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":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:X()}],brightness:[{brightness:[Ce,ce,le]}],contrast:[{contrast:[Ce,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",h,Uo,jo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ce,ce,le]}],"hue-rotate":[{"hue-rotate":[Ce,ce,le]}],invert:[{invert:["",Ce,ce,le]}],saturate:[{saturate:[Ce,ce,le]}],sepia:[{sepia:["",Ce,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ce,le]}],"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",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ce,le]}],ease:[{ease:["linear","initial",p,ce,le]}],delay:[{delay:[Ce,ce,le]}],animate:[{animate:["none",A,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,le]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",ce,le]}],"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",ce,le]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ce,no,pn,_i]}],stroke:[{stroke:["none",...P()]}],"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 _e(...t){return wm(hi(t))}function Oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xa={},ka={},Wo={exports:{}},Fi;function Cm(){if(Fi)return Wo.exports;Fi=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 Wo.exports=n(),Wo.exports.createColors=n,Wo.exports}var zi;function Bm(){return zi||(zi=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(Cm());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(m=>console.warn(d,"-",m)))}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])}}})(ka)),ka}var Ri;function Em(){return Ri||(Ri=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Bm());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}}})(xa)),xa}var wa,Ii;function _m(){if(Ii)return wa;Ii=1;let t=Em();return wa=(t.__esModule?t:{default:t}).default,wa}var Sm=_m();const Am=Oi(Sm),Vm=(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)},Dm=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)}}),Nm=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):Dm(t),bn=(t,n)=>{if(!t)return null;if(n[t])return n[t];const o=t.split(/[-_]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join("");return n[o]||null},Li=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$i=hi,Ho=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return $i(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 m=Li(u)||Li(f);return a[d][m]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(k=>{let[C,w]=k;return Array.isArray(w)?w.includes({...s,...l}[C]):{...s,...l}[C]===w})?[...d,f,m]:d},[]);return $i(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},_t=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(fe.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(_e)(e.unref(On)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),On=Ho("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"}}),ji=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=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Ui=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=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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}))}}),Wi=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(fe.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Hi=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Mm={class:"relative z-10"},Pm="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",Tm=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(()=>bn(o.icon,At)),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const q=String(o.variant||"default").toLowerCase();return q==="tonal"?"secondary":q==="elevated"?"default":q}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:q,...W}=n;return W}),u=e.computed(()=>_e(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),m=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),h=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),k=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}`:""),C=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"),w=e.computed(()=>_e("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",k.value,m.value,h.value,f.value)),p=e.computed(()=>{const W=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),A=e.computed(()=>{const W=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),D=e.computed(()=>!!p.value),S=e.computed(()=>/\bborder-/.test(u.value??"")),V=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const q=u.value??"";return i.value!=="outline"?q:q.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),g=e.ref(null),b=q=>{const W=q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return W?{r:Number(W[1]),g:Number(W[2]),b:Number(W[3]),a:W[4]?Number(W[4]):1}:null},_=(q,W)=>{const Z=b(q);if(!Z)return q;const ne=ue=>Math.max(0,Math.min(255,Math.round(ue)));return`rgba(${ne(Z.r*(1-W))}, ${ne(Z.g*(1-W))}, ${ne(Z.b*(1-W))}, ${Z.a})`},y=q=>{if(globalThis.window===void 0)return null;const W=document.createElement("div");W.className=q,W.style.position="absolute",W.style.visibility="hidden",W.style.pointerEvents="none",W.style.width="1px",W.style.height="1px",document.body.appendChild(W);const Z=globalThis.getComputedStyle(W).backgroundColor;return W.remove(),!Z||Z==="transparent"||Z==="rgba(0, 0, 0, 0)"?null:Z},x=[50,100,200,300,400,500,600,700,800,900,950],E=q=>{const W=x.indexOf(q);return W===-1?q:x[Math.min(x.length-1,W+2)]},M=(q,W)=>{const Z=Am[q];if(!Z)return null;if(typeof Z=="string")return Z;if(!W)return null;const ne=Z[W];return typeof ne=="string"?ne:null},T=(q,W=!1)=>{if(!q)return null;const Z=W?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ne=q.match(Z);return ne?{colorName:ne[1],shade:ne[2]?Number.parseInt(ne[2],10):null}:null},$=()=>{const q=p.value;if(!q){g.value=null;return}const W=T(q),Z=W==null?void 0:W.colorName,ne=(W==null?void 0:W.shade)??null,ue=(Z?M(Z,ne):null)??y(q);if(!ue){g.value=null;return}let ke;const me=T(A.value,!0),X=me?M(me.colorName,me.shade??null):null;if(X)ke=X;else if(Z&&ne){const O=E(ne);ke=M(Z,O)??_(ue,.2)}else ke=_(ue,.2);g.value={"--btn-color":ue,"--btn-color-hover":ke}};e.onMounted(()=>{$()}),e.watch([p,A],async()=>{await e.nextTick(),$()});const v=e.computed(()=>{const q=/\bdark:bg-/.test(u.value??"");return!D.value||i.value==="outline"||q?"":g.value?"dcode-btn--fill dcode-btn--fill-hover":V.value?"":"hover:brightness-90"}),I=e.computed(()=>{if(!D.value||i.value!=="outline")return"";const q=["dcode-btn--outline","dcode-btn--outline-hover"];return S.value||q.push("border"),!g.value&&!V.value&&q.push("hover:brightness-90"),q.join(" ")}),j=e.computed(()=>g.value??void 0),U={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"}},P={"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"}},R=e.computed(()=>{const q=[],W=l.value,Z=String(o.borderColor||"").toLowerCase(),ne=W?U[W]:null,ue=W?P[W]:null,ke=Z?U[Z]:null;return W&&(ne?ke&&Z!==W?(q.push(ne.bg,ke.hoverBg),o.textColor||q.push(ne.text,ke.hoverText)):(q.push(ne.bg,ne.hoverBg),o.textColor||q.push(ne.text,ne.hoverText)):ue?(q.push(ue.bg,ue.hover),o.textColor||q.push(ue.text)):W==="transparent"?ke?(q.push("bg-transparent",ke.hoverBg),o.textColor||q.push("text-inherit",ke.hoverText)):q.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):q.push(W)),Z?ke?q.push(ke.border,ke.hoverBorder):q.push(Z):ne&&i.value!=="ghost"&&i.value!=="link"&&q.push(ne.border,ne.hoverBorder),o.textColor&&q.push(o.textColor),q.join(" ")}),G=e.computed(()=>_e(Pm,k.value,C.value,B.value,v.value,I.value,R.value));return(q,W)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(w.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(Wi),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ji),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(_t),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:G.value,style:j.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(Ui),{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",Mm,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(_t),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:G.value,style:j.value},d.value),{default:e.withCtx(()=>[e.renderSlot(q.$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)}}),at=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Le=at(Tm,[["__scopeId","data-v-c123cb99"]]),vm={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"},Om={class:"flex flex-col gap-1"},Fm={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},zm={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},Rm={key:0,class:"flex items-center gap-2"},Im={name:"DCodeCard"},qi=e.defineComponent({...Im,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",vm,[e.createElementVNode("div",Om,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Fm,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",zm,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Rm,[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))}}),Lm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},$m={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},jm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Um={class:"flex items-center justify-between"},Wm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Hm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},qm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},Gm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Km={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Xm={class:"flex items-center justify-between"},Ym={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Jm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},Qm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Ca=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}=gt.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",Lm,[e.createElementVNode("div",$m,[e.createElementVNode("div",jm,[e.createElementVNode("div",Um,[e.createElementVNode("h3",Wm,[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",Hm,[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",qm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",Gm,[e.createElementVNode("div",Km,[e.createElementVNode("div",Xm,[e.createElementVNode("h3",Ym,[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",Jm,[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",Qm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),Zm=["aria-busy"],eh={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},th={key:1,class:"flex justify-end"},nh=["for"],oh={key:0,class:"ml-1 text-destructive"},rh={class:"relative w-full group"},ah={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},sh={key:1},ih=["id","value","placeholder"],lh={key:1,class:"absolute inset-y-0 right-4 flex items-center"},ch={key:2,class:"absolute inset-y-0 right-4 flex items-center"},dh={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"},uh={key:1,class:"text-xs text-destructive"},Fn=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,K=o["aria-required"];return O===""||O===!0||O==="true"||(K==="true"||K===!0)}),m=e.computed(()=>{const{label:O,class:K,id:ee,required:he,"aria-required":Ve,...Ne}=o;return Ne}),h=e.computed(()=>{var K,ee;const O={...m.value};return((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((ee=l.valueType)==null?void 0:ee.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}),k=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),C=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!k.value:!0:!1),w=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 K=String(O??"");K!==p.value&&(p.value=K)});const A=e.ref(!1),D=e.ref(!1),S=O=>O.split(/(\s+)/).map(K=>{if(K.trim()==="")return K;const ee=K.toLowerCase();return ee.charAt(0).toUpperCase()+ee.slice(1)}).join(""),V=O=>{const K=O.toLowerCase(),ee=K.search(new RegExp("\\p{L}","u"));return ee<0?K:K.slice(0,ee)+K.charAt(ee).toUpperCase()+K.slice(ee+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return S(O);case"sentencecase":return V(O);case"none":default:return O}},g=O=>{if(!O)return null;const K=Array.isArray(O)?O.join(""):O;return K?new Set(K):null},b=e.computed(()=>g(l.allowChars)),_=(O,K)=>(O.lastIndex=0,O.test(K)),y=O=>{var Re;const K=(Re=l.valueType)==null?void 0:Re.toLowerCase();if(K==="free"||K==="email"||K==="password")return!0;const ee=O===" ",he=/\d/.test(O),Ve=new RegExp("\\p{L}","u").test(O),Ne=new RegExp("\\p{N}","u").test(O),ze=/[\/\-_.,]/.test(O);return K==="number"?he:K==="letter"?Ve||ze||l.allowSpaces&&ee:K==="letternumber"?Ve||Ne||ze||l.allowSpaces&&ee:!0},x=O=>{let K="";for(const ee of O){const he=!!b.value&&b.value.has(ee);l.pattern&&!he&&!_(l.pattern,ee)||!he&&!y(ee)||(K+=ee)}return K},E=e.computed(()=>{const O=l.maxLength??o.maxlength??o.maxLength;let K=Number.NaN;return typeof O=="number"?K=O:typeof O=="string"&&(K=Number.parseInt(O,10)),Number.isFinite(K)&&K>0?K:-1}),M=e.computed(()=>p.value.length),T=e.computed(()=>l.showCharCount?E.value>0:!1),$=O=>E.value>0?O.slice(0,E.value):O,v=O=>{const K=x(O),ee=l.applyTextCaseToValue?B(K):K;return $(ee)};let I=null;const j=O=>{var K;if(O==="")return null;if(((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&l.returnNumber){const ee=Number(O);return Number.isFinite(ee)?ee:null}return O},U=O=>{p.value=O,i("update:modelValue",j(O))},P=(O,K)=>{const ee=$(K);D.value=!0,O.value=ee,U(ee),queueMicrotask(()=>D.value=!1)},R=(O,K)=>{const ee=O.selectionStart??O.value.length,he=O.selectionEnd??O.value.length;if(E.value>0){const Ve=O.value.length-(he-ee),Ne=E.value-Ve;if(Ne<=0)return;K=K.slice(0,Ne)}O.setRangeText(K,ee,he,"end"),P(O,v(O.value))},G=O=>{var he;if(!I||A.value||D.value||!((he=O.inputType)!=null&&he.startsWith("insert")))return;const K=O.data;if(K==null)return;const ee=v(K);ee!==K&&(O.preventDefault(),ee.length>0&&R(I,ee))},q=O=>{var he;if(!I||A.value||D.value)return;const K=((he=O.clipboardData)==null?void 0:he.getData("text"))??"",ee=v(K);ee!==K&&(O.preventDefault(),ee.length>0&&R(I,ee))},W=O=>{if(!I||A.value||D.value)return;const K=O.target,ee=K.value??"",he=v(ee);he===ee?U(he):P(K,he)},Z=()=>A.value=!0,ne=()=>{if(A.value=!1,!I)return;const O=I.value??"",K=v(O);K===O?U(K):P(I,K)};e.onMounted(()=>{if(I=document.getElementById(u.value),!I)return;I.addEventListener("beforeinput",G),I.addEventListener("paste",q),I.addEventListener("input",W),I.addEventListener("compositionstart",Z),I.addEventListener("compositionend",ne);const O=I.value??"",K=v(O);K===O?U(K):P(I,K)}),e.onBeforeUnmount(()=>{I&&(I.removeEventListener("beforeinput",G),I.removeEventListener("paste",q),I.removeEventListener("input",W),I.removeEventListener("compositionstart",Z),I.removeEventListener("compositionend",ne),I=null)});const ue=()=>{p.value="",I&&(I.value=""),i("update:modelValue",null),i("clear")},ke=e.computed(()=>T.value&&M.value>0),me=e.computed(()=>`${M.value} / ${E.value}`),X=e.computed(()=>!!l.error);return(O,K)=>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",eh)):e.createCommentVNode("",!0),K[1]||(K[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",th,[...K[0]||(K[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",oh,"*")):e.createCommentVNode("",!0)],8,nh)):e.createCommentVNode("",!0),e.createElementVNode("div",rh,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",ah,[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",sh,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},h.value,{placeholder:l.placeholder,style:`text-transform: ${w.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${C.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",X.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,ih),r.value?(e.openBlock(),e.createElementBlock("div",lh,[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(te.Eye):e.unref(te.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),C.value&&!r.value?(e.openBlock(),e.createElementBlock("div",ch,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:ue}," ✕ ")])):e.createCommentVNode("",!0),ke.value&&!X.value?(e.openBlock(),e.createElementBlock("p",dh,e.toDisplayString(me.value),1)):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("p",uh,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,Zm)),[[e.vShow,t.visible]])}}),fh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},mh={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"},hh={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},ph={class:"flex items-center justify-between"},gh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},bh={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"},yh={class:"p-6 flex-1"},xh={class:"flex flex-col gap-4"},kh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},wh={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"},Ch={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Bh={class:"flex items-center justify-between"},Eh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},_h={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"},Sh={class:"p-6 flex-1"},Ah={class:"flex flex-col gap-4"},Vh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ba=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=gt.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",fh,[e.createElementVNode("div",mh,[e.createElementVNode("div",hh,[e.createElementVNode("div",ph,[e.createElementVNode("h3",gh,[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",bh,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",yh,[e.createElementVNode("div",xh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(Fn,{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",kh)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",wh,[e.createElementVNode("div",Ch,[e.createElementVNode("div",Bh,[e.createElementVNode("h3",Eh,[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",_h,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Sh,[e.createElementVNode("div",Ah,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(Fn,{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",Vh,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 To(t){return t+.5|0}const En=(t,n,o)=>Math.max(Math.min(t,o),n);function Po(t){return En(To(t*2.55),0,255)}function Bn(t){return En(To(t*255),0,255)}function sn(t){return En(To(t/2.55)/100,0,1)}function yl(t){return En(To(t*100),0,100)}const Ft={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},Ja=[..."0123456789ABCDEF"],Gh=t=>Ja[t&15],Xh=t=>Ja[(t&240)>>4]+Ja[t&15],Cr=t=>(t&240)>>4===(t&15),Kh=t=>Cr(t.r)&&Cr(t.g)&&Cr(t.b)&&Cr(t.a);function Yh(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&Ft[t[1]]*17,g:255&Ft[t[2]]*17,b:255&Ft[t[3]]*17,a:n===5?Ft[t[4]]*17:255}:(n===7||n===9)&&(o={r:Ft[t[1]]<<4|Ft[t[2]],g:Ft[t[3]]<<4|Ft[t[4]],b:Ft[t[5]]<<4|Ft[t[6]],a:n===9?Ft[t[7]]<<4|Ft[t[8]]:255})),o}const Jh=(t,n)=>t<255?n(t):"";function Qh(t){var n=Kh(t)?Gh:Xh;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Jh(t.a,n):void 0}const Zh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xl(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 ep(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 tp(t,n,o){const r=xl(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 np(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 Qa(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=np(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Za(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(Bn)}function es(t,n,o){return Za(xl,t,n,o)}function op(t,n,o){return Za(tp,t,n,o)}function rp(t,n,o){return Za(ep,t,n,o)}function kl(t){return(t%360+360)%360}function ap(t){const n=Zh.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?Po(+n[5]):Bn(+n[5]));const a=kl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=op(a,s,i):n[1]==="hsv"?r=rp(a,s,i):r=es(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function sp(t,n){var o=Qa(t);o[0]=kl(o[0]+n),o=es(o),t.r=o[0],t.g=o[1],t.b=o[2]}function ip(t){if(!t)return;const n=Qa(t),o=n[0],r=yl(n[1]),a=yl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${sn(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const wl={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"},Cl={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 lp(){const t={},n=Object.keys(Cl),o=Object.keys(wl);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,wl[s]);s=parseInt(Cl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Er;function cp(t){Er||(Er=lp(),Er.transparent=[0,0,0,0]);const n=Er[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const dp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function up(t){const n=dp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?Po(i):En(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?Po(r):En(r,0,255)),a=255&(n[4]?Po(a):En(a,0,255)),s=255&(n[6]?Po(s):En(s,0,255)),{r,g:a,b:s,a:o}}}function fp(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${sn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ts=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,oo=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function mp(t,n,o){const r=oo(sn(t.r)),a=oo(sn(t.g)),s=oo(sn(t.b));return{r:Bn(ts(r+o*(oo(sn(n.r))-r))),g:Bn(ts(a+o*(oo(sn(n.g))-a))),b:Bn(ts(s+o*(oo(sn(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Br(t,n,o){if(t){let r=Qa(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=es(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function El(t,n){return t&&Object.assign(n||{},t)}function Bl(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=Bn(t[3]))):(n=El(t,{r:0,g:0,b:0,a:1}),n.a=Bn(n.a)),n}function hp(t){return t.charAt(0)==="r"?up(t):ap(t)}class vo{constructor(n){if(n instanceof vo)return n;const o=typeof n;let r;o==="object"?r=Bl(n):o==="string"&&(r=Yh(n)||cp(n)||hp(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=El(this._rgb);return n&&(n.a=sn(n.a)),n}set rgb(n){this._rgb=Bl(n)}rgbString(){return this._valid?fp(this._rgb):void 0}hexString(){return this._valid?Qh(this._rgb):void 0}hslString(){return this._valid?ip(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=mp(this._rgb,n._rgb,o)),this}clone(){return new vo(this.rgb)}alpha(n){return this._rgb.a=Bn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=To(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 Br(this._rgb,2,n),this}darken(n){return Br(this._rgb,2,-n),this}saturate(n){return Br(this._rgb,1,n),this}desaturate(n){return Br(this._rgb,1,-n),this}rotate(n){return sp(this._rgb,n),this}}/*!
6
+ */function oo(t){return t+.5|0}const on=(t,n,o)=>Math.max(Math.min(t,o),n);function ro(t){return on(oo(t*2.55),0,255)}function rn(t){return on(oo(t*255),0,255)}function jt(t){return on(oo(t/2.55)/100,0,1)}function Gi(t){return on(oo(t*100),0,100)}const bt={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},Ea=[..."0123456789ABCDEF"],Dh=t=>Ea[t&15],Nh=t=>Ea[(t&240)>>4]+Ea[t&15],qo=t=>(t&240)>>4===(t&15),Mh=t=>qo(t.r)&&qo(t.g)&&qo(t.b)&&qo(t.a);function Ph(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&bt[t[1]]*17,g:255&bt[t[2]]*17,b:255&bt[t[3]]*17,a:n===5?bt[t[4]]*17:255}:(n===7||n===9)&&(o={r:bt[t[1]]<<4|bt[t[2]],g:bt[t[3]]<<4|bt[t[4]],b:bt[t[5]]<<4|bt[t[6]],a:n===9?bt[t[7]]<<4|bt[t[8]]:255})),o}const Th=(t,n)=>t<255?n(t):"";function vh(t){var n=Mh(t)?Dh:Nh;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Th(t.a,n):void 0}const Oh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ki(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 Fh(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 zh(t,n,o){const r=Ki(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 Rh(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 _a(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=Rh(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Sa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(rn)}function Aa(t,n,o){return Sa(Ki,t,n,o)}function Ih(t,n,o){return Sa(zh,t,n,o)}function Lh(t,n,o){return Sa(Fh,t,n,o)}function Xi(t){return(t%360+360)%360}function $h(t){const n=Oh.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?ro(+n[5]):rn(+n[5]));const a=Xi(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=Ih(a,s,i):n[1]==="hsv"?r=Lh(a,s,i):r=Aa(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function jh(t,n){var o=_a(t);o[0]=Xi(o[0]+n),o=Aa(o),t.r=o[0],t.g=o[1],t.b=o[2]}function Uh(t){if(!t)return;const n=_a(t),o=n[0],r=Gi(n[1]),a=Gi(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${jt(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const Yi={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"},Ji={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 Wh(){const t={},n=Object.keys(Ji),o=Object.keys(Yi);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,Yi[s]);s=parseInt(Ji[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Go;function Hh(t){Go||(Go=Wh(),Go.transparent=[0,0,0,0]);const n=Go[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const qh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Gh(t){const n=qh.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?ro(i):on(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?ro(r):on(r,0,255)),a=255&(n[4]?ro(a):on(a,0,255)),s=255&(n[6]?ro(s):on(s,0,255)),{r,g:a,b:s,a:o}}}function Kh(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${jt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Va=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,zn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xh(t,n,o){const r=zn(jt(t.r)),a=zn(jt(t.g)),s=zn(jt(t.b));return{r:rn(Va(r+o*(zn(jt(n.r))-r))),g:rn(Va(a+o*(zn(jt(n.g))-a))),b:rn(Va(s+o*(zn(jt(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Ko(t,n,o){if(t){let r=_a(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=Aa(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Qi(t,n){return t&&Object.assign(n||{},t)}function Zi(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=rn(t[3]))):(n=Qi(t,{r:0,g:0,b:0,a:1}),n.a=rn(n.a)),n}function Yh(t){return t.charAt(0)==="r"?Gh(t):$h(t)}class ao{constructor(n){if(n instanceof ao)return n;const o=typeof n;let r;o==="object"?r=Zi(n):o==="string"&&(r=Ph(n)||Hh(n)||Yh(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=Qi(this._rgb);return n&&(n.a=jt(n.a)),n}set rgb(n){this._rgb=Zi(n)}rgbString(){return this._valid?Kh(this._rgb):void 0}hexString(){return this._valid?vh(this._rgb):void 0}hslString(){return this._valid?Uh(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=Xh(this._rgb,n._rgb,o)),this}clone(){return new ao(this.rgb)}alpha(n){return this._rgb.a=rn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=oo(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 Ko(this._rgb,2,n),this}darken(n){return Ko(this._rgb,2,-n),this}saturate(n){return Ko(this._rgb,1,n),this}desaturate(n){return Ko(this._rgb,1,-n),this}rotate(n){return jh(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 ln(){}const pp=(()=>{let t=0;return()=>t++})();function Ge(t){return t==null}function dt(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 Fe(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function yt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Kt(t,n){return yt(t)?t:n}function Te(t,n){return typeof t>"u"?n:t}const gp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,_l=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function nt(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Ye(t,n,o,r){let a,s,i;if(dt(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Fe(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function _r(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 Sr(t){if(dt(t))return t.map(Sr);if(Fe(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Sr(t[o[a]]);return n}return t}function Sl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function bp(t,n,o,r){if(!Sl(t))return;const a=n[t],s=o[t];Fe(a)&&Fe(s)?Oo(a,s,r):n[t]=Sr(s)}function Oo(t,n,o){const r=dt(n)?n:[n],a=r.length;if(!Fe(t))return t;o=o||{};const s=o.merger||bp;let i;for(let l=0;l<a;++l){if(i=r[l],!Fe(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 Fo(t,n){return Oo(t,n,{merger:yp})}function yp(t,n,o){if(!Sl(t))return;const r=n[t],a=o[t];Fe(r)&&Fe(a)?Fo(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Sr(a))}const Vl={"":t=>t,x:t=>t.x,y:t=>t.y};function xp(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 kp(t){const n=xp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Ln(t,n){return(Vl[n]||(Vl[n]=kp(n)))(t)}function ns(t){return t.charAt(0).toUpperCase()+t.slice(1)}const zo=t=>typeof t<"u",_n=t=>typeof t=="function",Al=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function wp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Je=Math.PI,rt=2*Je,Cp=rt+Je,Vr=Number.POSITIVE_INFINITY,Ep=Je/180,ft=Je/2,$n=Je/4,Dl=Je*2/3,Nl=Math.log10,Yt=Math.sign;function Ro(t,n,o){return Math.abs(t-n)<o}function Ml(t){const n=Math.round(t);t=Ro(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(Nl(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function Bp(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 _p(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Io(t){return!_p(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Sp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function Vp(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 cn(t){return t*(Je/180)}function Ap(t){return t*(180/Je)}function Tl(t){if(!yt(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*Je&&(s+=rt),{angle:s,distance:a}}function os(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Dp(t,n){return(t-n+Cp)%rt-Je}function Nt(t){return(t%rt+rt)%rt}function Lo(t,n,o,r){const a=Nt(t),s=Nt(n),i=Nt(o),l=Nt(s-a),c=Nt(i-a),d=Nt(a-s),u=Nt(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function xt(t,n,o){return Math.max(n,Math.min(o,t))}function Np(t){return xt(t,-32768,32767)}function dn(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function rs(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 jn=(t,n,o,r)=>rs(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Mp=(t,n,o)=>rs(t,o,r=>t[r][n]>=o);function Tp(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 vl=["push","pop","shift","splice","unshift"];function Pp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),vl.forEach(o=>{const r="_onData"+ns(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 Ol(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)&&(vl.forEach(s=>{delete t[s]}),delete t._chartjs)}function Fl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const zl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Rl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,zl.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 as=t=>t==="start"?"left":t==="end"?"right":"center",kt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Op=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Fp(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:m,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(a=Math.min(jn(c,u,f).lo,o?r:jn(n,u,i.getPixelForValue(f)).lo),d){const k=c.slice(0,a+1).reverse().findIndex(x=>!Ge(x[l.axis]));a-=Math.max(0,k)}a=xt(a,0,r-1)}if(p){let k=Math.max(jn(c,i.axis,m,!0).hi+1,o?0:jn(n,u,i.getPixelForValue(m),!0).hi+1);if(d){const x=c.slice(k-1).findIndex(g=>!Ge(g[l.axis]));k+=Math.max(0,x)}s=xt(k,a,r)-a}else s=r-a}return{start:a,count:s}}function zp(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 Ar=t=>t===0||t===1,Il=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*rt/o)),Ll=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*rt/o)+1,$o={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*ft)+1,easeOutSine:t=>Math.sin(t*ft),easeInOutSine:t=>-.5*(Math.cos(Je*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=>Ar(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=>Ar(t)?t:Il(t,.075,.3),easeOutElastic:t=>Ar(t)?t:Ll(t,.075,.3),easeInOutElastic(t){return Ar(t)?t:t<.5?.5*Il(t*2,.1125,.45):.5+.5*Ll(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-$o.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?$o.easeInBounce(t*2)*.5:$o.easeOutBounce(t*2-1)*.5+.5};function ss(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function $l(t){return ss(t)?t:new vo(t)}function is(t){return ss(t)?t:new vo(t).saturate(.5).darken(.1).hexString()}const Rp=["x","y","borderWidth","radius","tension"],Ip=["color","borderColor","backgroundColor"];function Lp(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:Ip},numbers:{type:"number",properties:Rp}}),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 $p(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jl=new Map;function jp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=jl.get(o);return r||(r=new Intl.NumberFormat(t,n),jl.set(o,r)),r}function ls(t,n,o){return jp(n,o).format(t)}const Up={values(t){return dt(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=Wp(t,o)}const i=Nl(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),ls(t,r,c)}};function Wp(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 Ul={formatters:Up};function Hp(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:Ul.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 Un=Object.create(null),cs=Object.create(null);function jo(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 ds(t,n,o){return typeof n=="string"?Oo(jo(t,n),o):Oo(jo(t,""),n)}class qp{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)=>is(a.backgroundColor),this.hoverBorderColor=(r,a)=>is(a.borderColor),this.hoverColor=(r,a)=>is(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 ds(this,n,o)}get(n){return jo(this,n)}describe(n,o){return ds(cs,n,o)}override(n,o){return ds(Un,n,o)}route(n,o,r,a){const s=jo(this,n),i=jo(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 Fe(c)?Object.assign({},d,c):Te(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var lt=new qp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Lp,$p,Hp]);function Gp(t){return!t||Ge(t.size)||Ge(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Wl(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 Wn(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 Hl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function us(t,n,o,r){ql(t,n,o,r,null)}function ql(t,n,o,r,a){let s,i,l,c,d,u,f,m;const h=n.pointStyle,p=n.rotation,k=n.radius;let x=(p||0)*Ep;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(x),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(k)||k<=0)){switch(t.beginPath(),h){default:a?t.ellipse(o,r,a/2,k,0,0,rt):t.arc(o,r,k,0,rt),t.closePath();break;case"triangle":u=a?a/2:k,t.moveTo(o+Math.sin(x)*u,r-Math.cos(x)*k),x+=Dl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*k),x+=Dl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*k),t.closePath();break;case"rectRounded":d=k*.516,c=k-d,i=Math.cos(x+$n)*c,f=Math.cos(x+$n)*(a?a/2-d:c),l=Math.sin(x+$n)*c,m=Math.sin(x+$n)*(a?a/2-d:c),t.arc(o-f,r-l,d,x-Je,x-ft),t.arc(o+m,r-i,d,x-ft,x),t.arc(o+f,r+l,d,x,x+ft),t.arc(o-m,r+i,d,x+ft,x+Je),t.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*k,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}x+=$n;case"rectRot":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+m,r-i),t.lineTo(o+f,r+l),t.lineTo(o-m,r+i),t.closePath();break;case"crossRot":x+=$n;case"cross":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"star":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i),x+=$n,f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"line":i=a?a/2:Math.cos(x)*k,l=Math.sin(x)*k,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:k),r+Math.sin(x)*k);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Uo(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 Dr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function Nr(t){t.restore()}function Xp(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 Kp(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 Yp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),Ge(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 Jp(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 Wo(t,n,o,r,a,s={}){const i=dt(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Yp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Qp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Ge(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Jp(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*Je,Je,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Je,ft,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,ft,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-ft,!0),t.lineTo(o+i.topLeft,r)}const Zp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,eg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tg(t,n){const o=(""+t).match(Zp);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 ng=t=>+t||0;function fs(t,n){const o={},r=Fe(n),a=r?Object.keys(n):n,s=Fe(t)?r?i=>Te(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=ng(s(i));return o}function Gl(t){return fs(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ro(t){return fs(t,["topLeft","topRight","bottomLeft","bottomRight"])}function zt(t){const n=Gl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function wt(t,n){t=t||{},n=n||lt.font;let o=Te(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Te(t.style,n.style);r&&!(""+r).match(eg)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Te(t.family,n.family),lineHeight:tg(Te(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Te(t.weight,n.weight),string:""};return a.string=Gp(a),a}function Tr(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 og(t,n,o){const{min:r,max:a}=t,s=_l(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 Hn(t,n){return Object.assign(Object.create(t),n)}function ms(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Ql("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>ms([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 Kl(l,c,()=>ug(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Zl(l).includes(c)},ownKeys(l){return Zl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function ao(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Xl(t,r),setContext:s=>ao(t,s,o,r),override:s=>ao(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 Kl(s,i,()=>ag(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 Xl(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:_n(o)?o:()=>o,isIndexable:_n(r)?r:()=>r}}const rg=(t,n)=>t?t+ns(n):n,hs=(t,n)=>Fe(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Kl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function ag(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return _n(l)&&i.isScriptable(n)&&(l=sg(n,l,t,o)),dt(l)&&l.length&&(l=ig(n,l,t,i.isIndexable)),hs(n,l)&&(l=ao(l,a,s&&s[n],i)),l}function sg(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),hs(t,c)&&(c=ps(a._scopes,a,t,c)),c}function ig(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(Fe(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ps(d,a,t,u);n.push(ao(f,s,i&&i[t],l))}}return n}function Yl(t,n,o){return _n(t)?t(n,o):t}const lg=(t,n)=>t===!0?n:typeof t=="string"?Ln(n,t):void 0;function cg(t,n,o,r,a){for(const s of n){const i=lg(o,s);if(i){t.add(i);const l=Yl(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 ps(t,n,o,r){const a=n._rootScopes,s=Yl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Jl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Jl(l,i,s,c,r),c===null)?!1:ms(Array.from(l),[""],a,s,()=>dg(n,o,r))}function Jl(t,n,o,r,a){for(;o;)o=cg(t,n,o,r,a);return o}function dg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return dt(a)&&Fe(o)?o:a||{}}function ug(t,n,o,r){let a;for(const s of n)if(a=Ql(rg(s,t),o),typeof a<"u")return hs(t,a)?ps(o,r,t,a):a}function Ql(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Zl(t){let n=t._keys;return n||(n=t._keys=fg(t._scopes)),n}function fg(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 mg=Number.EPSILON||1e-14,so=(t,n)=>n<t.length&&!t[n].skip&&t[n],ec=t=>t==="x"?"y":"x";function hg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=os(s,a),c=os(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,m=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+m*(i.x-a.x),y:s.y+m*(i.y-a.y)}}}function pg(t,n,o){const r=t.length;let a,s,i,l,c,d=so(t,0);for(let u=0;u<r-1;++u)if(c=d,d=so(t,u+1),!(!c||!d)){if(Ro(n[u],0,mg)){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 gg(t,n,o="x"){const r=ec(o),a=t.length;let s,i,l,c=so(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=so(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 bg(t,n="x"){const o=ec(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=so(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=so(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?Yt(a[i-1])!==Yt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}pg(t,a,s),gg(t,s,n)}function Pr(t,n,o){return Math.max(Math.min(t,o),n)}function yg(t,n){let o,r,a,s,i,l=Uo(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Uo(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=Pr(a.cp1x,n.left,n.right),a.cp1y=Pr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=Pr(a.cp2x,n.left,n.right),a.cp2y=Pr(a.cp2y,n.top,n.bottom)))}function xg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")bg(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=hg(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&&yg(t,o)}function gs(){return typeof window<"u"&&typeof document<"u"}function bs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function vr(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 Or=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function kg(t,n){return Or(t).getPropertyValue(n)}const wg=["top","right","bottom","left"];function qn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=wg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Cg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function Eg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(Cg(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 Gn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=Or(o),s=a.boxSizing==="border-box",i=qn(a,"padding"),l=qn(a,"border","width"),{x:c,y:d,box:u}=Eg(t,o),f=i.left+(u&&l.left),m=i.top+(u&&l.top);let{width:h,height:p}=n;return s&&(h-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/h*o.width/r),y:Math.round((d-m)/p*o.height/r)}}function Bg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&bs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Or(s),c=qn(l,"border","width"),d=qn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=vr(l.maxWidth,s,"clientWidth"),a=vr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Vr,maxHeight:a||Vr}}const Sn=t=>Math.round(t*10)/10;function _g(t,n,o,r){const a=Or(t),s=qn(a,"margin"),i=vr(a.maxWidth,t,"clientWidth")||Vr,l=vr(a.maxHeight,t,"clientHeight")||Vr,c=Bg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const m=qn(a,"border","width"),h=qn(a,"padding");d-=h.width+m.width,u-=h.height+m.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=Sn(Math.min(d,i,c.maxWidth)),u=Sn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Sn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=Sn(Math.floor(u*r))),{width:d,height:u}}function tc(t,n,o){const r=n||1,a=Sn(t.height*r),s=Sn(t.width*r);t.height=Sn(t.height),t.width=Sn(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 Sg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};gs()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function nc(t,n){const o=kg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Xn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function Vg(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 Ag(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Xn(t,a,o),l=Xn(a,s,o),c=Xn(s,n,o),d=Xn(i,l,o),u=Xn(l,c,o);return Xn(d,u,o)}const Dg=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}}},Ng=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function io(t,n,o){return t?Dg(n,o):Ng()}function oc(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 rc(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function ac(t){return t==="angle"?{between:Lo,compare:Dp,normalize:Nt}:{between:dn,compare:(n,o)=>n-o,normalize:n=>n}}function sc({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 Mg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=ac(r),c=n.length;let{start:d,end:u,loop:f}=t,m,h;if(f){for(d+=c,u+=c,m=0,h=c;m<h&&i(l(n[d%c][r]),a,s);++m)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function ic(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=ac(r),{start:u,end:f,loop:m,style:h}=Mg(t,n,o),p=[];let k=!1,x=null,g,S,E;const C=()=>c(a,E,g)&&l(a,E)!==0,B=()=>l(s,g)===0||c(s,E,g),w=()=>k||C(),y=()=>!k||B();for(let b=u,_=u;b<=f;++b)S=n[b%i],!S.skip&&(g=d(S[r]),g!==E&&(k=c(g,a,s),x===null&&w()&&(x=l(g,a)===0?b:_),x!==null&&y()&&(p.push(sc({start:x,end:b,loop:m,count:i,style:h})),x=null),_=b,E=g));return x!==null&&p.push(sc({start:x,end:f,loop:m,count:i,style:h})),p}function lc(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=ic(r[a],t.points,n);s.length&&o.push(...s)}return o}function Tg(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 Pg(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}=Tg(o,a,s,r);if(r===!0)return cc(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 cc(t,Pg(o,i,c,d),o,n)}function cc(t,n,o,r){return!r||!r.setContext||!o?n:Og(t,n,o,r)}function Og(t,n,o,r){const a=t._chart.getContext(),s=dc(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,m=f;function h(p,k,x,g){const S=l?-1:1;if(p!==k){for(p+=c;o[p%c].skip;)p-=S;for(;o[k%c].skip;)k+=S;p%c!==k%c&&(d.push({start:p%c,end:k%c,loop:x,style:g}),u=g,f=k%c)}}for(const p of n){f=l?f:p.start;let k=o[f%c],x;for(m=f+1;m<=p.end;m++){const g=o[m%c];x=dc(r.setContext(Hn(a,{type:"segment",p0:k,p1:g,p0DataIndex:(m-1)%c,p1DataIndex:m%c,datasetIndex:i}))),Fg(x,u)&&h(f,m-1,p.loop,u),k=g,u=x}f<m-1&&h(f,m-1,p.loop,u)}return d}function dc(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Fg(t,n){if(!n)return!1;const o=[],r=function(a,s){return ss(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Fr(t,n,o){return t.options.clip?t[o]:n[o]}function zg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Fr(o,n,"left"),right:Fr(o,n,"right"),top:Fr(r,n,"top"),bottom:Fr(r,n,"bottom")}:n}function uc(t,n){const o=n._clip;if(o.disabled)return!1;const r=zg(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 Ut(){}const Jh=(()=>{let t=0;return()=>t++})();function ve(t){return t==null}function Xe(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 Se(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function et(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Nt(t,n){return et(t)?t:n}function we(t,n){return typeof t>"u"?n:t}const Qh=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,el=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function $e(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Oe(t,n,o,r){let a,s,i;if(Xe(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Se(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function Xo(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 Yo(t){if(Xe(t))return t.map(Yo);if(Se(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Yo(t[o[a]]);return n}return t}function tl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Zh(t,n,o,r){if(!tl(t))return;const a=n[t],s=o[t];Se(a)&&Se(s)?so(a,s,r):n[t]=Yo(s)}function so(t,n,o){const r=Xe(n)?n:[n],a=r.length;if(!Se(t))return t;o=o||{};const s=o.merger||Zh;let i;for(let l=0;l<a;++l){if(i=r[l],!Se(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 io(t,n){return so(t,n,{merger:ep})}function ep(t,n,o){if(!tl(t))return;const r=n[t],a=o[t];Se(r)&&Se(a)?io(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Yo(a))}const nl={"":t=>t,x:t=>t.x,y:t=>t.y};function tp(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 np(t){const n=tp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function yn(t,n){return(nl[n]||(nl[n]=np(n)))(t)}function Da(t){return t.charAt(0).toUpperCase()+t.slice(1)}const lo=t=>typeof t<"u",an=t=>typeof t=="function",ol=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function op(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Fe=Math.PI,je=2*Fe,rp=je+Fe,Jo=Number.POSITIVE_INFINITY,ap=Fe/180,Je=Fe/2,xn=Fe/4,rl=Fe*2/3,al=Math.log10,Mt=Math.sign;function co(t,n,o){return Math.abs(t-n)<o}function sl(t){const n=Math.round(t);t=co(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(al(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function sp(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 ip(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function uo(t){return!ip(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function lp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function cp(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 Wt(t){return t*(Fe/180)}function dp(t){return t*(180/Fe)}function il(t){if(!et(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function ll(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*Fe&&(s+=je),{angle:s,distance:a}}function Na(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function up(t,n){return(t-n+rp)%je-Fe}function ft(t){return(t%je+je)%je}function fo(t,n,o,r){const a=ft(t),s=ft(n),i=ft(o),l=ft(s-a),c=ft(i-a),d=ft(a-s),u=ft(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function tt(t,n,o){return Math.max(n,Math.min(o,t))}function fp(t){return tt(t,-32768,32767)}function Ht(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function Ma(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 kn=(t,n,o,r)=>Ma(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),mp=(t,n,o)=>Ma(t,o,r=>t[r][n]>=o);function hp(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 pp(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"+Da(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 dl(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 ul(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const fl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function ml(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,fl.call(window,()=>{r=!1,t.apply(n,o)}))}}function gp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const Pa=t=>t==="start"?"left":t==="end"?"right":"center",nt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,bp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function yp(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:m,minDefined:h,maxDefined:k}=i.getUserBounds();if(h){if(a=Math.min(kn(c,u,f).lo,o?r:kn(n,u,i.getPixelForValue(f)).lo),d){const C=c.slice(0,a+1).reverse().findIndex(w=>!ve(w[l.axis]));a-=Math.max(0,C)}a=tt(a,0,r-1)}if(k){let C=Math.max(kn(c,i.axis,m,!0).hi+1,o?0:kn(n,u,i.getPixelForValue(m),!0).hi+1);if(d){const w=c.slice(C-1).findIndex(p=>!ve(p[l.axis]));C+=Math.max(0,w)}s=tt(C,a,r)-a}else s=r-a}return{start:a,count:s}}function xp(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 Qo=t=>t===0||t===1,hl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*je/o)),pl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*je/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*Je)+1,easeOutSine:t=>Math.sin(t*Je),easeInOutSine:t=>-.5*(Math.cos(Fe*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=>Qo(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=>Qo(t)?t:hl(t,.075,.3),easeOutElastic:t=>Qo(t)?t:pl(t,.075,.3),easeInOutElastic(t){return Qo(t)?t:t<.5?.5*hl(t*2,.1125,.45):.5+.5*pl(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 Ta(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function gl(t){return Ta(t)?t:new ao(t)}function va(t){return Ta(t)?t:new ao(t).saturate(.5).darken(.1).hexString()}const kp=["x","y","borderWidth","radius","tension"],wp=["color","borderColor","backgroundColor"];function Cp(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:wp},numbers:{type:"number",properties:kp}}),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 Bp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const bl=new Map;function Ep(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 Oa(t,n,o){return Ep(n,o).format(t)}const _p={values(t){return Xe(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=Sp(t,o)}const i=al(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),Oa(t,r,c)}};function Sp(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 yl={formatters:_p};function Ap(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:yl.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 wn=Object.create(null),Fa=Object.create(null);function ho(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 za(t,n,o){return typeof n=="string"?so(ho(t,n),o):so(ho(t,""),n)}class Vp{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)=>va(a.backgroundColor),this.hoverBorderColor=(r,a)=>va(a.borderColor),this.hoverColor=(r,a)=>va(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 za(this,n,o)}get(n){return ho(this,n)}describe(n,o){return za(Fa,n,o)}override(n,o){return za(wn,n,o)}route(n,o,r,a){const s=ho(this,n),i=ho(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 Se(c)?Object.assign({},d,c):we(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var Ge=new Vp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Cp,Bp,Ap]);function Dp(t){return!t||ve(t.size)||ve(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function xl(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 Cn(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 kl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Ra(t,n,o,r){wl(t,n,o,r,null)}function wl(t,n,o,r,a){let s,i,l,c,d,u,f,m;const h=n.pointStyle,k=n.rotation,C=n.radius;let w=(k||0)*ap;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(w),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(C)||C<=0)){switch(t.beginPath(),h){default:a?t.ellipse(o,r,a/2,C,0,0,je):t.arc(o,r,C,0,je),t.closePath();break;case"triangle":u=a?a/2:C,t.moveTo(o+Math.sin(w)*u,r-Math.cos(w)*C),w+=rl,t.lineTo(o+Math.sin(w)*u,r-Math.cos(w)*C),w+=rl,t.lineTo(o+Math.sin(w)*u,r-Math.cos(w)*C),t.closePath();break;case"rectRounded":d=C*.516,c=C-d,i=Math.cos(w+xn)*c,f=Math.cos(w+xn)*(a?a/2-d:c),l=Math.sin(w+xn)*c,m=Math.sin(w+xn)*(a?a/2-d:c),t.arc(o-f,r-l,d,w-Fe,w-Je),t.arc(o+m,r-i,d,w-Je,w),t.arc(o+f,r+l,d,w,w+Je),t.arc(o-m,r+i,d,w+Je,w+Fe),t.closePath();break;case"rect":if(!k){c=Math.SQRT1_2*C,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}w+=xn;case"rectRot":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+m,r-i),t.lineTo(o+f,r+l),t.lineTo(o-m,r+i),t.closePath();break;case"crossRot":w+=xn;case"cross":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"star":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i),w+=xn,f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"line":i=a?a/2:Math.cos(w)*C,l=Math.sin(w)*C,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(w)*(a?a/2:C),r+Math.sin(w)*C);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 Zo(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function er(t){t.restore()}function Np(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 Mp(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 Pp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),ve(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 Tp(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 vp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function go(t,n,o,r,a,s={}){const i=Xe(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Pp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&vp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),ve(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Tp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function tr(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*Fe,Fe,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Fe,Je,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,Je,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-Je,!0),t.lineTo(o+i.topLeft,r)}const Op=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Fp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zp(t,n){const o=(""+t).match(Op);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 Rp=t=>+t||0;function Ia(t,n){const o={},r=Se(n),a=r?Object.keys(n):n,s=Se(t)?r?i=>we(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Rp(s(i));return o}function Cl(t){return Ia(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Rn(t){return Ia(t,["topLeft","topRight","bottomLeft","bottomRight"])}function yt(t){const n=Cl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ot(t,n){t=t||{},n=n||Ge.font;let o=we(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=we(t.style,n.style);r&&!(""+r).match(Fp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:we(t.family,n.family),lineHeight:zp(we(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:we(t.weight,n.weight),string:""};return a.string=Dp(a),a}function nr(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 Ip(t,n,o){const{min:r,max:a}=t,s=el(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 Bn(t,n){return Object.assign(Object.create(t),n)}function La(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Al("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>La([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 El(l,c,()=>Gp(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Vl(l).includes(c)},ownKeys(l){return Vl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function In(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Bl(t,r),setContext:s=>In(t,s,o,r),override:s=>In(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 El(s,i,()=>$p(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 Bl(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:an(o)?o:()=>o,isIndexable:an(r)?r:()=>r}}const Lp=(t,n)=>t?t+Da(n):n,$a=(t,n)=>Se(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function El(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function $p(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return an(l)&&i.isScriptable(n)&&(l=jp(n,l,t,o)),Xe(l)&&l.length&&(l=Up(n,l,t,i.isIndexable)),$a(n,l)&&(l=In(l,a,s&&s[n],i)),l}function jp(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),$a(t,c)&&(c=ja(a._scopes,a,t,c)),c}function Up(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(Se(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ja(d,a,t,u);n.push(In(f,s,i&&i[t],l))}}return n}function _l(t,n,o){return an(t)?t(n,o):t}const Wp=(t,n)=>t===!0?n:typeof t=="string"?yn(n,t):void 0;function Hp(t,n,o,r,a){for(const s of n){const i=Wp(o,s);if(i){t.add(i);const l=_l(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 ja(t,n,o,r){const a=n._rootScopes,s=_l(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Sl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Sl(l,i,s,c,r),c===null)?!1:La(Array.from(l),[""],a,s,()=>qp(n,o,r))}function Sl(t,n,o,r,a){for(;o;)o=Hp(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 Xe(a)&&Se(o)?o:a||{}}function Gp(t,n,o,r){let a;for(const s of n)if(a=Al(Lp(s,t),o),typeof a<"u")return $a(t,a)?ja(o,r,t,a):a}function Al(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Vl(t){let n=t._keys;return n||(n=t._keys=Kp(t._scopes)),n}function Kp(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 Xp=Number.EPSILON||1e-14,Ln=(t,n)=>n<t.length&&!t[n].skip&&t[n],Dl=t=>t==="x"?"y":"x";function Yp(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=Na(s,a),c=Na(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,m=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+m*(i.x-a.x),y:s.y+m*(i.y-a.y)}}}function Jp(t,n,o){const r=t.length;let a,s,i,l,c,d=Ln(t,0);for(let u=0;u<r-1;++u)if(c=d,d=Ln(t,u+1),!(!c||!d)){if(co(n[u],0,Xp)){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 Qp(t,n,o="x"){const r=Dl(o),a=t.length;let s,i,l,c=Ln(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=Ln(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 Zp(t,n="x"){const o=Dl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=Ln(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=Ln(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?Mt(a[i-1])!==Mt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}Jp(t,a,s),Qp(t,s,n)}function or(t,n,o){return Math.max(Math.min(t,o),n)}function eg(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=or(a.cp1x,n.left,n.right),a.cp1y=or(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=or(a.cp2x,n.left,n.right),a.cp2y=or(a.cp2y,n.top,n.bottom)))}function tg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")Zp(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=Yp(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&&eg(t,o)}function Ua(){return typeof window<"u"&&typeof document<"u"}function Wa(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function rr(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 ar=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function ng(t,n){return ar(t).getPropertyValue(n)}const og=["top","right","bottom","left"];function En(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=og[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const rg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function ag(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(rg(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=ar(o),s=a.boxSizing==="border-box",i=En(a,"padding"),l=En(a,"border","width"),{x:c,y:d,box:u}=ag(t,o),f=i.left+(u&&l.left),m=i.top+(u&&l.top);let{width:h,height:k}=n;return s&&(h-=i.width+l.width,k-=i.height+l.height),{x:Math.round((c-f)/h*o.width/r),y:Math.round((d-m)/k*o.height/r)}}function sg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&Wa(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=ar(s),c=En(l,"border","width"),d=En(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=rr(l.maxWidth,s,"clientWidth"),a=rr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Jo,maxHeight:a||Jo}}const sn=t=>Math.round(t*10)/10;function ig(t,n,o,r){const a=ar(t),s=En(a,"margin"),i=rr(a.maxWidth,t,"clientWidth")||Jo,l=rr(a.maxHeight,t,"clientHeight")||Jo,c=sg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const m=En(a,"border","width"),h=En(a,"padding");d-=h.width+m.width,u-=h.height+m.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=sn(Math.min(d,i,c.maxWidth)),u=sn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=sn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=sn(Math.floor(u*r))),{width:d,height:u}}function Nl(t,n,o){const r=n||1,a=sn(t.height*r),s=sn(t.width*r);t.height=sn(t.height),t.width=sn(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 lg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};Ua()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Ml(t,n){const o=ng(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Sn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function cg(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 dg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Sn(t,a,o),l=Sn(a,s,o),c=Sn(s,n,o),d=Sn(i,l,o),u=Sn(l,c,o);return Sn(d,u,o)}const ug=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}}},fg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function $n(t,n,o){return t?ug(n,o):fg()}function Pl(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 Tl(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function vl(t){return t==="angle"?{between:fo,compare:up,normalize:ft}:{between:Ht,compare:(n,o)=>n-o,normalize:n=>n}}function Ol({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 mg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=vl(r),c=n.length;let{start:d,end:u,loop:f}=t,m,h;if(f){for(d+=c,u+=c,m=0,h=c;m<h&&i(l(n[d%c][r]),a,s);++m)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Fl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=vl(r),{start:u,end:f,loop:m,style:h}=mg(t,n,o),k=[];let C=!1,w=null,p,A,D;const S=()=>c(a,D,p)&&l(a,D)!==0,V=()=>l(s,p)===0||c(s,D,p),B=()=>C||S(),g=()=>!C||V();for(let b=u,_=u;b<=f;++b)A=n[b%i],!A.skip&&(p=d(A[r]),p!==D&&(C=c(p,a,s),w===null&&B()&&(w=l(p,a)===0?b:_),w!==null&&g()&&(k.push(Ol({start:w,end:b,loop:m,count:i,style:h})),w=null),_=b,D=p));return w!==null&&k.push(Ol({start:w,end:f,loop:m,count:i,style:h})),k}function zl(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Fl(r[a],t.points,n);s.length&&o.push(...s)}return o}function hg(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 pg(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 gg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=hg(o,a,s,r);if(r===!0)return Rl(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 Rl(t,pg(o,i,c,d),o,n)}function Rl(t,n,o,r){return!r||!r.setContext||!o?n:bg(t,n,o,r)}function bg(t,n,o,r){const a=t._chart.getContext(),s=Il(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,m=f;function h(k,C,w,p){const A=l?-1:1;if(k!==C){for(k+=c;o[k%c].skip;)k-=A;for(;o[C%c].skip;)C+=A;k%c!==C%c&&(d.push({start:k%c,end:C%c,loop:w,style:p}),u=p,f=C%c)}}for(const k of n){f=l?f:k.start;let C=o[f%c],w;for(m=f+1;m<=k.end;m++){const p=o[m%c];w=Il(r.setContext(Bn(a,{type:"segment",p0:C,p1:p,p0DataIndex:(m-1)%c,p1DataIndex:m%c,datasetIndex:i}))),yg(w,u)&&h(f,m-1,k.loop,u),C=p,u=w}f<m-1&&h(f,m-1,k.loop,u)}return d}function Il(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function yg(t,n){if(!n)return!1;const o=[],r=function(a,s){return Ta(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function sr(t,n,o){return t.options.clip?t[o]:n[o]}function xg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:sr(o,n,"left"),right:sr(o,n,"right"),top:sr(r,n,"top"),bottom:sr(r,n,"bottom")}:n}function Ll(t,n){const o=n._clip;if(o.disabled)return!1;const r=xg(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 Rg{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=zl.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 un=new Rg;const fc="transparent",Ig={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=$l(t||fc),a=r.valid&&$l(n||fc);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Lg{constructor(n,o,r,a){const s=o[r];a=Tr([n.to,a,s,n.from]);const i=Tr([n.from,s,a]);this._active=!0,this._fn=n.fn||Ig[n.type||typeof i],this._easing=$o[n.easing]||$o.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=Tr([n.to,o,a,n.from]),this._from=Tr([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 mc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Fe(n))return;const o=Object.keys(lt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Fe(s))return;const i={};for(const l of o)i[l]=s[l];(dt(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=jg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&$g(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 m=r.get(d);if(f)if(m&&f.active()){f.update(m,u,l);continue}else f.cancel();if(!m||!m.duration){n[d]=u;continue}s[d]=f=new Lg(m,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 un.add(this._chart,r),!0}}function $g(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 jg(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 hc(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 Ug(t,n,o){if(o===!1)return!1;const r=hc(t,o),a=hc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Wg(t){let n,o,r,a;return Fe(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 pc(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 gc(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],yt(d)&&(s||n===0||Yt(n)===Yt(d))&&(n+=d)}return!u&&!r.all?0:n}function Hg(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 ys(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function qg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Gg(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 Xg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function bc(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 yc(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=qg(s,i,r),f=n.length;let m;for(let h=0;h<f;++h){const p=n[h],{[c]:k,[d]:x}=p,g=p._stacks||(p._stacks={});m=g[d]=Xg(a,u,k),m[l]=x,m._top=bc(m,i,!0,r.type),m._bottom=bc(m,i,!1,r.type);const S=m._visualValues||(m._visualValues={});S[l]=x}}function xs(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Kg(t,n){return Hn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Yg(t,n,o){return Hn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Ho(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 ks=t=>t==="reset"||t==="none",xc=(t,n)=>n?t:Object.assign({},t),Jg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:pc(o,!0),values:null};class Kn{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=ys(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&&Ho(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,m,h,p)=>f==="x"?m:f==="r"?p:h,s=o.xAxisID=Te(r.xAxisID,xs(n,"x")),i=o.yAxisID=Te(r.yAxisID,xs(n,"y")),l=o.rAxisID=Te(r.rAxisID,xs(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&&Ol(this._data,this),n._stacked&&Ho(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Fe(o)){const a=this._cachedMeta;this._data=Hg(o,a)}else if(r!==o){if(r){Ol(r,this);const a=this._cachedMeta;Ho(a),a._parsed=[]}o&&Object.isExtensible(o)&&Pp(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=ys(o.vScale,o),o.stack!==r.stack&&(a=!0,Ho(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(yc(this,o._parsed),o._stacked=ys(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,m;if(this._parsing===!1)r._parsed=a,r._sorted=!0,m=a;else{dt(a[n])?m=this.parseArrayData(r,a,n,o):Fe(a[n])?m=this.parseObjectData(r,a,n,o):m=this.parsePrimitiveData(r,a,n,o);const h=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=m[u],c&&(h()&&(c=!1),d=f);r._sorted=c}i&&yc(this,m)}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 m,h,p;for(m=0,h=a;m<h;++m)p=m+r,f[m]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};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,m,h;for(u=0,f=a;u<f;++u)m=u+r,h=o[m],d[u]={x:s.parse(Ln(h,l),m),y:i.parse(Ln(h,c),m)};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:pc(a,!0),values:o._stacks[n.axis]._visualValues};return gc(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=gc(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=Jg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Gg(l);let m,h;function p(){h=a[m];const k=h[l.axis];return!yt(h[n.axis])||u>k||f<k}for(m=0;m<i&&!(!p()&&(this.updateRangeFromParsed(d,n,h,c),s));++m);if(s){for(m=i-1;m>=0;--m)if(!p()){this.updateRangeFromParsed(d,n,h,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],yt(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=Wg(Te(this.options.clip,Ug(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=Yg(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=Kg(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&&zo(r);if(l)return xc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],m=d.getOptionScopes(this.getDataset(),u),h=Object.keys(lt.elements[n]),p=()=>this.getContext(r,a,o),k=d.resolveNamedOptions(m,h,p,f);return k.$shared&&(k.$shared=c,s[i]=Object.freeze(xc(k,c))),k}_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),m=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(m,this.getContext(n,r,o))}const d=new mc(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||ks(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){ks(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!ks(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&&Ho(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])}}we(Kn,"defaults",{}),we(Kn,"datasetElementType",null),we(Kn,"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=Fl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Zg(t){const n=t.iScale,o=Qg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(zo(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 e0(t,n,o,r){const a=o.barThickness;let s,i;return Ge(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 t0(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 n0(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 kc(t,n,o,r){return dt(t)?n0(t,n,o,r):n[o.axis]=o.parse(t,r),n}function wc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,m;for(d=o,u=o+r;d<u;++d)m=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(kc(m,f,s,d));return c}function ws(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function o0(t,n,o){return t!==0?Yt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function r0(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 a0(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}=r0(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Cc(u,i,l,c)]=!0,a=d)),s[Cc(a,i,l,c)]=!0,t.borderSkipped=s}function Cc(t,n,o,r){return r?(t=s0(t,n,o),t=Ec(t,o,n)):t=Ec(t,n,o),t}function s0(t,n,o){return t===n?o:t===o?n:t}function Ec(t,n,o){return t==="start"?n:t==="end"?o:t}function i0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class zr extends Kn{parsePrimitiveData(n,o,r,a){return wc(n,o,r,a)}parseArrayData(n,o,r,a){return wc(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 m,h,p,k;for(m=r,h=r+a;m<h;++m)k=o[m],p={},p[s.axis]=s.parse(Ln(k,d),m),f.push(kc(Ln(k,u),p,i,m));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=ws(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:m}=this._getSharedOptions(o,a);for(let h=o;h<o+r;h++){const p=this.getParsed(h),k=s||Ge(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),x=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[l.axis],S={horizontal:d,base:k.base,enableBorderRadius:!g||ws(p._custom)||i===g._top||i===g._bottom,x:d?k.head:x.center,y:d?x.center:k.head,height:d?x.size:Math.abs(k.size),width:d?Math.abs(k.size):x.size};m&&(S.options=f||this.resolveDataElementOptions(h,n[h].active?"active":a));const E=S.options||n[h].options;a0(S,E,g,i),i0(S,E,u.ratio),this.updateElement(n[h],h,S,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(h=>h[r.axis]===c),m=f&&f[u.vScale.axis];if(Ge(m)||isNaN(m))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[Te(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||Zg(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=ws(d);let f=c[o.axis],m=0,h=r?this.applyStack(o,c,r):f,p,k;h!==f&&(m=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Yt(f)!==Yt(d.barEnd)&&(m=0),m+=f);const x=!Ge(s)&&!u?s:m;let g=o.getPixelForValue(x);if(this.chart.getDataVisibility(n)?p=o.getPixelForValue(m+h):p=g,k=p-g,Math.abs(k)<i){k=o0(k,o,l)*i,f===l&&(g-=k/2);const S=o.getPixelForDecimal(0),E=o.getPixelForDecimal(1),C=Math.min(S,E),B=Math.max(S,E);g=Math.max(Math.min(g,B),C),p=g+k,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(p)-o.getValueForPixel(g))}if(g===o.getPixelForValue(l)){const S=Yt(k)*o.getLineWidthForValue(l)/2;g+=S,k-=S}return{size:k,base:g,head:p,center:p+k/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Te(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"?t0(n,o,a,u*d):e0(n,o,a,u*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(Te(m,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+h;l=f.start+f.chunk*p+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)}}we(zr,"id","bar"),we(zr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),we(zr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function l0(t,n,o){let r=1,a=1,s=0,i=0;if(n<rt){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),m=Math.sin(c),h=(E,C,B)=>Lo(E,l,c,!0)?1:Math.max(C,C*o,B,B*o),p=(E,C,B)=>Lo(E,l,c,!0)?-1:Math.min(C,C*o,B,B*o),k=h(0,d,f),x=h(ft,u,m),g=p(Je,d,f),S=p(Je+ft,u,m);r=(k-g)/2,a=(x-S)/2,s=-(k+g)/2,i=-(x+S)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class lo extends Kn{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(Fe(r[n])){const{key:c="value"}=this._parsing;s=d=>+Ln(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return cn(this.options.rotation-90)}_getCircumference(){return cn(this.options.circumference)}_getRotationExtents(){let n=rt,o=-rt;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(gp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:m,ratioY:h,offsetX:p,offsetY:k}=l0(f,u,c),x=(r.width-i)/m,g=(r.height-i)/h,S=Math.max(Math.min(x,g)/2,0),E=_l(this.options.radius,S),C=Math.max(E*c,0),B=(E-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=k*E,a.total=this.calculateTotal(),this.outerRadius=E-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*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/rt)}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,m=s&&d.animateScale,h=m?0:this.innerRadius,p=m?0:this.outerRadius,{sharedOptions:k,includeOptions:x}=this._getSharedOptions(o,a);let g=this._getRotation(),S;for(S=0;S<o;++S)g+=this._circumference(S,s);for(S=o;S<o+r;++S){const E=this._circumference(S,s),C=n[S],B={x:u+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+E,circumference:E,outerRadius:p,innerRadius:h};x&&(B.options=k||this.resolveDataElementOptions(S,C.active?"active":a)),g+=E,this.updateElement(C,S,B,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)?rt*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=ls(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(Te(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}we(lo,"id","doughnut"),we(lo,"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"}),we(lo,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),we(lo,"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 Rr extends Kn{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}=Fp(o,a,i);this._drawStart=l,this._drawCount=c,zp(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),m=i.axis,h=l.axis,{spanGaps:p,segment:k}=this.options,x=Io(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||s||a==="none",S=o+r,E=n.length;let C=o>0&&this.getParsed(o-1);for(let B=0;B<E;++B){const w=n[B],y=g?w:{};if(B<o||B>=S){y.skip=!0;continue}const b=this.getParsed(B),_=Ge(b[h]),V=y[m]=i.getPixelForValue(b[m],B),D=y[h]=s||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[h],B);y.skip=isNaN(V)||isNaN(D)||_,y.stop=B>0&&Math.abs(b[m]-C[m])>x,k&&(y.parsed=b,y.raw=d.data[B]),f&&(y.options=u||this.resolveDataElementOptions(B,w.active?"active":a)),g||this.updateElement(w,B,y,a),C=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()}}we(Rr,"id","line"),we(Rr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),we(Rr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Cs extends lo{}we(Cs,"id","pie"),we(Cs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Es{constructor(n){we(this,"options");this.options=n||{}}static override(n){Object.assign(Es.prototype,n)}init(){}formats(){return Yn()}parse(){return Yn()}format(){return Yn()}add(){return Yn()}diff(){return Yn()}startOf(){return Yn()}endOf(){return Yn()}}var c0={_date:Es};function d0(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?Mp:jn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const m=d(s,n,o-f),h=d(s,n,o+f);return{lo:m.lo,hi:h.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:m}=t,h=m.slice(0,u.lo+1).reverse().findIndex(k=>!Ge(k[f.axis]));u.lo-=Math.max(0,h);const p=m.slice(u.hi).findIndex(k=>!Ge(k[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function Ir(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:m}=d0(s[l],n,i,a);for(let h=f;h<=m;++h){const p=u[h];p.skip||r(p,d,h)}}}function u0(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 Bs(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Ir(t,o,n,function(l,c,d){!a&&!Uo(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function f0(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});Lo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Ir(t,o,n,s),a}function m0(t,n,o,r,a,s){let i=[];const l=u0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,m){const h=u.inRange(n.x,n.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(p))&&!h)return;const x=l(n,p);x<c?(i=[{element:u,datasetIndex:f,index:m}],c=x):x===c&&i.push({element:u,datasetIndex:f,index:m})}return Ir(t,o,n,d),i}function _s(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?f0(t,n,o,a):m0(t,n,o,r,a,s)}function Bc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Ir(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 h0={modes:{index(t,n,o,r){const a=Gn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Bs(t,a,s,r,i):_s(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=Gn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Bs(t,a,s,r,i):_s(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=Gn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Bs(t,a,s,r,i)},nearest(t,n,o,r){const a=Gn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return _s(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Gn(n,t);return Bc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Gn(n,t);return Bc(t,a,"y",o.intersect,r)}}};const _c=["left","top","right","bottom"];function qo(t,n){return t.filter(o=>o.pos===n)}function Sc(t,n){return t.filter(o=>_c.indexOf(o.pos)===-1&&o.box.axis===n)}function Go(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 p0(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 g0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!_c.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 b0(t,n){const o=g0(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 y0(t){const n=p0(t),o=Go(n.filter(d=>d.box.fullSize),!0),r=Go(qo(n,"left"),!0),a=Go(qo(n,"right")),s=Go(qo(n,"top"),!0),i=Go(qo(n,"bottom")),l=Sc(n,"x"),c=Sc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:qo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function Vc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function Ac(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 x0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Fe(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&&Ac(i,s.getPadding());const l=Math.max(0,n.outerWidth-Vc(i,t,"left","right")),c=Math.max(0,n.outerHeight-Vc(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 k0(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 w0(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 Xo(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,w0(l.horizontal,n));const{same:f,other:m}=x0(n,o,l,r);d|=f&&a.length,u=u||m,c.fullSize||a.push(l)}return d&&Xo(a,n,o,r)||u}function Lr(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 Dc(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,m=d.size||c.height;zo(d.start)&&(i=d.start),c.fullSize?Lr(c,a.left,i,o.outerWidth-a.right-a.left,m):Lr(c,n.left+d.placed,i,f,m),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,m=d.size||c.width;zo(d.start)&&(s=d.start),c.fullSize?Lr(c,s,a.top,m,o.outerHeight-a.bottom-a.top):Lr(c,s,n.top+d.placed,m,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Rt={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=zt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=y0(t.boxes),c=l.vertical,d=l.horizontal;Ye(t.boxes,k=>{typeof k.beforeLayout=="function"&&k.beforeLayout()});const u=c.reduce((k,x)=>x.box.options&&x.box.options.display===!1?k:k+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),m=Object.assign({},a);Ac(m,zt(r));const h=Object.assign({maxPadding:m,w:s,h:i,x:a.left,y:a.top},a),p=b0(c.concat(d),f);Xo(l.fullSize,h,f,p),Xo(c,h,f,p),Xo(d,h,f,p)&&Xo(c,h,f,p),k0(h),Dc(l.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Dc(l.rightAndBottom,h,f,p),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ye(l.chartArea,k=>{const x=k.box;Object.assign(x,t.chartArea),x.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Nc{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 C0 extends Nc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const $r="$chartjs",E0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mc=t=>t===null||t==="";function B0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[$r]={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",Mc(a)){const s=nc(t,"width");s!==void 0&&(t.width=s)}if(Mc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=nc(t,"height");s!==void 0&&(t.height=s)}return t}const Tc=Sg?{passive:!0}:!1;function _0(t,n,o){t&&t.addEventListener(n,o,Tc)}function S0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,Tc)}function V0(t,n){const o=E0[t.type]||t.type,{x:r,y:a}=Gn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function jr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function A0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.addedNodes,r),i=i&&!jr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function D0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.removedNodes,r),i=i&&!jr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Ko=new Map;let Pc=0;function vc(){const t=window.devicePixelRatio;t!==Pc&&(Pc=t,Ko.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function N0(t,n){Ko.size||window.addEventListener("resize",vc),Ko.set(t,n)}function M0(t){Ko.delete(t),Ko.size||window.removeEventListener("resize",vc)}function T0(t,n,o){const r=t.canvas,a=r&&bs(r);if(!a)return;const s=Rl((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),N0(t,s),i}function Ss(t,n,o){o&&o.disconnect(),n==="resize"&&M0(t)}function P0(t,n,o){const r=t.canvas,a=Rl(s=>{t.ctx!==null&&o(V0(s,t))},t);return _0(r,n,a),a}class v0 extends Nc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(B0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[$r])return!1;const r=o[$r].initial;["height","width"].forEach(s=>{const i=r[s];Ge(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[$r],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:A0,detach:D0,resize:T0}[o]||P0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:Ss,detach:Ss,resize:Ss}[o]||S0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return _g(n,o,r,a)}isAttached(n){const o=n&&bs(n);return!!(o&&o.isConnected)}}function O0(t){return!gs()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?C0:v0}let fn=(wa=class{constructor(){we(this,"x");we(this,"y");we(this,"active",!1);we(this,"options");we(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return Io(this.x)&&Io(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}},we(wa,"defaults",{}),we(wa,"defaultRoutes"),wa);function F0(t,n){const o=t.options.ticks,r=z0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?I0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return L0(n,d,s,i/a),d;const u=R0(s,n,a);if(i>0){let f,m;const h=i>1?Math.round((c-l)/(i-1)):null;for(Ur(n,d,u,Ge(h)?0:l-h,l),f=0,m=i-1;f<m;f++)Ur(n,d,u,s[f],s[f+1]);return Ur(n,d,u,c,Ge(h)?n.length:c+h),d}return Ur(n,d,u),d}function z0(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 R0(t,n,o){const r=$0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=Bp(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 I0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function L0(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 Ur(t,n,o,r,a){const s=Te(r,0),i=Math.min(Te(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 $0(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 j0=t=>t==="left"?"right":t==="right"?"left":t,Oc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,Fc=(t,n)=>Math.min(n||t,t);function zc(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 U0(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 W0(t,n){Ye(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 Yo(t){return t.drawTicks?t.tickLength:0}function Rc(t,n){if(!t.display)return 0;const o=wt(t.font,n),r=zt(t.padding);return(dt(t.text)?t.text.length:1)*o.lineHeight+r.height}function H0(t,n){return Hn(t,{scale:n,type:"scale"})}function q0(t,n,o){return Hn(t,{tick:o,index:n,type:"tick"})}function G0(t,n,o){let r=as(t);return(o&&n!=="right"||!o&&n==="right")&&(r=j0(r)),r}function X0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,m,h,p;const k=i-a,x=l-s;if(t.isHorizontal()){if(h=kt(r,s,l),Fe(o)){const g=Object.keys(o)[0],S=o[g];p=u[g].getPixelForValue(S)+k-n}else o==="center"?p=(d.bottom+d.top)/2+k-n:p=Oc(t,o,n);m=l-s}else{if(Fe(o)){const g=Object.keys(o)[0],S=o[g];h=u[g].getPixelForValue(S)-x+n}else o==="center"?h=(d.left+d.right)/2-x+n:h=Oc(t,o,n);p=kt(r,i,a),f=o==="left"?-ft:ft}return{titleX:h,titleY:p,maxWidth:m,rotation:f}}class co extends fn{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=Kt(n,Number.POSITIVE_INFINITY),o=Kt(o,Number.NEGATIVE_INFINITY),r=Kt(r,Number.POSITIVE_INFINITY),a=Kt(a,Number.NEGATIVE_INFINITY),{min:Kt(n,r),max:Kt(o,a),minDefined:yt(n),maxDefined:yt(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:Kt(o,Kt(r,o)),max:Kt(r,Kt(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(){nt(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=og(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?zc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=F0(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(){nt(this.options.afterUpdate,[this])}beforeSetDimensions(){nt(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(){nt(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),nt(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){nt(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=nt(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){nt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){nt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=Fc(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,m=u.highest.height,h=xt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:h/(r-1),f+6>l&&(l=h/(r-(n.offset?.5:1)),c=this.maxHeight-Yo(n.grid)-o.padding-Rc(n.title,this.chart.options.font),d=Math.sqrt(f*f+m*m),i=Ap(Math.min(Math.asin(xt((u.highest.height+6)/l,-1,1)),Math.asin(xt(c/d,-1,1))-Math.asin(xt(m/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){nt(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=Rc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Yo(s)+c):(n.height=this.maxHeight,n.width=Yo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:m}=this._getLabelSizes(),h=r.padding*2,p=cn(this.labelRotation),k=Math.cos(p),x=Math.sin(p);if(l){const g=r.mirror?0:x*f.width+k*m.height;n.height=Math.min(this.maxHeight,n.height+g+h)}else{const g=r.mirror?0:k*f.width+x*m.height;n.width=Math.min(this.maxWidth,n.width+g+h)}this._calculatePadding(d,u,x,k)}}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 m=0,h=0;c?d?(m=a*n.width,h=r*o.height):(m=r*n.height,h=a*o.width):s==="start"?h=o.width:s==="end"?m=n.width:s!=="inner"&&(m=n.width/2,h=o.width/2),this.paddingLeft=Math.max((m-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-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(){nt(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++)Ge(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=zc(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/Fc(o,r));let d=0,u=0,f,m,h,p,k,x,g,S,E,C,B;for(f=0;f<o;f+=c){if(p=n[f].label,k=this._resolveTickFontOptions(f),a.font=x=k.string,g=s[x]=s[x]||{data:{},gc:[]},S=k.lineHeight,E=C=0,!Ge(p)&&!dt(p))E=Wl(a,g.data,g.gc,E,p),C=S;else if(dt(p))for(m=0,h=p.length;m<h;++m)B=p[m],!Ge(B)&&!dt(B)&&(E=Wl(a,g.data,g.gc,E,B),C+=S);i.push(E),l.push(C),d=Math.max(E,d),u=Math.max(C,u)}W0(s,o);const w=i.indexOf(d),y=l.indexOf(u),b=_=>({width:i[_]||0,height:l[_]||0});return{first:b(0),last:b(o-1),widest:b(w),highest:b(y),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 Np(this._alignToPixels?Wn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=q0(this.getContext(),n,r))}return this.$context||(this.$context=H0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=cn(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),m=Yo(s),h=[],p=l.setContext(this.getContext()),k=p.display?p.width:0,x=k/2,g=function(O){return Wn(r,O,k)};let S,E,C,B,w,y,b,_,V,D,N,T;if(i==="top")S=g(this.bottom),y=this.bottom-m,_=S-x,D=g(n.top)+x,T=n.bottom;else if(i==="bottom")S=g(this.top),D=n.top,T=g(n.bottom)-x,y=S+x,_=this.top+m;else if(i==="left")S=g(this.right),w=this.right-m,b=S-x,V=g(n.left)+x,N=n.right;else if(i==="right")S=g(this.left),V=n.left,N=g(n.right)-x,w=S+x,b=this.left+m;else if(o==="x"){if(i==="center")S=g((n.top+n.bottom)/2+.5);else if(Fe(i)){const O=Object.keys(i)[0],H=i[O];S=g(this.chart.scales[O].getPixelForValue(H))}D=n.top,T=n.bottom,y=S+x,_=y+m}else if(o==="y"){if(i==="center")S=g((n.left+n.right)/2);else if(Fe(i)){const O=Object.keys(i)[0],H=i[O];S=g(this.chart.scales[O].getPixelForValue(H))}w=S-x,b=w-m,V=n.left,N=n.right}const v=Te(a.ticks.maxTicksLimit,f),X=Math.max(1,Math.ceil(f/v));for(E=0;E<f;E+=X){const O=this.getContext(E),H=s.setContext(O),Y=l.setContext(O),oe=H.lineWidth,M=H.color,L=Y.dash||[],ee=Y.dashOffset,Q=H.tickWidth,W=H.tickColor,ie=H.tickBorderDash||[],de=H.tickBorderDashOffset;C=U0(this,E,c),C!==void 0&&(B=Wn(r,C,oe),d?w=b=V=N=B:y=_=D=T=B,h.push({tx1:w,ty1:y,tx2:b,ty2:_,x1:V,y1:D,x2:N,y2:T,width:oe,color:M,borderDash:L,borderDashOffset:ee,tickWidth:Q,tickColor:W,tickBorderDash:ie,tickBorderDashOffset:de}))}return this._ticksLength=f,this._borderValue=S,h}_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,m=Yo(r.grid),h=m+u,p=f?-u:h,k=-cn(this.labelRotation),x=[];let g,S,E,C,B,w,y,b,_,V,D,N,T="middle";if(a==="top")w=this.bottom-p,y=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+p,y=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(m);y=X.textAlign,B=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(m);y=X.textAlign,B=X.x}else if(o==="x"){if(a==="center")w=(n.top+n.bottom)/2+h;else if(Fe(a)){const X=Object.keys(a)[0],O=a[X];w=this.chart.scales[X].getPixelForValue(O)+h}y=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")B=(n.left+n.right)/2-h;else if(Fe(a)){const X=Object.keys(a)[0],O=a[X];B=this.chart.scales[X].getPixelForValue(O)}y=this._getYAxisLabelAlignment(m).textAlign}o==="y"&&(c==="start"?T="top":c==="end"&&(T="bottom"));const v=this._getLabelSizes();for(g=0,S=l.length;g<S;++g){E=l[g],C=E.label;const X=s.setContext(this.getContext(g));b=this.getPixelForTick(g)+s.labelOffset,_=this._resolveTickFontOptions(g),V=_.lineHeight,D=dt(C)?C.length:1;const O=D/2,H=X.color,Y=X.textStrokeColor,oe=X.textStrokeWidth;let M=y;i?(B=b,y==="inner"&&(g===S-1?M=this.options.reverse?"left":"right":g===0?M=this.options.reverse?"right":"left":M="center"),a==="top"?d==="near"||k!==0?N=-D*V+V/2:d==="center"?N=-v.highest.height/2-O*V+V:N=-v.highest.height+V/2:d==="near"||k!==0?N=V/2:d==="center"?N=v.highest.height/2-O*V:N=v.highest.height-D*V,f&&(N*=-1),k!==0&&!X.showLabelBackdrop&&(B+=V/2*Math.sin(k))):(w=b,N=(1-D)*V/2);let L;if(X.showLabelBackdrop){const ee=zt(X.backdropPadding),Q=v.heights[g],W=v.widths[g];let ie=N-ee.top,de=0-ee.left;switch(T){case"middle":ie-=Q/2;break;case"bottom":ie-=Q;break}switch(y){case"center":de-=W/2;break;case"right":de-=W;break;case"inner":g===S-1?de-=W:g>0&&(de-=W/2);break}L={left:de,top:ie,width:W+ee.width,height:Q+ee.height,color:X.backdropColor}}x.push({label:C,font:_,textOffset:N,options:{rotation:k,color:H,strokeColor:Y,strokeWidth:oe,textAlign:M,textBaseline:T,translation:[B,w],backdrop:L}})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-cn(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,m;this.isHorizontal()?(d=Wn(n,this.left,i)-i/2,u=Wn(n,this.right,l)+l/2,f=m=c):(f=Wn(n,this.top,i)-i/2,m=Wn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,m),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Dr(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;Wo(r,d,0,u,c,l)}a&&Nr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=wt(r.font),i=zt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Fe(o)?(c+=i.bottom,dt(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:m}=X0(this,c,o,l);Wo(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:m,textAlign:G0(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=Te(n.grid&&n.grid.z,-1),a=Te(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==co.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 wt(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Wr{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;J0(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,K0(n,i,r),this.override&&lt.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 lt[a]&&(delete lt[a][r],this.override&&delete Un[r])}}function K0(t,n,o){const r=Oo(Object.create(null),[o?lt.get(o):{},lt.get(n),t.defaults]);lt.set(n,r),t.defaultRoutes&&Y0(n,t.defaultRoutes),t.descriptors&&lt.describe(n,t.descriptors)}function Y0(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(".");lt.route(s,a,c,l)})}function J0(t){return"id"in t&&"defaults"in t}class Q0{constructor(){this.controllers=new Wr(Kn,"datasets",!0),this.elements=new Wr(fn,"elements"),this.plugins=new Wr(Object,"plugins"),this.scales=new Wr(co,"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):Ye(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=ns(n);nt(r["before"+a],[],r),o[n](r),nt(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 Q0;class Z0{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(nt(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){Ge(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=Te(r.options&&r.options.plugins,{}),s=eb(r);return a===!1&&!o?[]:nb(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 eb(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 tb(t,n){return!n&&t===!1?null:t===!0?{}:t}function nb(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=tb(r[c],a);d!==null&&s.push({plugin:l,options:ob(t.config,{plugin:l,local:o[c]},d,i)})}return s}function ob(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 Vs(t,n){const o=lt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function rb(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function ab(t,n){return t===n?"_index_":"_value_"}function Ic(t){if(t==="x"||t==="y"||t==="r")return t}function sb(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function As(t,...n){if(Ic(t))return t;for(const o of n){const r=o.axis||sb(o.position)||t.length>1&&Ic(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Lc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function ib(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 Lc(t,"x",o[0])||Lc(t,"y",o[0])}return{}}function lb(t,n){const o=Un[t.type]||{scales:{}},r=n.scales||{},a=Vs(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Fe(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=As(i,l,ib(i,t),lt.scales[l.type]),d=ab(c,a),u=o.scales||{};s[i]=Fo(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Vs(l,n),u=(Un[l]||{}).scales||{};Object.keys(u).forEach(f=>{const m=rb(f,c),h=i[m+"AxisID"]||m;s[h]=s[h]||Object.create(null),Fo(s[h],[{axis:m},r[h],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Fo(l,[lt.scales[l.type],lt.scale])}),s}function $c(t){const n=t.options||(t.options={});n.plugins=Te(n.plugins,{}),n.scales=lb(t,n)}function jc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function cb(t){return t=t||{},t.data=jc(t.data),$c(t),t}const Uc=new Map,Wc=new Set;function Hr(t,n){let o=Uc.get(t);return o||(o=n(),Uc.set(t,o),Wc.add(o)),o}const Jo=(t,n,o)=>{const r=Ln(n,o);r!==void 0&&t.add(r)};class db{constructor(n){this._config=cb(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=jc(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(),$c(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Hr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Hr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Hr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Hr(`${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=>Jo(c,n,f))),u.forEach(f=>Jo(c,a,f)),u.forEach(f=>Jo(c,Un[s]||{},f)),u.forEach(f=>Jo(c,lt,f)),u.forEach(f=>Jo(c,cs,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Wc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,Un[o]||{},lt.datasets[o]||{},{type:o},lt,cs]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Hc(this._resolverCache,n,a);let c=i;if(fb(i,o)){s.$shared=!1,r=_n(r)?r():r;const d=this.createResolver(n,r,l);c=ao(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Hc(this._resolverCache,n,r);return Fe(o)?ao(s,o,void 0,a):s}}function Hc(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:ms(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const ub=t=>Fe(t)&&Object.getOwnPropertyNames(t).some(n=>_n(t[n]));function fb(t,n){const{isScriptable:o,isIndexable:r}=Xl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(_n(l)||ub(l))||i&&dt(l))return!0}return!1}var mb="4.5.1";const hb=["top","bottom","left","right","chartArea"];function qc(t,n){return t==="top"||t==="bottom"||hb.indexOf(t)===-1&&n==="x"}function Gc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Xc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),nt(o&&o.onComplete,[t],n)}function pb(t){const n=t.chart,o=n.options.animation;nt(o&&o.onProgress,[t],n)}function Kc(t){return gs()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Yc=t=>{const n=Kc(t);return Object.values(qr).filter(o=>o.canvas===n).pop()};function gb(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 bb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class mn{static register(...n){Jt.add(...n),Jc()}static unregister(...n){Jt.remove(...n),Jc()}constructor(n,o){const r=this.config=new db(o),a=Kc(n),s=Yc(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||O0(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=pp(),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 Z0,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=[],qr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}un.listen(this,"complete",Xc),un.listen(this,"progress",pb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return Ge(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():tc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hl(this.canvas,this.ctx),this}stop(){return un.stop(this),this}resize(n,o){un.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,tc(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),nt(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ye(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=As(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ye(s,i=>{const l=i.options,c=l.id,d=As(c,l),u=Te(l.type,i.dtype);(l.position===void 0||qc(l.position,d)!==qc(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 m=Jt.getScale(u);f=new m({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Ye(a,(i,l)=>{i||delete r[l]}),Ye(r,i=>{Rt.configure(this,i,i.options),Rt.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(Gc("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||Vs(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}=lt.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(){Ye(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),m=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(m),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Ye(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Gc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ye(this.scales,n=>{Rt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!Al(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;gb(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(!Al(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;Rt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Ye(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,_n(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&&(un.has(this)?this.attached&&!un.running(this)&&un.start(this):(this.draw(),Xc({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=uc(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Dr(o,a),n.controller.draw(),a&&Nr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Uo(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=h0.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=Hn(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);zo(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(),un.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(),Hl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete qr[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)};Ye(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(){Ye(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Ye(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}});!_r(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=wp(n),d=bb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,nt(s.onHover,[n,l,this],this),c&&nt(s.onClick,[n,l,this],this));const u=!_r(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)}}we(mn,"defaults",lt),we(mn,"instances",qr),we(mn,"overrides",Un),we(mn,"registry",Jt),we(mn,"version",mb),we(mn,"getChart",Yc);function Jc(){return Ye(mn.instances,t=>t._plugins.invalidate())}function yb(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,Nt(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const m=Math.min(d/l,Nt(r-o));t.arc(a,s,l+d/2,o-m/2,r+m/2,!0)}else{const m=Math.min(d/2,i*Nt(r-o));if(u==="round")t.arc(a,s,m,o-Je/2,r+Je/2,!0);else if(u==="bevel"){const h=2*m*m,p=-h*Math.cos(o+Je/2)+a,k=-h*Math.sin(o+Je/2)+s,x=h*Math.cos(r+Je/2)+a,g=h*Math.sin(r+Je/2)+s;t.lineTo(p,k),t.lineTo(x,g)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function xb(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+ft,r-ft),t.closePath(),t.clip()}function kb(t){return fs(t,["outerStart","outerEnd","innerStart","innerEnd"])}function wb(t,n,o,r){const a=kb(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 xt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:xt(a.innerStart,0,i),innerEnd:xt(a.innerEnd,0,i)}}function uo(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Gr(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),m=u>0?u+r+o+d:0;let h=0;const p=a-c;if(r){const X=u>0?u-r:0,O=f>0?f-r:0,H=(X+O)/2,Y=H!==0?p*H/(H+r):p;h=(p-Y)/2}const k=Math.max(.001,p*f-o/Je)/f,x=(p-k)/2,g=c+x+h,S=a-x-h,{outerStart:E,outerEnd:C,innerStart:B,innerEnd:w}=wb(n,m,f,S-g),y=f-E,b=f-C,_=g+E/y,V=S-C/b,D=m+B,N=m+w,T=g+B/D,v=S-w/N;if(t.beginPath(),s){const X=(_+V)/2;if(t.arc(i,l,f,_,X),t.arc(i,l,f,X,V),C>0){const oe=uo(b,V,i,l);t.arc(oe.x,oe.y,C,V,S+ft)}const O=uo(N,S,i,l);if(t.lineTo(O.x,O.y),w>0){const oe=uo(N,v,i,l);t.arc(oe.x,oe.y,w,S+ft,v+Math.PI)}const H=(S-w/m+(g+B/m))/2;if(t.arc(i,l,m,S-w/m,H,!0),t.arc(i,l,m,H,g+B/m,!0),B>0){const oe=uo(D,T,i,l);t.arc(oe.x,oe.y,B,T+Math.PI,g-ft)}const Y=uo(y,g,i,l);if(t.lineTo(Y.x,Y.y),E>0){const oe=uo(y,_,i,l);t.arc(oe.x,oe.y,E,g-ft,_)}}else{t.moveTo(i,l);const X=Math.cos(_)*f+i,O=Math.sin(_)*f+l;t.lineTo(X,O);const H=Math.cos(V)*f+i,Y=Math.sin(V)*f+l;t.lineTo(H,Y)}t.closePath()}function Cb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Gr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%rt||rt))}return Gr(t,n,o,r,c,a),t.fill(),c}function Eb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:m,borderRadius:h}=c,p=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=m,p?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let k=n.endAngle;if(s){Gr(t,n,o,r,k,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(k=i+(l%rt||rt))}p&&xb(t,n,k),c.selfJoin&&k-i>=Je&&h===0&&u!=="miter"&&yb(t,n,k),s||(Gr(t,n,o,r,k,a),t.stroke())}class Qo extends fn{constructor(o){super();we(this,"circumference");we(this,"endAngle");we(this,"fullCircles");we(this,"innerRadius");we(this,"outerRadius");we(this,"pixelMargin");we(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:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,p=Te(m,d-c),k=Lo(i,c,d)&&c!==d,x=p>=rt||k,g=dn(l,u+h,f+h);return x&&g}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,m=(l+c+u+d)/2;return{x:r+Math.cos(f)*m,y:a+Math.sin(f)*m}}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>rt?Math.floor(a/rt):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(Je,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,Cb(o,this,u,i,l),Eb(o,this,u,i,l),o.restore()}}we(Qo,"id","arc"),we(Qo,"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}),we(Qo,"defaultRoutes",{backgroundColor:"backgroundColor"}),we(Qo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Qc(t,n,o=n){t.lineCap=Te(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Te(o.borderDash,n.borderDash)),t.lineDashOffset=Te(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Te(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Te(o.borderWidth,n.borderWidth),t.strokeStyle=Te(o.borderColor,n.borderColor)}function Bb(t,n,o){t.lineTo(o.x,o.y)}function _b(t){return t.stepped?Xp:t.tension||t.cubicInterpolationMode==="monotone"?Kp:Bb}function Zc(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 Sb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Zc(a,o,r),u=_b(s);let{move:f=!0,reverse:m}=r||{},h,p,k;for(h=0;h<=d;++h)p=a[(l+(m?d-h:h))%i],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,k,p,m,s.stepped),k=p);return c&&(p=a[(l+(m?d:0))%i],u(t,k,p,m,s.stepped)),!!c}function Vb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Zc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,m,h,p,k,x,g;const S=C=>(i+(d?l-C:C))%s,E=()=>{k!==x&&(t.lineTo(u,x),t.lineTo(u,k),t.lineTo(u,g))};for(c&&(h=a[S(0)],t.moveTo(h.x,h.y)),m=0;m<=l;++m){if(h=a[S(m)],h.skip)continue;const C=h.x,B=h.y,w=C|0;w===p?(B<k?k=B:B>x&&(x=B),u=(f*u+C)/++f):(E(),t.lineTo(C,B),p=w,f=0,k=x=B),g=B}E()}function Ds(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?Vb:Sb}function Ab(t){return t.stepped?Vg:t.tension||t.cubicInterpolationMode==="monotone"?Ag:Xn}function Db(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Qc(t,n.options),t.stroke(a)}function Nb(t,n,o,r){const{segments:a,options:s}=n,i=Ds(n);for(const l of a)Qc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Mb=typeof Path2D=="function";function Tb(t,n,o,r){Mb&&!n.options.segment?Db(t,n,o,r):Nb(t,n,o,r)}class Vn extends fn{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;xg(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=lc(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Ab(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:m}=i[d],h=s[f],p=s[m];if(h===p){l.push(h);continue}const k=Math.abs((a-h[o])/(p[o]-h[o])),x=c(h,p,k,r.stepped);x[o]=n[o],l.push(x)}return l.length===1?l[0]:l}pathSegment(n,o,r){return Ds(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=Ds(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(),Tb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}we(Vn,"id","line"),we(Vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),we(Vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),we(Vn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function ed(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Xr extends fn{constructor(o){super();we(this,"parsed");we(this,"skip");we(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 ed(this,o,"x",r)}inYRange(o,r){return ed(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||!Uo(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,us(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}we(Xr,"id","point"),we(Xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),we(Xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function td(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 An(t,n,o,r){return t?0:xt(n,o,r)}function Pb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Gl(r);return{t:An(a.top,s.top,0,o),r:An(a.right,s.right,0,n),b:An(a.bottom,s.bottom,0,o),l:An(a.left,s.left,0,n)}}function vb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=ro(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Fe(a);return{topLeft:An(!c||l.top||l.left,s.topLeft,0,i),topRight:An(!c||l.top||l.right,s.topRight,0,i),bottomLeft:An(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:An(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Ob(t){const n=td(t),o=n.right-n.left,r=n.bottom-n.top,a=Pb(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 Ns(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&td(t,r);return l&&(a||dn(n,l.left,l.right))&&(s||dn(o,l.top,l.bottom))}function Fb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function zb(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 Kr extends fn{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}=Ob(this),l=Fb(i.radius)?Mr:zb;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 Ns(this,n,o,r)}inXRange(n,o){return Ns(this,n,null,o)}inYRange(n,o){return Ns(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}}we(Kr,"id","bar"),we(Kr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),we(Kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rb(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=Yr(c,d,a);const u=Ts(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=lc(n,u);for(const m of f){const h=Ts(o,s[m.start],s[m.end],m.loop),p=ic(l,a,h);for(const k of p)i.push({source:k,target:m,start:{[o]:nd(u,h,"start",Math.max)},end:{[o]:nd(u,h,"end",Math.min)}})}}return i}function Ts(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Nt(a),s=Nt(s)),{property:t,start:a,end:s}}function Ib(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Yr(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 Yr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function nd(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function od(t,n){let o=[],r=!1;return dt(t)?(r=!0,o=t):o=Ib(t,n),o.length?new Vn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function rd(t){return t&&t.fill!==!1}function Lb(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(!yt(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function $b(t,n,o){const r=Hb(t);if(Fe(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return yt(a)&&Math.floor(a)===a?jb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function jb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function Ub(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Fe(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Wb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Fe(t)?r=t.value:r=n.getBaseValue(),r}function Hb(t){const n=t.options,o=n.fill;let r=Te(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function qb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Gb(n,o);l.push(od({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++)Xb(a,i[u],l)}return new Vn({points:a,options:{}})}function Gb(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 Xb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Kb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Kb(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],m=i[u.end][o];if(dn(a,f,m)){l=a===f,c=a===m;break}}return{first:l,last:c,point:r}}class ad{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:rt},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 Yb(t){const{chart:n,fill:o,line:r}=t;if(yt(o))return Jb(n,o);if(o==="stack")return qb(t);if(o==="shape")return!0;const a=Qb(t);return a instanceof ad?a:od(a,r)}function Jb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Qb(t){return(t.scale||{}).getPointPositionForValue?ey(t):Zb(t)}function Zb(t){const{scale:n={},fill:o}=t,r=Ub(o,n);if(yt(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function ey(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Wb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new ad({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 Ps(t,n,o){const r=Yb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:m=f,below:h=f}=u||{},p=a.getDatasetMeta(s),k=uc(a,p);r&&i.points.length&&(Dr(t,o),ty(t,{line:i,target:r,above:m,below:h,area:o,scale:l,axis:c,clip:k}),Nr(t))}function ty(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"?(sd(t,r,i.top),vs(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),sd(t,r,i.bottom)):d==="y"&&(id(t,r,i.left),vs(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),id(t,r,i.right),u=a)),vs(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function sd(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[Yr(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 id(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[Yr(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 vs(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Rb(o,r,a);for(const{source:d,target:u,start:f,end:m}of c){const{style:{backgroundColor:h=s}={}}=d,p=r!==!0;t.save(),t.fillStyle=h,ny(t,i,l,p&&Ts(a,f,m)),t.beginPath();const k=!!o.pathSegment(t,d);let x;if(p){k?t.closePath():ld(t,r,m,a);const g=!!r.pathSegment(t,u,{move:k,reverse:!0});x=k&&g,x||ld(t,r,f,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function ny(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 ld(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var oy={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 Vn&&(c={visible:t.isDatasetVisible(i),index:i,fill:$b(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=Lb(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&&Ps(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;rd(s)&&Ps(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!rd(r)||o.drawTime!=="beforeDatasetDraw"||Ps(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cd=(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)}},ry=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class dd extends fn{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=nt(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=wt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=cd(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 m=-1,h=-u;return this.legendItems.forEach((p,k)=>{const x=r+o/2+s.measureText(p.text).width;(k===0||d[d.length-1]+x+2*l>i)&&(f+=u,d[d.length-(k>0?0:1)]=0,h+=u,m++),c[k]={left:0,top:h,row:m,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,m=0,h=0,p=0,k=0;return this.legendItems.forEach((x,g)=>{const{itemWidth:S,itemHeight:E}=ay(r,o,s,x,a);g>0&&h+E+2*l>u&&(f+=m+l,d.push({width:m,height:h}),p+=m+l,k++,m=h=0),c[g]={left:p,top:h,col:k,width:S,height:E},m=Math.max(m,S),h+=E+l}),f+=m,d.push({width:m,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=io(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=kt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=kt(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=kt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=kt(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;Dr(n,this),this._draw(),Nr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=lt.color,c=io(n.rtl,this.left,this.width),d=wt(i.font),{padding:u}=i,f=d.size,m=f/2;let h;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:p,boxHeight:k,itemHeight:x}=cd(i,f),g=function(w,y,b){if(isNaN(p)||p<=0||isNaN(k)||k<0)return;a.save();const _=Te(b.lineWidth,1);if(a.fillStyle=Te(b.fillStyle,l),a.lineCap=Te(b.lineCap,"butt"),a.lineDashOffset=Te(b.lineDashOffset,0),a.lineJoin=Te(b.lineJoin,"miter"),a.lineWidth=_,a.strokeStyle=Te(b.strokeStyle,l),a.setLineDash(Te(b.lineDash,[])),i.usePointStyle){const V={radius:k*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},D=c.xPlus(w,p/2),N=y+m;ql(a,V,D,N,i.pointStyleWidth&&p)}else{const V=y+Math.max((f-k)/2,0),D=c.leftForLtr(w,p),N=ro(b.borderRadius);a.beginPath(),Object.values(N).some(T=>T!==0)?Mr(a,{x:D,y:V,w:p,h:k,radius:N}):a.rect(D,V,p,k),a.fill(),_!==0&&a.stroke()}a.restore()},S=function(w,y,b){Wo(a,b.text,w,y+x/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},E=this.isHorizontal(),C=this._computeTitleHeight();E?h={x:kt(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:kt(s,this.top+C+u,this.bottom-o[0].height),line:0},oc(this.ctx,n.textDirection);const B=x+u;this.legendItems.forEach((w,y)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const b=a.measureText(w.text).width,_=c.textAlign(w.textAlign||(w.textAlign=i.textAlign)),V=p+m+b;let D=h.x,N=h.y;c.setWidth(this.width),E?y>0&&D+V+u>this.right&&(N=h.y+=B,h.line++,D=h.x=kt(s,this.left+u,this.right-r[h.line])):y>0&&N+B>this.bottom&&(D=h.x=D+o[h.line].width+u,h.line++,N=h.y=kt(s,this.top+C+u,this.bottom-o[h.line].height));const T=c.x(D);if(g(T,N,w),D=Op(_,D+p+m,E?D+V:this.right,n.rtl),S(c.x(D),N,w),E)h.x+=V+u;else if(typeof w.text!="string"){const v=d.lineHeight;h.y+=ud(w,v)+u}else h.y+=B}),rc(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=wt(o.font),a=zt(o.padding);if(!o.display)return;const s=io(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,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),u=this.top+d,f=kt(n.align,f,this.right-m);else{const p=this.columnSizes.reduce((k,x)=>Math.max(k,x.height),0);u=d+kt(n.align,this.top,this.bottom-p-n.labels.padding-this._computeTitleHeight())}const h=kt(l,f,f+m);i.textAlign=s.textAlign(as(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,Wo(i,o.text,h,u,r)}_computeTitleHeight(){const n=this.options.title,o=wt(n.font),r=zt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(dn(n,this.left,this.right)&&dn(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],dn(n,a.left,a.left+a.width)&&dn(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!ly(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=ry(a,r);a&&!s&&nt(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&nt(o.onHover,[n,r,this],this)}else r&&nt(o.onClick,[n,r,this],this)}}function ay(t,n,o,r,a){const s=sy(r,t,n,o),i=iy(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function sy(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 iy(t,n,o){let r=t;return typeof n.text!="string"&&(r=ud(n,o)),r}function ud(t,n){const o=t.text?t.text.length:0;return n*o}function ly(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var cy={id:"legend",_element:dd,start(t,n,o){const r=t.legend=new dd({ctx:t.ctx,options:o,chart:t});Rt.configure(t,r,o),Rt.addBox(t,r)},stop(t){Rt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Rt.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=zt(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 fd extends fn{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=dt(r.text)?r.text.length:1;this._padding=zt(r.padding);const s=a*wt(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=kt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=kt(l,a,o),c=Je*-.5):(u=s-n,f=kt(l,o,a),c=Je*.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=wt(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);Wo(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:as(o.align),textBaseline:"middle",translation:[i,l]})}}function dy(t,n){const o=new fd({ctx:t.ctx,options:n,chart:t});Rt.configure(t,o,n),Rt.addBox(t,o),t.titleBlock=o}var uy={id:"title",_element:fd,start(t,n,o){dy(t,o)},stop(t){const n=t.titleBlock;Rt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Rt.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 Zo={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=os(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 Qt(t,n){return n&&(dt(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function hn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
16
+ */class kg{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=fl.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 qt=new kg;const $l="transparent",wg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=gl(t||$l),a=r.valid&&gl(n||$l);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Cg{constructor(n,o,r,a){const s=o[r];a=nr([n.to,a,s,n.from]);const i=nr([n.from,s,a]);this._active=!0,this._fn=n.fn||wg[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=nr([n.to,o,a,n.from]),this._from=nr([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 jl{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Se(n))return;const o=Object.keys(Ge.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Se(s))return;const i={};for(const l of o)i[l]=s[l];(Xe(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Eg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Bg(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 m=r.get(d);if(f)if(m&&f.active()){f.update(m,u,l);continue}else f.cancel();if(!m||!m.duration){n[d]=u;continue}s[d]=f=new Cg(m,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 qt.add(this._chart,r),!0}}function Bg(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 Eg(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 Ul(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 _g(t,n,o){if(o===!1)return!1;const r=Ul(t,o),a=Ul(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Sg(t){let n,o,r,a;return Se(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 Wl(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 Hl(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],et(d)&&(s||n===0||Mt(n)===Mt(d))&&(n+=d)}return!u&&!r.all?0:n}function Ag(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 Ha(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Vg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Dg(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 Ng(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function ql(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 Gl(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=Vg(s,i,r),f=n.length;let m;for(let h=0;h<f;++h){const k=n[h],{[c]:C,[d]:w}=k,p=k._stacks||(k._stacks={});m=p[d]=Ng(a,u,C),m[l]=w,m._top=ql(m,i,!0,r.type),m._bottom=ql(m,i,!1,r.type);const A=m._visualValues||(m._visualValues={});A[l]=w}}function qa(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Mg(t,n){return Bn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Pg(t,n,o){return Bn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function bo(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 Ga=t=>t==="reset"||t==="none",Kl=(t,n)=>n?t:Object.assign({},t),Tg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:Wl(o,!0),values:null};class An{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=Ha(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&&bo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,m,h,k)=>f==="x"?m:f==="r"?k:h,s=o.xAxisID=we(r.xAxisID,qa(n,"x")),i=o.yAxisID=we(r.yAxisID,qa(n,"y")),l=o.rAxisID=we(r.rAxisID,qa(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&&dl(this._data,this),n._stacked&&bo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Se(o)){const a=this._cachedMeta;this._data=Ag(o,a)}else if(r!==o){if(r){dl(r,this);const a=this._cachedMeta;bo(a),a._parsed=[]}o&&Object.isExtensible(o)&&pp(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=Ha(o.vScale,o),o.stack!==r.stack&&(a=!0,bo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(Gl(this,o._parsed),o._stacked=Ha(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,m;if(this._parsing===!1)r._parsed=a,r._sorted=!0,m=a;else{Xe(a[n])?m=this.parseArrayData(r,a,n,o):Se(a[n])?m=this.parseObjectData(r,a,n,o):m=this.parsePrimitiveData(r,a,n,o);const h=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=m[u],c&&(h()&&(c=!1),d=f);r._sorted=c}i&&Gl(this,m)}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 m,h,k;for(m=0,h=a;m<h;++m)k=m+r,f[m]={[l]:u||s.parse(d[k],k),[c]:i.parse(o[k],k)};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,m,h;for(u=0,f=a;u<f;++u)m=u+r,h=o[m],d[u]={x:s.parse(yn(h,l),m),y:i.parse(yn(h,c),m)};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:Wl(a,!0),values:o._stacks[n.axis]._visualValues};return Hl(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=Hl(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=Tg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Dg(l);let m,h;function k(){h=a[m];const C=h[l.axis];return!et(h[n.axis])||u>C||f<C}for(m=0;m<i&&!(!k()&&(this.updateRangeFromParsed(d,n,h,c),s));++m);if(s){for(m=i-1;m>=0;--m)if(!k()){this.updateRangeFromParsed(d,n,h,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],et(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=Sg(we(this.options.clip,_g(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=Pg(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=Mg(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&&lo(r);if(l)return Kl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],m=d.getOptionScopes(this.getDataset(),u),h=Object.keys(Ge.elements[n]),k=()=>this.getContext(r,a,o),C=d.resolveNamedOptions(m,h,k,f);return C.$shared&&(C.$shared=c,s[i]=Object.freeze(Kl(C,c))),C}_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),m=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(m,this.getContext(n,r,o))}const d=new jl(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||Ga(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){Ga(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!Ga(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&&bo(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])}}de(An,"defaults",{}),de(An,"datasetElementType",null),de(An,"dataElementType",null);function vg(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=ul(r.sort((a,s)=>a-s))}return t._cache.$bar}function Og(t){const n=t.iScale,o=vg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(lo(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 Fg(t,n,o,r){const a=o.barThickness;let s,i;return ve(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 zg(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 Rg(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 Xl(t,n,o,r){return Xe(t)?Rg(t,n,o,r):n[o.axis]=o.parse(t,r),n}function Yl(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,m;for(d=o,u=o+r;d<u;++d)m=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(Xl(m,f,s,d));return c}function Ka(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Ig(t,n,o){return t!==0?Mt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function Lg(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 $g(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}=Lg(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Jl(u,i,l,c)]=!0,a=d)),s[Jl(a,i,l,c)]=!0,t.borderSkipped=s}function Jl(t,n,o,r){return r?(t=jg(t,n,o),t=Ql(t,o,n)):t=Ql(t,n,o),t}function jg(t,n,o){return t===n?o:t===o?n:t}function Ql(t,n,o){return t==="start"?n:t==="end"?o:t}function Ug(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class ir extends An{parsePrimitiveData(n,o,r,a){return Yl(n,o,r,a)}parseArrayData(n,o,r,a){return Yl(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 m,h,k,C;for(m=r,h=r+a;m<h;++m)C=o[m],k={},k[s.axis]=s.parse(yn(C,d),m),f.push(Xl(yn(C,u),k,i,m));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=Ka(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:m}=this._getSharedOptions(o,a);for(let h=o;h<o+r;h++){const k=this.getParsed(h),C=s||ve(k[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),w=this._calculateBarIndexPixels(h,u),p=(k._stacks||{})[l.axis],A={horizontal:d,base:C.base,enableBorderRadius:!p||Ka(k._custom)||i===p._top||i===p._bottom,x:d?C.head:w.center,y:d?w.center:C.head,height:d?w.size:Math.abs(C.size),width:d?Math.abs(C.size):w.size};m&&(A.options=f||this.resolveDataElementOptions(h,n[h].active?"active":a));const D=A.options||n[h].options;$g(A,D,p,i),Ug(A,D,u.ratio),this.updateElement(n[h],h,A,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(h=>h[r.axis]===c),m=f&&f[u.vScale.axis];if(ve(m)||isNaN(m))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[we(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||Og(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=Ka(d);let f=c[o.axis],m=0,h=r?this.applyStack(o,c,r):f,k,C;h!==f&&(m=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Mt(f)!==Mt(d.barEnd)&&(m=0),m+=f);const w=!ve(s)&&!u?s:m;let p=o.getPixelForValue(w);if(this.chart.getDataVisibility(n)?k=o.getPixelForValue(m+h):k=p,C=k-p,Math.abs(C)<i){C=Ig(C,o,l)*i,f===l&&(p-=C/2);const A=o.getPixelForDecimal(0),D=o.getPixelForDecimal(1),S=Math.min(A,D),V=Math.max(A,D);p=Math.max(Math.min(p,V),S),k=p+C,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(k)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const A=Mt(C)*o.getLineWidthForValue(l)/2;p+=A,C-=A}return{size:C,base:p,head:k,center:k+C/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=we(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"?zg(n,o,a,u*d):Fg(n,o,a,u*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(we(m,this.getFirstScaleIdForIndexAxis())),k=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+h;l=f.start+f.chunk*k+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)}}de(ir,"id","bar"),de(ir,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),de(ir,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Wg(t,n,o){let r=1,a=1,s=0,i=0;if(n<je){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),m=Math.sin(c),h=(D,S,V)=>fo(D,l,c,!0)?1:Math.max(S,S*o,V,V*o),k=(D,S,V)=>fo(D,l,c,!0)?-1:Math.min(S,S*o,V,V*o),C=h(0,d,f),w=h(Je,u,m),p=k(Fe,d,f),A=k(Fe+Je,u,m);r=(C-p)/2,a=(w-A)/2,s=-(C+p)/2,i=-(w+A)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class jn extends An{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(Se(r[n])){const{key:c="value"}=this._parsing;s=d=>+yn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return Wt(this.options.rotation-90)}_getCircumference(){return Wt(this.options.circumference)}_getRotationExtents(){let n=je,o=-je;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(Qh(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:m,ratioY:h,offsetX:k,offsetY:C}=Wg(f,u,c),w=(r.width-i)/m,p=(r.height-i)/h,A=Math.max(Math.min(w,p)/2,0),D=el(this.options.radius,A),S=Math.max(D*c,0),V=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=k*D,this.offsetY=C*D,a.total=this.calculateTotal(),this.outerRadius=D-V*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-V*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/je)}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,m=s&&d.animateScale,h=m?0:this.innerRadius,k=m?0:this.outerRadius,{sharedOptions:C,includeOptions:w}=this._getSharedOptions(o,a);let p=this._getRotation(),A;for(A=0;A<o;++A)p+=this._circumference(A,s);for(A=o;A<o+r;++A){const D=this._circumference(A,s),S=n[A],V={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+D,circumference:D,outerRadius:k,innerRadius:h};w&&(V.options=C||this.resolveDataElementOptions(A,S.active?"active":a)),p+=D,this.updateElement(S,A,V,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)?je*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=Oa(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(we(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}de(jn,"id","doughnut"),de(jn,"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"}),de(jn,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),de(jn,"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 lr extends An{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}=yp(o,a,i);this._drawStart=l,this._drawCount=c,xp(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),m=i.axis,h=l.axis,{spanGaps:k,segment:C}=this.options,w=uo(k)?k:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",A=o+r,D=n.length;let S=o>0&&this.getParsed(o-1);for(let V=0;V<D;++V){const B=n[V],g=p?B:{};if(V<o||V>=A){g.skip=!0;continue}const b=this.getParsed(V),_=ve(b[h]),y=g[m]=i.getPixelForValue(b[m],V),x=g[h]=s||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[h],V);g.skip=isNaN(y)||isNaN(x)||_,g.stop=V>0&&Math.abs(b[m]-S[m])>w,C&&(g.parsed=b,g.raw=d.data[V]),f&&(g.options=u||this.resolveDataElementOptions(V,B.active?"active":a)),p||this.updateElement(B,V,g,a),S=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()}}de(lr,"id","line"),de(lr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),de(lr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Xa extends jn{}de(Xa,"id","pie"),de(Xa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Vn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ya{constructor(n){de(this,"options");this.options=n||{}}static override(n){Object.assign(Ya.prototype,n)}init(){}formats(){return Vn()}parse(){return Vn()}format(){return Vn()}add(){return Vn()}diff(){return Vn()}startOf(){return Vn()}endOf(){return Vn()}}var Hg={_date:Ya};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?mp:kn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const m=d(s,n,o-f),h=d(s,n,o+f);return{lo:m.lo,hi:h.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:m}=t,h=m.slice(0,u.lo+1).reverse().findIndex(C=>!ve(C[f.axis]));u.lo-=Math.max(0,h);const k=m.slice(u.hi).findIndex(C=>!ve(C[f.axis]));u.hi+=Math.max(0,k)}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:m}=qg(s[l],n,i,a);for(let h=f;h<=m;++h){const k=u[h];k.skip||r(k,d,h)}}}function Gg(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 Ja(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||cr(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 Kg(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=ll(i,{x:n.x,y:n.y});fo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return cr(t,o,n,s),a}function Xg(t,n,o,r,a,s){let i=[];const l=Gg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,m){const h=u.inRange(n.x,n.y,a);if(r&&!h)return;const k=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(k))&&!h)return;const w=l(n,k);w<c?(i=[{element:u,datasetIndex:f,index:m}],c=w):w===c&&i.push({element:u,datasetIndex:f,index:m})}return cr(t,o,n,d),i}function Qa(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?Kg(t,n,o,a):Xg(t,n,o,r,a,s)}function Zl(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 Yg={modes:{index(t,n,o,r){const a=_n(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Ja(t,a,s,r,i):Qa(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?Ja(t,a,s,r,i):Qa(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 Ja(t,a,s,r,i)},nearest(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Qa(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=_n(n,t);return Zl(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=_n(n,t);return Zl(t,a,"y",o.intersect,r)}}};const ec=["left","top","right","bottom"];function yo(t,n){return t.filter(o=>o.pos===n)}function tc(t,n){return t.filter(o=>ec.indexOf(o.pos)===-1&&o.box.axis===n)}function xo(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 Jg(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 Qg(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!ec.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 Zg(t,n){const o=Qg(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 e0(t){const n=Jg(t),o=xo(n.filter(d=>d.box.fullSize),!0),r=xo(yo(n,"left"),!0),a=xo(yo(n,"right")),s=xo(yo(n,"top"),!0),i=xo(yo(n,"bottom")),l=tc(n,"x"),c=tc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:yo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function nc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function oc(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 t0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Se(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&&oc(i,s.getPadding());const l=Math.max(0,n.outerWidth-nc(i,t,"left","right")),c=Math.max(0,n.outerHeight-nc(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 n0(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 o0(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 ko(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,o0(l.horizontal,n));const{same:f,other:m}=t0(n,o,l,r);d|=f&&a.length,u=u||m,c.fullSize||a.push(l)}return d&&ko(a,n,o,r)||u}function dr(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 rc(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,m=d.size||c.height;lo(d.start)&&(i=d.start),c.fullSize?dr(c,a.left,i,o.outerWidth-a.right-a.left,m):dr(c,n.left+d.placed,i,f,m),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,m=d.size||c.width;lo(d.start)&&(s=d.start),c.fullSize?dr(c,s,a.top,m,o.outerHeight-a.bottom-a.top):dr(c,s,n.top+d.placed,m,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var xt={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=yt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=e0(t.boxes),c=l.vertical,d=l.horizontal;Oe(t.boxes,C=>{typeof C.beforeLayout=="function"&&C.beforeLayout()});const u=c.reduce((C,w)=>w.box.options&&w.box.options.display===!1?C:C+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),m=Object.assign({},a);oc(m,yt(r));const h=Object.assign({maxPadding:m,w:s,h:i,x:a.left,y:a.top},a),k=Zg(c.concat(d),f);ko(l.fullSize,h,f,k),ko(c,h,f,k),ko(d,h,f,k)&&ko(c,h,f,k),n0(h),rc(l.leftAndTop,h,f,k),h.x+=h.w,h.y+=h.h,rc(l.rightAndBottom,h,f,k),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Oe(l.chartArea,C=>{const w=C.box;Object.assign(w,t.chartArea),w.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class ac{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 r0 extends ac{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const ur="$chartjs",a0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sc=t=>t===null||t==="";function s0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[ur]={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",sc(a)){const s=Ml(t,"width");s!==void 0&&(t.width=s)}if(sc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Ml(t,"height");s!==void 0&&(t.height=s)}return t}const ic=lg?{passive:!0}:!1;function i0(t,n,o){t&&t.addEventListener(n,o,ic)}function l0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,ic)}function c0(t,n){const o=a0[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 fr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function d0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.addedNodes,r),i=i&&!fr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function u0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.removedNodes,r),i=i&&!fr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const wo=new Map;let lc=0;function cc(){const t=window.devicePixelRatio;t!==lc&&(lc=t,wo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function f0(t,n){wo.size||window.addEventListener("resize",cc),wo.set(t,n)}function m0(t){wo.delete(t),wo.size||window.removeEventListener("resize",cc)}function h0(t,n,o){const r=t.canvas,a=r&&Wa(r);if(!a)return;const s=ml((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),f0(t,s),i}function Za(t,n,o){o&&o.disconnect(),n==="resize"&&m0(t)}function p0(t,n,o){const r=t.canvas,a=ml(s=>{t.ctx!==null&&o(c0(s,t))},t);return i0(r,n,a),a}class g0 extends ac{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(s0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[ur])return!1;const r=o[ur].initial;["height","width"].forEach(s=>{const i=r[s];ve(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[ur],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:d0,detach:u0,resize:h0}[o]||p0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:Za,detach:Za,resize:Za}[o]||l0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return ig(n,o,r,a)}isAttached(n){const o=n&&Wa(n);return!!(o&&o.isConnected)}}function b0(t){return!Ua()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?r0:g0}let Gt=(Hr=class{constructor(){de(this,"x");de(this,"y");de(this,"active",!1);de(this,"options");de(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return uo(this.x)&&uo(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}},de(Hr,"defaults",{}),de(Hr,"defaultRoutes"),Hr);function y0(t,n){const o=t.options.ticks,r=x0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?w0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return C0(n,d,s,i/a),d;const u=k0(s,n,a);if(i>0){let f,m;const h=i>1?Math.round((c-l)/(i-1)):null;for(mr(n,d,u,ve(h)?0:l-h,l),f=0,m=i-1;f<m;f++)mr(n,d,u,s[f],s[f+1]);return mr(n,d,u,c,ve(h)?n.length:c+h),d}return mr(n,d,u),d}function x0(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 k0(t,n,o){const r=B0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=sp(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 w0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function C0(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=we(r,0),i=Math.min(we(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 B0(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 E0=t=>t==="left"?"right":t==="right"?"left":t,dc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,uc=(t,n)=>Math.min(n||t,t);function fc(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 _0(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 S0(t,n){Oe(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 Co(t){return t.drawTicks?t.tickLength:0}function mc(t,n){if(!t.display)return 0;const o=ot(t.font,n),r=yt(t.padding);return(Xe(t.text)?t.text.length:1)*o.lineHeight+r.height}function A0(t,n){return Bn(t,{scale:n,type:"scale"})}function V0(t,n,o){return Bn(t,{tick:o,index:n,type:"tick"})}function D0(t,n,o){let r=Pa(t);return(o&&n!=="right"||!o&&n==="right")&&(r=E0(r)),r}function N0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,m,h,k;const C=i-a,w=l-s;if(t.isHorizontal()){if(h=nt(r,s,l),Se(o)){const p=Object.keys(o)[0],A=o[p];k=u[p].getPixelForValue(A)+C-n}else o==="center"?k=(d.bottom+d.top)/2+C-n:k=dc(t,o,n);m=l-s}else{if(Se(o)){const p=Object.keys(o)[0],A=o[p];h=u[p].getPixelForValue(A)-w+n}else o==="center"?h=(d.left+d.right)/2-w+n:h=dc(t,o,n);k=nt(r,i,a),f=o==="left"?-Je:Je}return{titleX:h,titleY:k,maxWidth:m,rotation:f}}class Un extends Gt{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=Nt(n,Number.POSITIVE_INFINITY),o=Nt(o,Number.NEGATIVE_INFINITY),r=Nt(r,Number.POSITIVE_INFINITY),a=Nt(a,Number.NEGATIVE_INFINITY),{min:Nt(n,r),max:Nt(o,a),minDefined:et(n),maxDefined:et(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:Nt(o,Nt(r,o)),max:Nt(r,Nt(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(){$e(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=Ip(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?fc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=y0(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(){$e(this.options.afterUpdate,[this])}beforeSetDimensions(){$e(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(){$e(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),$e(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$e(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=$e(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){$e(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$e(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=uc(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,m=u.highest.height,h=tt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:h/(r-1),f+6>l&&(l=h/(r-(n.offset?.5:1)),c=this.maxHeight-Co(n.grid)-o.padding-mc(n.title,this.chart.options.font),d=Math.sqrt(f*f+m*m),i=dp(Math.min(Math.asin(tt((u.highest.height+6)/l,-1,1)),Math.asin(tt(c/d,-1,1))-Math.asin(tt(m/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){$e(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$e(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=mc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Co(s)+c):(n.height=this.maxHeight,n.width=Co(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:m}=this._getLabelSizes(),h=r.padding*2,k=Wt(this.labelRotation),C=Math.cos(k),w=Math.sin(k);if(l){const p=r.mirror?0:w*f.width+C*m.height;n.height=Math.min(this.maxHeight,n.height+p+h)}else{const p=r.mirror?0:C*f.width+w*m.height;n.width=Math.min(this.maxWidth,n.width+p+h)}this._calculatePadding(d,u,w,C)}}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 m=0,h=0;c?d?(m=a*n.width,h=r*o.height):(m=r*n.height,h=a*o.width):s==="start"?h=o.width:s==="end"?m=n.width:s!=="inner"&&(m=n.width/2,h=o.width/2),this.paddingLeft=Math.max((m-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-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(){$e(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++)ve(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=fc(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/uc(o,r));let d=0,u=0,f,m,h,k,C,w,p,A,D,S,V;for(f=0;f<o;f+=c){if(k=n[f].label,C=this._resolveTickFontOptions(f),a.font=w=C.string,p=s[w]=s[w]||{data:{},gc:[]},A=C.lineHeight,D=S=0,!ve(k)&&!Xe(k))D=xl(a,p.data,p.gc,D,k),S=A;else if(Xe(k))for(m=0,h=k.length;m<h;++m)V=k[m],!ve(V)&&!Xe(V)&&(D=xl(a,p.data,p.gc,D,V),S+=A);i.push(D),l.push(S),d=Math.max(D,d),u=Math.max(S,u)}S0(s,o);const B=i.indexOf(d),g=l.indexOf(u),b=_=>({width:i[_]||0,height:l[_]||0});return{first:b(0),last:b(o-1),widest:b(B),highest:b(g),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 fp(this._alignToPixels?Cn(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=V0(this.getContext(),n,r))}return this.$context||(this.$context=A0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=Wt(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),m=Co(s),h=[],k=l.setContext(this.getContext()),C=k.display?k.width:0,w=C/2,p=function(v){return Cn(r,v,C)};let A,D,S,V,B,g,b,_,y,x,E,M;if(i==="top")A=p(this.bottom),g=this.bottom-m,_=A-w,x=p(n.top)+w,M=n.bottom;else if(i==="bottom")A=p(this.top),x=n.top,M=p(n.bottom)-w,g=A+w,_=this.top+m;else if(i==="left")A=p(this.right),B=this.right-m,b=A-w,y=p(n.left)+w,E=n.right;else if(i==="right")A=p(this.left),y=n.left,E=p(n.right)-w,B=A+w,b=this.left+m;else if(o==="x"){if(i==="center")A=p((n.top+n.bottom)/2+.5);else if(Se(i)){const v=Object.keys(i)[0],I=i[v];A=p(this.chart.scales[v].getPixelForValue(I))}x=n.top,M=n.bottom,g=A+w,_=g+m}else if(o==="y"){if(i==="center")A=p((n.left+n.right)/2);else if(Se(i)){const v=Object.keys(i)[0],I=i[v];A=p(this.chart.scales[v].getPixelForValue(I))}B=A-w,b=B-m,y=n.left,E=n.right}const T=we(a.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/T));for(D=0;D<f;D+=$){const v=this.getContext(D),I=s.setContext(v),j=l.setContext(v),U=I.lineWidth,P=I.color,R=j.dash||[],G=j.dashOffset,q=I.tickWidth,W=I.tickColor,Z=I.tickBorderDash||[],ne=I.tickBorderDashOffset;S=_0(this,D,c),S!==void 0&&(V=Cn(r,S,U),d?B=b=y=E=V:g=_=x=M=V,h.push({tx1:B,ty1:g,tx2:b,ty2:_,x1:y,y1:x,x2:E,y2:M,width:U,color:P,borderDash:R,borderDashOffset:G,tickWidth:q,tickColor:W,tickBorderDash:Z,tickBorderDashOffset:ne}))}return this._ticksLength=f,this._borderValue=A,h}_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,m=Co(r.grid),h=m+u,k=f?-u:h,C=-Wt(this.labelRotation),w=[];let p,A,D,S,V,B,g,b,_,y,x,E,M="middle";if(a==="top")B=this.bottom-k,g=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+k,g=this._getXAxisLabelAlignment();else if(a==="left"){const $=this._getYAxisLabelAlignment(m);g=$.textAlign,V=$.x}else if(a==="right"){const $=this._getYAxisLabelAlignment(m);g=$.textAlign,V=$.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+h;else if(Se(a)){const $=Object.keys(a)[0],v=a[$];B=this.chart.scales[$].getPixelForValue(v)+h}g=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")V=(n.left+n.right)/2-h;else if(Se(a)){const $=Object.keys(a)[0],v=a[$];V=this.chart.scales[$].getPixelForValue(v)}g=this._getYAxisLabelAlignment(m).textAlign}o==="y"&&(c==="start"?M="top":c==="end"&&(M="bottom"));const T=this._getLabelSizes();for(p=0,A=l.length;p<A;++p){D=l[p],S=D.label;const $=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,_=this._resolveTickFontOptions(p),y=_.lineHeight,x=Xe(S)?S.length:1;const v=x/2,I=$.color,j=$.textStrokeColor,U=$.textStrokeWidth;let P=g;i?(V=b,g==="inner"&&(p===A-1?P=this.options.reverse?"left":"right":p===0?P=this.options.reverse?"right":"left":P="center"),a==="top"?d==="near"||C!==0?E=-x*y+y/2:d==="center"?E=-T.highest.height/2-v*y+y:E=-T.highest.height+y/2:d==="near"||C!==0?E=y/2:d==="center"?E=T.highest.height/2-v*y:E=T.highest.height-x*y,f&&(E*=-1),C!==0&&!$.showLabelBackdrop&&(V+=y/2*Math.sin(C))):(B=b,E=(1-x)*y/2);let R;if($.showLabelBackdrop){const G=yt($.backdropPadding),q=T.heights[p],W=T.widths[p];let Z=E-G.top,ne=0-G.left;switch(M){case"middle":Z-=q/2;break;case"bottom":Z-=q;break}switch(g){case"center":ne-=W/2;break;case"right":ne-=W;break;case"inner":p===A-1?ne-=W:p>0&&(ne-=W/2);break}R={left:ne,top:Z,width:W+G.width,height:q+G.height,color:$.backdropColor}}w.push({label:S,font:_,textOffset:E,options:{rotation:C,color:I,strokeColor:j,strokeWidth:U,textAlign:P,textBaseline:M,translation:[V,B],backdrop:R}})}return w}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-Wt(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,m;this.isHorizontal()?(d=Cn(n,this.left,i)-i/2,u=Cn(n,this.right,l)+l/2,f=m=c):(f=Cn(n,this.top,i)-i/2,m=Cn(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,m),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Zo(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;go(r,d,0,u,c,l)}a&&er(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=ot(r.font),i=yt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Se(o)?(c+=i.bottom,Xe(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:m}=N0(this,c,o,l);go(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:m,textAlign:D0(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=we(n.grid&&n.grid.z,-1),a=we(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==Un.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 ot(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class hr{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;T0(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,M0(n,i,r),this.override&&Ge.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 Ge[a]&&(delete Ge[a][r],this.override&&delete wn[r])}}function M0(t,n,o){const r=so(Object.create(null),[o?Ge.get(o):{},Ge.get(n),t.defaults]);Ge.set(n,r),t.defaultRoutes&&P0(n,t.defaultRoutes),t.descriptors&&Ge.describe(n,t.descriptors)}function P0(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(".");Ge.route(s,a,c,l)})}function T0(t){return"id"in t&&"defaults"in t}class v0{constructor(){this.controllers=new hr(An,"datasets",!0),this.elements=new hr(Gt,"elements"),this.plugins=new hr(Object,"plugins"),this.scales=new hr(Un,"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):Oe(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Da(n);$e(r["before"+a],[],r),o[n](r),$e(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 Pt=new v0;class O0{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($e(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){ve(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=we(r.options&&r.options.plugins,{}),s=F0(r);return a===!1&&!o?[]:R0(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 F0(t){const n={},o=[],r=Object.keys(Pt.plugins.items);for(let s=0;s<r.length;s++)o.push(Pt.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 z0(t,n){return!n&&t===!1?null:t===!0?{}:t}function R0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=z0(r[c],a);d!==null&&s.push({plugin:l,options:I0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function I0(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 es(t,n){const o=Ge.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function L0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function $0(t,n){return t===n?"_index_":"_value_"}function hc(t){if(t==="x"||t==="y"||t==="r")return t}function j0(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function ts(t,...n){if(hc(t))return t;for(const o of n){const r=o.axis||j0(o.position)||t.length>1&&hc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function pc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function U0(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 pc(t,"x",o[0])||pc(t,"y",o[0])}return{}}function W0(t,n){const o=wn[t.type]||{scales:{}},r=n.scales||{},a=es(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Se(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=ts(i,l,U0(i,t),Ge.scales[l.type]),d=$0(c,a),u=o.scales||{};s[i]=io(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||es(l,n),u=(wn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const m=L0(f,c),h=i[m+"AxisID"]||m;s[h]=s[h]||Object.create(null),io(s[h],[{axis:m},r[h],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];io(l,[Ge.scales[l.type],Ge.scale])}),s}function gc(t){const n=t.options||(t.options={});n.plugins=we(n.plugins,{}),n.scales=W0(t,n)}function bc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function H0(t){return t=t||{},t.data=bc(t.data),gc(t),t}const yc=new Map,xc=new Set;function pr(t,n){let o=yc.get(t);return o||(o=n(),yc.set(t,o),xc.add(o)),o}const Bo=(t,n,o)=>{const r=yn(n,o);r!==void 0&&t.add(r)};class q0{constructor(n){this._config=H0(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(),gc(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=>Bo(c,n,f))),u.forEach(f=>Bo(c,a,f)),u.forEach(f=>Bo(c,wn[s]||{},f)),u.forEach(f=>Bo(c,Ge,f)),u.forEach(f=>Bo(c,Fa,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),xc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,wn[o]||{},Ge.datasets[o]||{},{type:o},Ge,Fa]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=kc(this._resolverCache,n,a);let c=i;if(K0(i,o)){s.$shared=!1,r=an(r)?r():r;const d=this.createResolver(n,r,l);c=In(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=kc(this._resolverCache,n,r);return Se(o)?In(s,o,void 0,a):s}}function kc(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:La(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const G0=t=>Se(t)&&Object.getOwnPropertyNames(t).some(n=>an(t[n]));function K0(t,n){const{isScriptable:o,isIndexable:r}=Bl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(an(l)||G0(l))||i&&Xe(l))return!0}return!1}var X0="4.5.1";const Y0=["top","bottom","left","right","chartArea"];function wc(t,n){return t==="top"||t==="bottom"||Y0.indexOf(t)===-1&&n==="x"}function Cc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Bc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),$e(o&&o.onComplete,[t],n)}function J0(t){const n=t.chart,o=n.options.animation;$e(o&&o.onProgress,[t],n)}function Ec(t){return Ua()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const gr={},_c=t=>{const n=Ec(t);return Object.values(gr).filter(o=>o.canvas===n).pop()};function Q0(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 Z0(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class Kt{static register(...n){Pt.add(...n),Sc()}static unregister(...n){Pt.remove(...n),Sc()}constructor(n,o){const r=this.config=new q0(o),a=Ec(n),s=_c(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||b0(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=Jh(),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 O0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=gp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],gr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}qt.listen(this,"complete",Bc),qt.listen(this,"progress",J0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return ve(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 Pt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kl(this.canvas,this.ctx),this}stop(){return qt.stop(this),this}resize(n,o){qt.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,Nl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),$e(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Oe(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=ts(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Oe(s,i=>{const l=i.options,c=l.id,d=ts(c,l),u=we(l.type,i.dtype);(l.position===void 0||wc(l.position,d)!==wc(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 m=Pt.getScale(u);f=new m({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Oe(a,(i,l)=>{i||delete r[l]}),Oe(r,i=>{xt.configure(this,i,i.options),xt.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(Cc("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||es(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=Pt.getController(l),{datasetElementType:d,dataElementType:u}=Ge.datasets[l];Object.assign(c,{dataElementType:Pt.getElement(u),datasetElementType:d&&Pt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Oe(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),m=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(m),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Oe(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Cc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Oe(this.scales,n=>{xt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!ol(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;Q0(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(!ol(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;xt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Oe(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,an(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&&(qt.has(this)?this.attached&&!qt.running(this)&&qt.start(this):(this.draw(),Bc({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=Ll(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Zo(o,a),n.controller.draw(),a&&er(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return po(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=Yg.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=Bn(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);lo(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(),qt.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(),kl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete gr[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)};Oe(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(){Oe(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Oe(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}});!Xo(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=op(n),d=Z0(n,this._lastEvent,r,c);r&&(this._lastEvent=null,$e(s.onHover,[n,l,this],this),c&&$e(s.onClick,[n,l,this],this));const u=!Xo(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)}}de(Kt,"defaults",Ge),de(Kt,"instances",gr),de(Kt,"overrides",wn),de(Kt,"registry",Pt),de(Kt,"version",X0),de(Kt,"getChart",_c);function Sc(){return Oe(Kt.instances,t=>t._plugins.invalidate())}function eb(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,ft(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const m=Math.min(d/l,ft(r-o));t.arc(a,s,l+d/2,o-m/2,r+m/2,!0)}else{const m=Math.min(d/2,i*ft(r-o));if(u==="round")t.arc(a,s,m,o-Fe/2,r+Fe/2,!0);else if(u==="bevel"){const h=2*m*m,k=-h*Math.cos(o+Fe/2)+a,C=-h*Math.sin(o+Fe/2)+s,w=h*Math.cos(r+Fe/2)+a,p=h*Math.sin(r+Fe/2)+s;t.lineTo(k,C),t.lineTo(w,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function tb(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+Je,r-Je),t.closePath(),t.clip()}function nb(t){return Ia(t,["outerStart","outerEnd","innerStart","innerEnd"])}function ob(t,n,o,r){const a=nb(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 tt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:tt(a.innerStart,0,i),innerEnd:tt(a.innerEnd,0,i)}}function Wn(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function br(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),m=u>0?u+r+o+d:0;let h=0;const k=a-c;if(r){const $=u>0?u-r:0,v=f>0?f-r:0,I=($+v)/2,j=I!==0?k*I/(I+r):k;h=(k-j)/2}const C=Math.max(.001,k*f-o/Fe)/f,w=(k-C)/2,p=c+w+h,A=a-w-h,{outerStart:D,outerEnd:S,innerStart:V,innerEnd:B}=ob(n,m,f,A-p),g=f-D,b=f-S,_=p+D/g,y=A-S/b,x=m+V,E=m+B,M=p+V/x,T=A-B/E;if(t.beginPath(),s){const $=(_+y)/2;if(t.arc(i,l,f,_,$),t.arc(i,l,f,$,y),S>0){const U=Wn(b,y,i,l);t.arc(U.x,U.y,S,y,A+Je)}const v=Wn(E,A,i,l);if(t.lineTo(v.x,v.y),B>0){const U=Wn(E,T,i,l);t.arc(U.x,U.y,B,A+Je,T+Math.PI)}const I=(A-B/m+(p+V/m))/2;if(t.arc(i,l,m,A-B/m,I,!0),t.arc(i,l,m,I,p+V/m,!0),V>0){const U=Wn(x,M,i,l);t.arc(U.x,U.y,V,M+Math.PI,p-Je)}const j=Wn(g,p,i,l);if(t.lineTo(j.x,j.y),D>0){const U=Wn(g,_,i,l);t.arc(U.x,U.y,D,p-Je,_)}}else{t.moveTo(i,l);const $=Math.cos(_)*f+i,v=Math.sin(_)*f+l;t.lineTo($,v);const I=Math.cos(y)*f+i,j=Math.sin(y)*f+l;t.lineTo(I,j)}t.closePath()}function rb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){br(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%je||je))}return br(t,n,o,r,c,a),t.fill(),c}function ab(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:m,borderRadius:h}=c,k=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=m,k?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let C=n.endAngle;if(s){br(t,n,o,r,C,a);for(let w=0;w<s;++w)t.stroke();isNaN(l)||(C=i+(l%je||je))}k&&tb(t,n,C),c.selfJoin&&C-i>=Fe&&h===0&&u!=="miter"&&eb(t,n,C),s||(br(t,n,o,r,C,a),t.stroke())}class Eo extends Gt{constructor(o){super();de(this,"circumference");de(this,"endAngle");de(this,"fullCircles");de(this,"innerRadius");de(this,"outerRadius");de(this,"pixelMargin");de(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}=ll(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,k=we(m,d-c),C=fo(i,c,d)&&c!==d,w=k>=je||C,p=Ht(l,u+h,f+h);return w&&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,m=(l+c+u+d)/2;return{x:r+Math.cos(f)*m,y:a+Math.sin(f)*m}}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>je?Math.floor(a/je):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(Fe,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,rb(o,this,u,i,l),ab(o,this,u,i,l),o.restore()}}de(Eo,"id","arc"),de(Eo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),de(Eo,"defaultRoutes",{backgroundColor:"backgroundColor"}),de(Eo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Ac(t,n,o=n){t.lineCap=we(o.borderCapStyle,n.borderCapStyle),t.setLineDash(we(o.borderDash,n.borderDash)),t.lineDashOffset=we(o.borderDashOffset,n.borderDashOffset),t.lineJoin=we(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=we(o.borderWidth,n.borderWidth),t.strokeStyle=we(o.borderColor,n.borderColor)}function sb(t,n,o){t.lineTo(o.x,o.y)}function ib(t){return t.stepped?Np:t.tension||t.cubicInterpolationMode==="monotone"?Mp:sb}function Vc(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 lb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Vc(a,o,r),u=ib(s);let{move:f=!0,reverse:m}=r||{},h,k,C;for(h=0;h<=d;++h)k=a[(l+(m?d-h:h))%i],!k.skip&&(f?(t.moveTo(k.x,k.y),f=!1):u(t,C,k,m,s.stepped),C=k);return c&&(k=a[(l+(m?d:0))%i],u(t,C,k,m,s.stepped)),!!c}function cb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Vc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,m,h,k,C,w,p;const A=S=>(i+(d?l-S:S))%s,D=()=>{C!==w&&(t.lineTo(u,w),t.lineTo(u,C),t.lineTo(u,p))};for(c&&(h=a[A(0)],t.moveTo(h.x,h.y)),m=0;m<=l;++m){if(h=a[A(m)],h.skip)continue;const S=h.x,V=h.y,B=S|0;B===k?(V<C?C=V:V>w&&(w=V),u=(f*u+S)/++f):(D(),t.lineTo(S,V),k=B,f=0,C=w=V),p=V}D()}function ns(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?cb:lb}function db(t){return t.stepped?cg:t.tension||t.cubicInterpolationMode==="monotone"?dg:Sn}function ub(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Ac(t,n.options),t.stroke(a)}function fb(t,n,o,r){const{segments:a,options:s}=n,i=ns(n);for(const l of a)Ac(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const mb=typeof Path2D=="function";function hb(t,n,o,r){mb&&!n.options.segment?ub(t,n,o,r):fb(t,n,o,r)}class ln extends Gt{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;tg(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=gg(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=zl(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=db(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:m}=i[d],h=s[f],k=s[m];if(h===k){l.push(h);continue}const C=Math.abs((a-h[o])/(k[o]-h[o])),w=c(h,k,C,r.stepped);w[o]=n[o],l.push(w)}return l.length===1?l[0]:l}pathSegment(n,o,r){return ns(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=ns(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(),hb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}de(ln,"id","line"),de(ln,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),de(ln,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),de(ln,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Dc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class yr extends Gt{constructor(o){super();de(this,"parsed");de(this,"skip");de(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 Dc(this,o,"x",r)}inYRange(o,r){return Dc(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,Ra(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}de(yr,"id","point"),de(yr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),de(yr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Nc(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 cn(t,n,o,r){return t?0:tt(n,o,r)}function pb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Cl(r);return{t:cn(a.top,s.top,0,o),r:cn(a.right,s.right,0,n),b:cn(a.bottom,s.bottom,0,o),l:cn(a.left,s.left,0,n)}}function gb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Rn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Se(a);return{topLeft:cn(!c||l.top||l.left,s.topLeft,0,i),topRight:cn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:cn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:cn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function bb(t){const n=Nc(t),o=n.right-n.left,r=n.bottom-n.top,a=pb(t,o/2,r/2),s=gb(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 os(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Nc(t,r);return l&&(a||Ht(n,l.left,l.right))&&(s||Ht(o,l.top,l.bottom))}function yb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function xb(t,n){t.rect(n.x,n.y,n.w,n.h)}function rs(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 xr extends Gt{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}=bb(this),l=yb(i.radius)?tr:xb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,rs(i,o,s)),n.clip(),l(n,rs(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,rs(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return os(this,n,o,r)}inXRange(n,o){return os(this,n,null,o)}inYRange(n,o){return os(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}}de(xr,"id","bar"),de(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),de(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function kb(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=kr(c,d,a);const u=as(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=zl(n,u);for(const m of f){const h=as(o,s[m.start],s[m.end],m.loop),k=Fl(l,a,h);for(const C of k)i.push({source:C,target:m,start:{[o]:Mc(u,h,"start",Math.max)},end:{[o]:Mc(u,h,"end",Math.min)}})}}return i}function as(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=ft(a),s=ft(s)),{property:t,start:a,end:s}}function wb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=kr(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 kr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Mc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function Pc(t,n){let o=[],r=!1;return Xe(t)?(r=!0,o=t):o=wb(t,n),o.length?new ln({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function Tc(t){return t&&t.fill!==!1}function Cb(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(!et(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Bb(t,n,o){const r=Ab(t);if(Se(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return et(a)&&Math.floor(a)===a?Eb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Eb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function _b(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Se(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Sb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Se(t)?r=t.value:r=n.getBaseValue(),r}function Ab(t){const n=t.options,o=n.fill;let r=we(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Vb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Db(n,o);l.push(Pc({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++)Nb(a,i[u],l)}return new ln({points:a,options:{}})}function Db(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 Nb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Mb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Mb(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],m=i[u.end][o];if(Ht(a,f,m)){l=a===f,c=a===m;break}}return{first:l,last:c,point:r}}class vc{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:je},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 Pb(t){const{chart:n,fill:o,line:r}=t;if(et(o))return Tb(n,o);if(o==="stack")return Vb(t);if(o==="shape")return!0;const a=vb(t);return a instanceof vc?a:Pc(a,r)}function Tb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function vb(t){return(t.scale||{}).getPointPositionForValue?Fb(t):Ob(t)}function Ob(t){const{scale:n={},fill:o}=t,r=_b(o,n);if(et(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Fb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Sb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new vc({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function ss(t,n,o){const r=Pb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:m=f,below:h=f}=u||{},k=a.getDatasetMeta(s),C=Ll(a,k);r&&i.points.length&&(Zo(t,o),zb(t,{line:i,target:r,above:m,below:h,area:o,scale:l,axis:c,clip:C}),er(t))}function zb(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"?(Oc(t,r,i.top),is(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Oc(t,r,i.bottom)):d==="y"&&(Fc(t,r,i.left),is(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Fc(t,r,i.right),u=a)),is(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Oc(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[kr(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 Fc(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[kr(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 is(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=kb(o,r,a);for(const{source:d,target:u,start:f,end:m}of c){const{style:{backgroundColor:h=s}={}}=d,k=r!==!0;t.save(),t.fillStyle=h,Rb(t,i,l,k&&as(a,f,m)),t.beginPath();const C=!!o.pathSegment(t,d);let w;if(k){C?t.closePath():zc(t,r,m,a);const p=!!r.pathSegment(t,u,{move:C,reverse:!0});w=C&&p,w||zc(t,r,f,a)}t.closePath(),t.fill(w?"evenodd":"nonzero"),t.restore()}}function Rb(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 zc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Ib={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 ln&&(c={visible:t.isDatasetVisible(i),index:i,fill:Bb(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=Cb(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&&ss(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;Tc(s)&&ss(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!Tc(r)||o.drawTime!=="beforeDatasetDraw"||ss(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Rc=(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)}},Lb=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class Ic extends Gt{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=$e(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=ot(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Rc(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 m=-1,h=-u;return this.legendItems.forEach((k,C)=>{const w=r+o/2+s.measureText(k.text).width;(C===0||d[d.length-1]+w+2*l>i)&&(f+=u,d[d.length-(C>0?0:1)]=0,h+=u,m++),c[C]={left:0,top:h,row:m,width:w,height:a},d[d.length-1]+=w+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,m=0,h=0,k=0,C=0;return this.legendItems.forEach((w,p)=>{const{itemWidth:A,itemHeight:D}=$b(r,o,s,w,a);p>0&&h+D+2*l>u&&(f+=m+l,d.push({width:m,height:h}),k+=m+l,C++,m=h=0),c[p]={left:k,top:h,col:C,width:A,height:D},m=Math.max(m,A),h+=D+l}),f+=m,d.push({width:m,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=$n(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=nt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=nt(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=nt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=nt(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;Zo(n,this),this._draw(),er(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=Ge.color,c=$n(n.rtl,this.left,this.width),d=ot(i.font),{padding:u}=i,f=d.size,m=f/2;let h;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:k,boxHeight:C,itemHeight:w}=Rc(i,f),p=function(B,g,b){if(isNaN(k)||k<=0||isNaN(C)||C<0)return;a.save();const _=we(b.lineWidth,1);if(a.fillStyle=we(b.fillStyle,l),a.lineCap=we(b.lineCap,"butt"),a.lineDashOffset=we(b.lineDashOffset,0),a.lineJoin=we(b.lineJoin,"miter"),a.lineWidth=_,a.strokeStyle=we(b.strokeStyle,l),a.setLineDash(we(b.lineDash,[])),i.usePointStyle){const y={radius:C*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},x=c.xPlus(B,k/2),E=g+m;wl(a,y,x,E,i.pointStyleWidth&&k)}else{const y=g+Math.max((f-C)/2,0),x=c.leftForLtr(B,k),E=Rn(b.borderRadius);a.beginPath(),Object.values(E).some(M=>M!==0)?tr(a,{x,y,w:k,h:C,radius:E}):a.rect(x,y,k,C),a.fill(),_!==0&&a.stroke()}a.restore()},A=function(B,g,b){go(a,b.text,B,g+w/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?h={x:nt(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:nt(s,this.top+S+u,this.bottom-o[0].height),line:0},Pl(this.ctx,n.textDirection);const V=w+u;this.legendItems.forEach((B,g)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const b=a.measureText(B.text).width,_=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),y=k+m+b;let x=h.x,E=h.y;c.setWidth(this.width),D?g>0&&x+y+u>this.right&&(E=h.y+=V,h.line++,x=h.x=nt(s,this.left+u,this.right-r[h.line])):g>0&&E+V>this.bottom&&(x=h.x=x+o[h.line].width+u,h.line++,E=h.y=nt(s,this.top+S+u,this.bottom-o[h.line].height));const M=c.x(x);if(p(M,E,B),x=bp(_,x+k+m,D?x+y:this.right,n.rtl),A(c.x(x),E,B),D)h.x+=y+u;else if(typeof B.text!="string"){const T=d.lineHeight;h.y+=Lc(B,T)+u}else h.y+=V}),Tl(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=ot(o.font),a=yt(o.padding);if(!o.display)return;const s=$n(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,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),u=this.top+d,f=nt(n.align,f,this.right-m);else{const k=this.columnSizes.reduce((C,w)=>Math.max(C,w.height),0);u=d+nt(n.align,this.top,this.bottom-k-n.labels.padding-this._computeTitleHeight())}const h=nt(l,f,f+m);i.textAlign=s.textAlign(Pa(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,go(i,o.text,h,u,r)}_computeTitleHeight(){const n=this.options.title,o=ot(n.font),r=yt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(Ht(n,this.left,this.right)&&Ht(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],Ht(n,a.left,a.left+a.width)&&Ht(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!Wb(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=Lb(a,r);a&&!s&&$e(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&$e(o.onHover,[n,r,this],this)}else r&&$e(o.onClick,[n,r,this],this)}}function $b(t,n,o,r,a){const s=jb(r,t,n,o),i=Ub(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function jb(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 Ub(t,n,o){let r=t;return typeof n.text!="string"&&(r=Lc(n,o)),r}function Lc(t,n){const o=t.text?t.text.length:0;return n*o}function Wb(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var Hb={id:"legend",_element:Ic,start(t,n,o){const r=t.legend=new Ic({ctx:t.ctx,options:o,chart:t});xt.configure(t,r,o),xt.addBox(t,r)},stop(t){xt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;xt.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=yt(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 $c extends Gt{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=Xe(r.text)?r.text.length:1;this._padding=yt(r.padding);const s=a*ot(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=nt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=nt(l,a,o),c=Fe*-.5):(u=s-n,f=nt(l,o,a),c=Fe*.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=ot(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);go(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:Pa(o.align),textBaseline:"middle",translation:[i,l]})}}function qb(t,n){const o=new $c({ctx:t.ctx,options:n,chart:t});xt.configure(t,o,n),xt.addBox(t,o),t.titleBlock=o}var Gb={id:"title",_element:$c,start(t,n,o){qb(t,o)},stop(t){const n=t.titleBlock;xt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;xt.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 _o={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=Na(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 Tt(t,n){return n&&(Xe(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function Xt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
17
17
  `)>-1?t.split(`
18
- `):t}function fy(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 md(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=wt(n.bodyFont),d=wt(n.titleFont),u=wt(n.footerFont),f=s.length,m=a.length,h=r.length,p=zt(n.padding);let k=p.height,x=0,g=r.reduce((C,B)=>C+B.before.length+B.lines.length+B.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,f&&(k+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),g){const C=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;k+=h*C+(g-h)*c.lineHeight+(g-1)*n.bodySpacing}m&&(k+=n.footerMarginTop+m*u.lineHeight+(m-1)*n.footerSpacing);let S=0;const E=function(C){x=Math.max(x,o.measureText(C).width+S)};return o.save(),o.font=d.string,Ye(t.title,E),o.font=c.string,Ye(t.beforeBody.concat(t.afterBody),E),S=n.displayColors?i+2+n.boxPadding:0,Ye(r,C=>{Ye(C.before,E),Ye(C.lines,E),Ye(C.after,E)}),S=0,o.font=u.string,Ye(t.footer,E),o.restore(),x+=p.width,{width:x,height:k}}function my(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function hy(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 py(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"),hy(d,t,n,o)&&(d="center"),d}function hd(t,n,o){const r=o.yAlign||n.yAlign||my(t,o);return{xAlign:o.xAlign||n.xAlign||py(t,n,o,r),yAlign:r}}function gy(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function by(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function pd(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:m,bottomRight:h}=ro(i);let p=gy(n,l);const k=by(n,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,m)+a:l==="right"&&(p+=Math.max(f,h)+a),{x:xt(p,0,r.width-n.width),y:xt(k,0,r.height-n.height)}}function Jr(t,n,o){const r=zt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function gd(t){return Qt([],hn(t))}function yy(t,n,o){return Hn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function bd(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const yd={beforeTitle:ln,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:ln,beforeBody:ln,beforeLabel:ln,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 Ge(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:ln,afterBody:ln,beforeFooter:ln,footer:ln,afterFooter:ln};function Bt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?yd[n].call(o,r):a}class Os extends fn{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 mc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=yy(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=Qt(l,hn(a)),l=Qt(l,hn(s)),l=Qt(l,hn(i)),l}getBeforeBody(n,o){return gd(Bt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Ye(n,s=>{const i={before:[],lines:[],after:[]},l=bd(r,s);Qt(i.before,hn(Bt(l,"beforeLabel",this,s))),Qt(i.lines,Bt(l,"label",this,s)),Qt(i.after,hn(Bt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return gd(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=Qt(l,hn(a)),l=Qt(l,hn(s)),l=Qt(l,hn(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(fy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,m)=>n.filter(u,f,m,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Ye(l,u=>{const f=bd(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=Zo[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=md(this,r),d=Object.assign({},l,c),u=hd(this.chart,r,d),f=pd(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}=ro(l),{x:m,y:h}=n,{width:p,height:k}=o;let x,g,S,E,C,B;return s==="center"?(C=h+k/2,a==="left"?(x=m,g=x-i,E=C+i,B=C-i):(x=m+p,g=x+i,E=C-i,B=C+i),S=x):(a==="left"?g=m+Math.max(c,u)+i:a==="right"?g=m+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(E=h,C=E-i,x=g-i,S=g+i):(E=h+k,C=E+i,x=g+i,S=g-i),B=E),{x1:x,x2:g,x3:S,y1:E,y2:C,y3:B}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=io(r.rtl,this.x,this.width);for(n.x=Jr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=wt(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=wt(s.bodyFont),f=Jr(this,"left",s),m=a.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+h;if(s.usePointStyle){const k={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(m,d)+d/2,g=p+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,us(n,k,x,g),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,us(n,k,x,g)}else{n.lineWidth=Fe(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 k=a.leftForLtr(m,d),x=a.leftForLtr(a.xPlus(m,1),d-2),g=ro(i.borderRadius);Object.values(g).some(S=>S!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,Mr(n,{x:k,y:p,w:d,h:c,radius:g}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),Mr(n,{x,y:p+1,w:d-2,h:c-2,radius:g}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(k,p,d,c),n.strokeRect(k,p,d,c),n.fillStyle=i.backgroundColor,n.fillRect(x,p+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=wt(r.bodyFont);let m=f.lineHeight,h=0;const p=io(r.rtl,this.x,this.width),k=function(b){o.fillText(b,p.x(n.x+h),n.y+m/2),n.y+=m+s},x=p.textAlign(i);let g,S,E,C,B,w,y;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Jr(this,x,r),o.fillStyle=r.bodyColor,Ye(this.beforeBody,k),h=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,C=0,w=a.length;C<w;++C){for(g=a[C],S=this.labelTextColors[C],o.fillStyle=S,Ye(g.before,k),E=g.lines,l&&E.length&&(this._drawColorBox(o,n,C,p,r),m=Math.max(f.lineHeight,c)),B=0,y=E.length;B<y;++B)k(E[B]),m=f.lineHeight;Ye(g.after,k)}h=0,m=f.lineHeight,Ye(this.afterBody,k),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=io(r.rtl,this.x,this.width);for(n.x=Jr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=wt(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:m,bottomLeft:h,bottomRight:p}=ro(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-m,c),o.quadraticCurveTo(l+d,c,l+d,c+m),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+h,c+u),o.quadraticCurveTo(l,c+u,l,c+u-h),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=Zo[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=md(this,n),c=Object.assign({},i,this._size),d=hd(o,n,c),u=pd(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=zt(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),oc(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),rc(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=!_r(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||!_r(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=Zo[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}we(Os,"positioners",Zo);var xy={id:"tooltip",_element:Os,positioners:Zo,afterInit(t,n,o){o&&(t.tooltip=new Os({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:yd},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 ky=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function wy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return ky(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const Cy=(t,n)=>t===null?null:xt(Math.round(t),0,n);function xd(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class Fs extends co{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(Ge(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:wy(r,n,Te(o,n),this._addedLabels),Cy(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 xd.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}}we(Fs,"id","category"),we(Fs,"defaults",{ticks:{callback:xd}});function Ey(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:m}=t,h=s||1,p=u-1,{min:k,max:x}=n,g=!Ge(i),S=!Ge(l),E=!Ge(d),C=(x-k)/(f+1);let B=Ml((x-k)/p/h)*h,w,y,b,_;if(B<1e-14&&!g&&!S)return[{value:k},{value:x}];_=Math.ceil(x/B)-Math.floor(k/B),_>p&&(B=Ml(_*B/p/h)*h),Ge(c)||(w=Math.pow(10,c),B=Math.ceil(B*w)/w),a==="ticks"?(y=Math.floor(k/B)*B,b=Math.ceil(x/B)*B):(y=k,b=x),g&&S&&s&&Sp((l-i)/s,B/1e3)?(_=Math.round(Math.min((l-i)/B,u)),B=(l-i)/_,y=i,b=l):E?(y=g?i:y,b=S?l:b,_=d-1,B=(b-y)/_):(_=(b-y)/B,Ro(_,Math.round(_),B/1e3)?_=Math.round(_):_=Math.ceil(_));const V=Math.max(Tl(B),Tl(y));w=Math.pow(10,Ge(c)?V:c),y=Math.round(y*w)/w,b=Math.round(b*w)/w;let D=0;for(g&&(m&&y!==i?(o.push({value:i}),y<i&&D++,Ro(Math.round((y+D*B)*w)/w,i,kd(i,C,t))&&D++):y<i&&D++);D<_;++D){const N=Math.round((y+D*B)*w)/w;if(S&&N>l)break;o.push({value:N})}return S&&m&&b!==l?o.length&&Ro(o[o.length-1].value,l,kd(l,C,t))?o[o.length-1].value=l:o.push({value:l}):(!S||b===l)&&o.push({value:b}),o}function kd(t,n,{horizontal:o,minRotation:r}){const a=cn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class By extends co{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 Ge(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=Yt(a),d=Yt(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=Ey(a,s);return n.bounds==="ticks"&&Vp(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 ls(n,this.chart.options.locale,this.options.ticks.format)}}class zs extends By{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=yt(n)?n:0,this.max=yt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=cn(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}}we(zs,"id","linear"),we(zs,"defaults",{ticks:{callback:Ul.formatters.numeric}});const Qr={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}},_t=Object.keys(Qr);function wd(t,n){return t-n}function Cd(t,n){if(Ge(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)),yt(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(Io(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Ed(t,n,o,r){const a=_t.length;for(let s=_t.indexOf(t);s<a-1;++s){const i=Qr[_t[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return _t[s]}return _t[a-1]}function _y(t,n,o,r,a){for(let s=_t.length-1;s>=_t.indexOf(o);s--){const i=_t[s];if(Qr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return _t[o?_t.indexOf(o):0]}function Sy(t){for(let n=_t.indexOf(t)+1,o=_t.length;n<o;++n)if(Qr[_t[n]].common)return _t[n]}function Bd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=rs(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function Vy(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 _d(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:Vy(t,r,a,o)}class Zr extends co{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 c0._date(n.adapters.date);a.init(o),Fo(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:Cd(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=yt(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=yt(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=Tp(a,s,i);return this._unit=o.unit||(r.autoSkip?Ed(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):_y(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Sy(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),_d(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=xt(o,0,i),r=xt(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||Ed(s.minUnit,o,r,this._getLabelCapacity(o)),l=Te(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Io(c)||c===!0,u={};let f=o,m,h;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 p=a.ticks.source==="data"&&this.getDataTimestamps();for(m=f,h=0;m<r;m=+n.add(m,l,i),h++)Bd(u,m,p);return(m===r||a.bounds==="ticks"||h===1)&&Bd(u,m,p),Object.keys(u).sort(wd).map(k=>+k)}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 nt(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],m=r[o],h=d&&f&&m&&m.major;return this._adapter.format(n,a||(h?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=cn(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,_d(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(Cd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return Fl(n.sort(wd))}}we(Zr,"id","time"),we(Zr,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ea(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}=jn(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}=jn(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 Sd extends Zr{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=ea(o,this.min),this._tableRange=ea(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max: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(ea(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return ea(this._table,r*this._tableRange+this._minPos,!0)}}we(Sd,"id","timeseries"),we(Sd,"defaults",Zr.defaults);const Ay={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Dy={key:0,class:"text-red-500 ml-1"},Ny={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},My={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Ty={class:"text-red-600 text-sm"},Py={key:1,class:"mt-2 text-xs text-gray-500"},vy={key:0},Vd=Dt(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}){mn.register(Fs,zs,Xr,Vn,Kr,Qo,uy,xy,cy,oy,Rr,zr,Cs,lo);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 m=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let p=0;return h.type==="data"&&h.mode==="default"&&(p=h.dataIndex*100+h.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:m?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:m?"#1F2937":"#FFFFFF",titleColor:m?"#F3F4F6":"#111827",bodyColor:m?"#D1D5DB":"#4B5563",borderColor:m?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}},y:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}}}:void 0}},u=m=>!m||!m.datasets?m:{...m,datasets:m.datasets.map((h,p)=>{const k=p%r.colors.length,x=r.colors[k];let g=h.backgroundColor,S=h.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!g||g.length===0)?h.data&&(g=h.data.map((E,C)=>r.colors[C%r.colors.length]+"80"),S=h.data.map((E,C)=>r.colors[C%r.colors.length])):(g=g||x+"40",S=S||x),{...h,borderColor:S,backgroundColor:g,pointBackgroundColor:h.pointBackgroundColor||x,pointBorderColor:h.pointBorderColor||x,hoverBackgroundColor:h.hoverBackgroundColor||x+"60",hoverBorderColor:h.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const m=r.data||r.modelValue;let h=m;if(Array.isArray(m))if(m.length>0&&typeof m[0]=="object"&&m[0]!==null){const k=Object.keys(m[0]),x=k.find(S=>["label","name","x","category","title"].includes(S.toLowerCase()))||k[0],g=k.find(S=>S!==x&&["value","y","count","amount","total","data"].includes(S.toLowerCase()))||k.find(S=>S!==x&&typeof m[0][S]=="number")||(k.length>1?k.find(S=>S!==x):k[0]);h={labels:m.map(S=>S[x||""]),datasets:[{label:r.label||"Data",data:m.map(S=>S[g||""])}]}}else m.length>0?h={labels:m.map((k,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:m}]}:h={labels:[],datasets:[]};if(l.value=u(h),!l.value)return;const p={...d(),...r.options,onClick:(k,x)=>{a("click",k,x),r.onClick&&r.onClick(k,x)},onHover:(k,x)=>{a("hover",k,x),r.onHover&&r.onHover(k,x)}};i.value=new mn(s.value,{type:r.type,data:l.value,options:p}),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}),(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Ay,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Dy,"*")):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",Ny,[...h[0]||(h[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",My,[e.createElementVNode("div",Ty,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",Py,[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"]]),er=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.Label),e.mergeProps(e.unref(o),{class:e.unref(Oe)("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"]))}}),Oy={class:"grid gap-1.5"},Fy={key:0,class:"ml-1 text-destructive"},zy=["aria-busy"],Ry={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Iy={key:1,class:"flex items-center"},Ly=["id","checked","indeterminate","disabled","required"],pn=Dt(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,m=>{d.value=!!m},{immediate:!0});const u=()=>{if(a.disabled)return;const m=!d.value;d.value=m,r("update:modelValue",m)},f=m=>{(m.key===" "||m.key==="Enter")&&(m.preventDefault(),u())};return(m,h)=>(e.openBlock(),e.createElementBlock("div",Oy,[t.label?(e.openBlock(),e.createBlock(er,{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",Fy,"*")):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",Ry)):e.createCommentVNode("",!0),h[0]||(h[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",Iy,[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,Ly),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,zy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),$y={class:"w-full"},jy={key:0,class:"mb-4"},Uy={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Wy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Hy={key:0,class:"ml-1 text-destructive"},qy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Gy={key:1,class:"flex flex-wrap gap-4"},Xy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Ky={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Yy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},Rs=Dt(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}=ct(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,B=>{if(!B){s.value=new Set;return}const w=B.map(y=>typeof y=="object"&&y!==null?y.id!==void 0?y.id:y.value:y);s.value=new Set(w)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var w,y;const B=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(!(!B&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const _=((y=a.endpoint)==null?void 0:y.apiMethod)||a.apiMethod||"GET",V={page:1,perPage:100,...a.apiParams};if(B)b=await o(B,_,V);else if(a.apiModule&&a.apiAction){const{DCodeApi:N}=ct();b=await N(a.apiModule,a.apiAction,V)}let D=b;a.dataPath?D=a.dataPath.split(".").reduce((T,v)=>T&&T[v]!==void 0?T[v]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(D=b.data),Array.isArray(D)?i.value=D:(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 m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var B;((B=a.endpoint)!=null&&B.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),p=B=>{if(typeof B!="object"||B===null)return B;const w=a.itemValue||a.model||"id";return B[w]},k=B=>{if(typeof B!="object"||B===null)return String(B);const w=a.itemTitle||"name";return B[w]},x=B=>s.value.has(B),g=(B,w)=>{if(a.disabled)return;const y=new Set(s.value);w?y.add(B):y.delete(B),s.value=y;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},S=e.computed(()=>a.skeleton||l.value),E=e.computed(()=>!!a.error||!!c.value),C=e.computed(()=>a.error||c.value);return(B,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",$y,[t.label||S.value?(e.openBlock(),e.createElementBlock("div",jy,[S.value?(e.openBlock(),e.createElementBlock("div",Uy)):(e.openBlock(),e.createElementBlock("h3",Wy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Hy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",qy,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",Gy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,y=>e.createElementVNode("div",{key:`skeleton-${y}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...w[1]||(w[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},[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Xy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Ky,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(y,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(pn,{"model-value":x(p(y)),title:k(y),disabled:t.disabled,"onUpdate:modelValue":_=>g(p(y),_)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),E.value&&C.value?(e.openBlock(),e.createElementBlock("div",Yy,[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"]]),Jy=["aria-busy"],Qy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zy={key:1,class:"flex justify-end"},ex=["for"],tx={key:0,class:"ml-1 text-destructive"},nx={class:"relative w-full group"},ox={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},rx={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},ax=["id","disabled","readonly","placeholder","maxlength"],sx={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"},ix={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Is=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 D=o.required,N=o["aria-required"];return D===""||D===!0||D==="true"||(N==="true"||N===!0)}),c=e.computed(()=>{const D=o.maxlength??o.maxLength;let N=Number.NaN;return typeof D=="number"?N=D:typeof D=="string"&&(N=Number.parseInt(D,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})),m=D=>{const N=D.replaceAll(/\D/g,"");return N?Number(N):null},h=D=>f.value.format(D),p=e.ref(""),k=e.ref(null);e.watch(()=>a.modelValue,D=>{D==null?p.value="":m(p.value)!==D&&(p.value=h(D))},{immediate:!0});const x=(D,N)=>{let T=0;for(let v=0;v<N;v++)/\d/.test(D[v])&&T++;return T},g=(D,N)=>{let T=0;for(let v=0;v<D.length;v++)if(/\d/.test(D[v])&&(T++,T===N))return v+1;return D.length},S=D=>{const N=D.target,T=N.value,v=N.selectionStart??T.length,X=m(T);if(X===null){p.value="",r("update:modelValue",null);return}const O=h(X);if(T!==O){const H=x(T,v);p.value=O,e.nextTick(()=>{if(k.value){const Y=g(O,H);k.value.setSelectionRange(Y,Y)}})}r("update:modelValue",X)},E=()=>{p.value="",r("update:modelValue",null),r("clear")},C=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?p.value.length>0:!0),B=e.computed(()=>!!a.error),w=e.computed(()=>{const{class:D,maxlength:N,maxLength:T,...v}=o;return v}),y=e.computed(()=>p.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),_=e.computed(()=>b.value&&y.value>0),V=e.computed(()=>`${y.value} / ${c.value}`);return(D,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",Qy)):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",Zy,[...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",tx,"*")):e.createCommentVNode("",!0)],8,ex)):e.createCommentVNode("",!0),e.createElementVNode("div",nx,[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",B.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",ox,[e.createElementVNode("span",rx,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:k,"onUpdate:modelValue":N[0]||(N[0]=T=>p.value=T),onInput:S,type:"text",inputmode:"numeric"},w.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,ax),[[e.vModelText,p.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:E},[e.createVNode(e.unref(le.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),_.value&&!B.value?(e.openBlock(),e.createElementBlock("p",sx,e.toDisplayString(V.value),1)):e.createCommentVNode("",!0)]),B.value?(e.openBlock(),e.createElementBlock("p",ix,[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,Jy))}}),Ad=6048e5,lx=864e5,Dd=Symbol.for("constructDateFrom");function Dn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Dd in t?t[Dd](n):t instanceof Date?new t.constructor(n):new Date(n)}function qt(t,n){return Dn(n||t,t)}let cx={};function ta(){return cx}function tr(t,n){var l,c,d,u;const o=ta(),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=qt(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 na(t,n){return tr(t,{...n,weekStartsOn:1})}function Nd(t,n){const o=qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Dn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=na(a),i=Dn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=na(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function Md(t){const n=qt(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 dx(t,...n){const o=Dn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function Td(t,n){const o=qt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function ux(t,n,o){const[r,a]=dx(o==null?void 0:o.in,t,n),s=Td(r),i=Td(a),l=+s-Md(s),c=+i-Md(i);return Math.round((l-c)/lx)}function fx(t,n){const o=Nd(t,n),r=Dn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),na(r)}function mx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function hx(t){return!(!mx(t)&&typeof t!="number"||isNaN(+qt(t)))}function px(t,n){const o=qt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const gx={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"}},bx=(t,n,o)=>{let r;const a=gx[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 fo(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const yx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wx={date:fo({formats:yx,defaultWidth:"full"}),time:fo({formats:xx,defaultWidth:"full"}),dateTime:fo({formats:kx,defaultWidth:"full"})},Cx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ex=(t,n,o,r)=>Cx[t];function Zt(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 Bx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_x={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sx={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"]},Vx={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"]},Ax={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"}},Dx={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"}},Nx={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:Zt({values:Bx,defaultWidth:"wide"}),quarter:Zt({values:_x,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zt({values:Sx,defaultWidth:"wide"}),day:Zt({values:Vx,defaultWidth:"wide"}),dayPeriod:Zt({values:Ax,defaultWidth:"wide",formattingValues:Dx,defaultFormattingWidth:"wide"})};function en(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)?Tx(l,f=>f.test(i)):Mx(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 Mx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Tx(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 Px=/^(\d+)(th|st|nd|rd)?/i,vx=/\d+/i,Ox={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},Fx={any:[/^b/i,/^(a|c)/i]},zx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rx={any:[/1/i,/2/i,/3/i,/4/i]},Ix={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},Lx={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]},$x={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},jx={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]},Ux={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},Wx={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}},Hx={ordinalNumber:Pd({matchPattern:Px,parsePattern:vx,valueCallback:t=>parseInt(t,10)}),era:en({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any"}),quarter:en({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:en({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),day:en({matchPatterns:$x,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),dayPeriod:en({matchPatterns:Ux,defaultMatchWidth:"any",parsePatterns:Wx,defaultParseWidth:"any"})},vd={code:"en-US",formatDistance:bx,formatLong:wx,formatRelative:Ex,localize:Nx,match:Hx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qx(t,n){const o=qt(t,n==null?void 0:n.in);return ux(o,px(o))+1}function Gx(t,n){const o=qt(t,n==null?void 0:n.in),r=+na(o)-+fx(o);return Math.round(r/Ad)+1}function Od(t,n){var u,f,m,h;const o=qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=ta(),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??((h=(m=a.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,i=Dn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=tr(i,n),c=Dn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=tr(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function Xx(t,n){var l,c,d,u;const o=ta(),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=Od(t,n),s=Dn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),tr(s,n)}function Kx(t,n){const o=qt(t,n==null?void 0:n.in),r=+tr(o,n)-+Xx(o,n);return Math.round(r/Ad)+1}function Qe(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const Nn={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return Qe(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):Qe(o+1,2)},d(t,n){return Qe(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 Qe(t.getHours()%12||12,n.length)},H(t,n){return Qe(t.getHours(),n.length)},m(t,n){return Qe(t.getMinutes(),n.length)},s(t,n){return Qe(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return Qe(a,n.length)}},mo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={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 Nn.y(t,n)},Y:function(t,n,o,r){const a=Od(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return Qe(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Qe(s,n.length)},R:function(t,n){const o=Nd(t);return Qe(o,n.length)},u:function(t,n){const o=t.getFullYear();return Qe(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 Qe(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 Qe(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 Nn.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 Qe(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=Kx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):Qe(a,n.length)},I:function(t,n,o){const r=Gx(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):Qe(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):Nn.d(t,n)},D:function(t,n,o){const r=qx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Qe(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 Qe(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 Qe(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 Qe(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=mo.noon:r===0?a=mo.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=mo.evening:r>=12?a=mo.afternoon:r>=4?a=mo.morning:a=mo.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 Nn.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):Nn.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):Nn.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):Nn.s(t,n)},S:function(t,n){return Nn.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Rd(r);case"XXXX":case"XX":return Jn(r);case"XXXXX":case"XXX":default:return Jn(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Rd(r);case"xxxx":case"xx":return Jn(r);case"xxxxx":case"xxx":default:return Jn(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+zd(r,":");case"OOOO":default:return"GMT"+Jn(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+zd(r,":");case"zzzz":default:return"GMT"+Jn(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return Qe(r,n.length)},T:function(t,n,o){return Qe(+t,n.length)}};function zd(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+Qe(s,2)}function Rd(t,n){return t%60===0?(t>0?"-":"+")+Qe(Math.abs(t)/60,2):Jn(t,n)}function Jn(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return o+a+n+s}const Id=(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"})}},Ld=(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"})}},Yx={p:Ld,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Id(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}}",Id(r,n)).replace("{{time}}",Ld(a,n))}},Jx=/^D+$/,Qx=/^Y+$/,Zx=["D","DD","YY","YYYY"];function ek(t){return Jx.test(t)}function tk(t){return Qx.test(t)}function nk(t,n,o){const r=ok(t,n,o);if(console.warn(r),Zx.includes(t))throw new RangeError(r)}function ok(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 rk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sk=/^'([^]*?)'?$/,ik=/''/g,lk=/[a-zA-Z]/;function $d(t,n,o){var u,f,m,h;const r=ta(),a=r.locale??vd,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(m=r.locale)==null?void 0:m.options)==null?void 0:h.weekStartsOn)??0,l=qt(t,o==null?void 0:o.in);if(!hx(l))throw new RangeError("Invalid time value");let c=n.match(ak).map(p=>{const k=p[0];if(k==="p"||k==="P"){const x=Yx[k];return x(p,a.formatLong)}return p}).join("").match(rk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const k=p[0];if(k==="'")return{isToken:!1,value:ck(p)};if(Fd[k])return{isToken:!0,value:p};if(k.match(lk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const k=p.value;(tk(k)||ek(k))&&nk(k,n,String(t));const x=Fd[k[0]];return x(l,k,a.localize,d)}).join("")}function ck(t){const n=t.match(sk);return n?n[1].replace(ik,"'"):t}const dk={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"}},uk=(t,n,o)=>{let r;const a=dk[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},fk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},mk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},hk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pk={date:fo({formats:fk,defaultWidth:"full"}),time:fo({formats:mk,defaultWidth:"full"}),dateTime:fo({formats:hk,defaultWidth:"full"})},gk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},bk=(t,n,o,r)=>gk[t],yk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},xk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},kk={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"]},wk={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"]},Ck={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"}},Ek={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={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Zt({values:yk,defaultWidth:"wide"}),quarter:Zt({values:xk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zt({values:kk,defaultWidth:"wide"}),day:Zt({values:wk,defaultWidth:"wide"}),dayPeriod:Zt({values:Ck,defaultWidth:"wide",formattingValues:Ek,defaultFormattingWidth:"wide"})},_k=/^ke-(\d+)?/i,Sk=/\d+/i,Vk={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},Ak={any:[/^s/i,/^(m|e)/i]},Dk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Nk={any:[/1/i,/2/i,/3/i,/4/i]},Mk={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},Tk={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]},Pk={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]},Ok={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},Fk={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}},zk={ordinalNumber:Pd({matchPattern:_k,parsePattern:Sk,valueCallback:t=>parseInt(t,10)}),era:en({matchPatterns:Vk,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any"}),quarter:en({matchPatterns:Dk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:en({matchPatterns:Mk,defaultMatchWidth:"wide",parsePatterns:Tk,defaultParseWidth:"any"}),day:en({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:vk,defaultParseWidth:"any"}),dayPeriod:en({matchPatterns:Ok,defaultMatchWidth:"any",parsePatterns:Fk,defaultParseWidth:"any"})},Rk={code:"id",formatDistance:uk,formatLong:pk,formatRelative:bk,localize:Bk,match:zk,options:{weekStartsOn:1,firstWeekContainsDate:1}},jd={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)"}}},Ud="dcode-dp-theme-forced";function Ik(t,n=Ud){const o=jd[t]??jd.primary,r=`
18
+ `):t}function Kb(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 jc(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=ot(n.bodyFont),d=ot(n.titleFont),u=ot(n.footerFont),f=s.length,m=a.length,h=r.length,k=yt(n.padding);let C=k.height,w=0,p=r.reduce((S,V)=>S+V.before.length+V.lines.length+V.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(C+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const S=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;C+=h*S+(p-h)*c.lineHeight+(p-1)*n.bodySpacing}m&&(C+=n.footerMarginTop+m*u.lineHeight+(m-1)*n.footerSpacing);let A=0;const D=function(S){w=Math.max(w,o.measureText(S).width+A)};return o.save(),o.font=d.string,Oe(t.title,D),o.font=c.string,Oe(t.beforeBody.concat(t.afterBody),D),A=n.displayColors?i+2+n.boxPadding:0,Oe(r,S=>{Oe(S.before,D),Oe(S.lines,D),Oe(S.after,D)}),A=0,o.font=u.string,Oe(t.footer,D),o.restore(),w+=k.width,{width:w,height:C}}function Xb(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function Yb(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 Jb(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"),Yb(d,t,n,o)&&(d="center"),d}function Uc(t,n,o){const r=o.yAlign||n.yAlign||Xb(t,o);return{xAlign:o.xAlign||n.xAlign||Jb(t,n,o,r),yAlign:r}}function Qb(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function Zb(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function Wc(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:m,bottomRight:h}=Rn(i);let k=Qb(n,l);const C=Zb(n,c,d);return c==="center"?l==="left"?k+=d:l==="right"&&(k-=d):l==="left"?k-=Math.max(u,m)+a:l==="right"&&(k+=Math.max(f,h)+a),{x:tt(k,0,r.width-n.width),y:tt(C,0,r.height-n.height)}}function wr(t,n,o){const r=yt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function Hc(t){return Tt([],Xt(t))}function ey(t,n,o){return Bn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function qc(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const Gc={beforeTitle:Ut,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:Ut,beforeBody:Ut,beforeLabel:Ut,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 ve(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:Ut,afterBody:Ut,beforeFooter:Ut,footer:Ut,afterFooter:Ut};function it(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?Gc[n].call(o,r):a}class ls extends Gt{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 jl(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=it(r,"beforeTitle",this,n),s=it(r,"title",this,n),i=it(r,"afterTitle",this,n);let l=[];return l=Tt(l,Xt(a)),l=Tt(l,Xt(s)),l=Tt(l,Xt(i)),l}getBeforeBody(n,o){return Hc(it(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Oe(n,s=>{const i={before:[],lines:[],after:[]},l=qc(r,s);Tt(i.before,Xt(it(l,"beforeLabel",this,s))),Tt(i.lines,it(l,"label",this,s)),Tt(i.after,Xt(it(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return Hc(it(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=it(r,"beforeFooter",this,n),s=it(r,"footer",this,n),i=it(r,"afterFooter",this,n);let l=[];return l=Tt(l,Xt(a)),l=Tt(l,Xt(s)),l=Tt(l,Xt(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(Kb(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,m)=>n.filter(u,f,m,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Oe(l,u=>{const f=qc(n.callbacks,u);a.push(it(f,"labelColor",this,u)),s.push(it(f,"labelPointStyle",this,u)),i.push(it(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=_o[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=jc(this,r),d=Object.assign({},l,c),u=Uc(this.chart,r,d),f=Wc(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}=Rn(l),{x:m,y:h}=n,{width:k,height:C}=o;let w,p,A,D,S,V;return s==="center"?(S=h+C/2,a==="left"?(w=m,p=w-i,D=S+i,V=S-i):(w=m+k,p=w+i,D=S-i,V=S+i),A=w):(a==="left"?p=m+Math.max(c,u)+i:a==="right"?p=m+k-Math.max(d,f)-i:p=this.caretX,s==="top"?(D=h,S=D-i,w=p-i,A=p+i):(D=h+C,S=D+i,w=p+i,A=p-i),V=D),{x1:w,x2:p,x3:A,y1:D,y2:S,y3:V}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=$n(r.rtl,this.x,this.width);for(n.x=wr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=ot(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=ot(s.bodyFont),f=wr(this,"left",s),m=a.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,k=o.y+h;if(s.usePointStyle){const C={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},w=a.leftForLtr(m,d)+d/2,p=k+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Ra(n,C,w,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Ra(n,C,w,p)}else{n.lineWidth=Se(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const C=a.leftForLtr(m,d),w=a.leftForLtr(a.xPlus(m,1),d-2),p=Rn(i.borderRadius);Object.values(p).some(A=>A!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,tr(n,{x:C,y:k,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),tr(n,{x:w,y:k+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(C,k,d,c),n.strokeRect(C,k,d,c),n.fillStyle=i.backgroundColor,n.fillRect(w,k+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=ot(r.bodyFont);let m=f.lineHeight,h=0;const k=$n(r.rtl,this.x,this.width),C=function(b){o.fillText(b,k.x(n.x+h),n.y+m/2),n.y+=m+s},w=k.textAlign(i);let p,A,D,S,V,B,g;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=wr(this,w,r),o.fillStyle=r.bodyColor,Oe(this.beforeBody,C),h=l&&w!=="right"?i==="center"?d/2+u:d+2+u:0,S=0,B=a.length;S<B;++S){for(p=a[S],A=this.labelTextColors[S],o.fillStyle=A,Oe(p.before,C),D=p.lines,l&&D.length&&(this._drawColorBox(o,n,S,k,r),m=Math.max(f.lineHeight,c)),V=0,g=D.length;V<g;++V)C(D[V]),m=f.lineHeight;Oe(p.after,C)}h=0,m=f.lineHeight,Oe(this.afterBody,C),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=$n(r.rtl,this.x,this.width);for(n.x=wr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=ot(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:m,bottomLeft:h,bottomRight:k}=Rn(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-m,c),o.quadraticCurveTo(l+d,c,l+d,c+m),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-k),o.quadraticCurveTo(l+d,c+u,l+d-k,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+h,c+u),o.quadraticCurveTo(l,c+u,l,c+u-h),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=_o[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=jc(this,n),c=Object.assign({},i,this._size),d=Uc(o,n,c),u=Wc(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=yt(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),Pl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),Tl(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=!Xo(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||!Xo(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=_o[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}de(ls,"positioners",_o);var ty={id:"tooltip",_element:ls,positioners:_o,afterInit(t,n,o){o&&(t.tooltip=new ls({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:Gc},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 ny=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function oy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return ny(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const ry=(t,n)=>t===null?null:tt(Math.round(t),0,n);function Kc(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class cs extends Un{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(ve(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:oy(r,n,we(o,n),this._addedLabels),ry(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 Kc.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}}de(cs,"id","category"),de(cs,"defaults",{ticks:{callback:Kc}});function ay(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:m}=t,h=s||1,k=u-1,{min:C,max:w}=n,p=!ve(i),A=!ve(l),D=!ve(d),S=(w-C)/(f+1);let V=sl((w-C)/k/h)*h,B,g,b,_;if(V<1e-14&&!p&&!A)return[{value:C},{value:w}];_=Math.ceil(w/V)-Math.floor(C/V),_>k&&(V=sl(_*V/k/h)*h),ve(c)||(B=Math.pow(10,c),V=Math.ceil(V*B)/B),a==="ticks"?(g=Math.floor(C/V)*V,b=Math.ceil(w/V)*V):(g=C,b=w),p&&A&&s&&lp((l-i)/s,V/1e3)?(_=Math.round(Math.min((l-i)/V,u)),V=(l-i)/_,g=i,b=l):D?(g=p?i:g,b=A?l:b,_=d-1,V=(b-g)/_):(_=(b-g)/V,co(_,Math.round(_),V/1e3)?_=Math.round(_):_=Math.ceil(_));const y=Math.max(il(V),il(g));B=Math.pow(10,ve(c)?y:c),g=Math.round(g*B)/B,b=Math.round(b*B)/B;let x=0;for(p&&(m&&g!==i?(o.push({value:i}),g<i&&x++,co(Math.round((g+x*V)*B)/B,i,Xc(i,S,t))&&x++):g<i&&x++);x<_;++x){const E=Math.round((g+x*V)*B)/B;if(A&&E>l)break;o.push({value:E})}return A&&m&&b!==l?o.length&&co(o[o.length-1].value,l,Xc(l,S,t))?o[o.length-1].value=l:o.push({value:l}):(!A||b===l)&&o.push({value:b}),o}function Xc(t,n,{horizontal:o,minRotation:r}){const a=Wt(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class sy extends Un{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 ve(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=Mt(a),d=Mt(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=ay(a,s);return n.bounds==="ticks"&&cp(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 Oa(n,this.chart.options.locale,this.options.ticks.format)}}class ds extends sy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=et(n)?n:0,this.max=et(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=Wt(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}}de(ds,"id","linear"),de(ds,"defaults",{ticks:{callback:yl.formatters.numeric}});const Cr={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}},lt=Object.keys(Cr);function Yc(t,n){return t-n}function Jc(t,n){if(ve(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)),et(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(uo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Qc(t,n,o,r){const a=lt.length;for(let s=lt.indexOf(t);s<a-1;++s){const i=Cr[lt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return lt[s]}return lt[a-1]}function iy(t,n,o,r,a){for(let s=lt.length-1;s>=lt.indexOf(o);s--){const i=lt[s];if(Cr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return lt[o?lt.indexOf(o):0]}function ly(t){for(let n=lt.indexOf(t)+1,o=lt.length;n<o;++n)if(Cr[lt[n]].common)return lt[n]}function Zc(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=Ma(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function cy(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 ed(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:cy(t,r,a,o)}class Br extends Un{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 Hg._date(n.adapters.date);a.init(o),io(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:Jc(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=et(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=et(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=hp(a,s,i);return this._unit=o.unit||(r.autoSkip?Qc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):iy(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ly(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),ed(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=tt(o,0,i),r=tt(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||Qc(s.minUnit,o,r,this._getLabelCapacity(o)),l=we(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=uo(c)||c===!0,u={};let f=o,m,h;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 k=a.ticks.source==="data"&&this.getDataTimestamps();for(m=f,h=0;m<r;m=+n.add(m,l,i),h++)Zc(u,m,k);return(m===r||a.bounds==="ticks"||h===1)&&Zc(u,m,k),Object.keys(u).sort(Yc).map(C=>+C)}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 $e(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],m=r[o],h=d&&f&&m&&m.major;return this._adapter.format(n,a||(h?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=Wt(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,ed(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(Jc(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return ul(n.sort(Yc))}}de(Br,"id","time"),de(Br,"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 Er(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}=kn(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}=kn(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 td extends Br{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=Er(o,this.min),this._tableRange=Er(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(Er(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return Er(this._table,r*this._tableRange+this._minPos,!0)}}de(td,"id","timeseries"),de(td,"defaults",Br.defaults);const dy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},uy={key:0,class:"text-red-500 ml-1"},fy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},my={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},hy={class:"text-red-600 text-sm"},py={key:1,class:"mt-2 text-xs text-gray-500"},gy={key:0},nd=at(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}){Kt.register(cs,ds,yr,ln,xr,Eo,Gb,ty,Hb,Ib,lr,ir,Xa,jn);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 m=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let k=0;return h.type==="data"&&h.mode==="default"&&(k=h.dataIndex*100+h.datasetIndex*50),k},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:m?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:m?"#1F2937":"#FFFFFF",titleColor:m?"#F3F4F6":"#111827",bodyColor:m?"#D1D5DB":"#4B5563",borderColor:m?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}},y:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}}}:void 0}},u=m=>!m||!m.datasets?m:{...m,datasets:m.datasets.map((h,k)=>{const C=k%r.colors.length,w=r.colors[C];let p=h.backgroundColor,A=h.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?h.data&&(p=h.data.map((D,S)=>r.colors[S%r.colors.length]+"80"),A=h.data.map((D,S)=>r.colors[S%r.colors.length])):(p=p||w+"40",A=A||w),{...h,borderColor:A,backgroundColor:p,pointBackgroundColor:h.pointBackgroundColor||w,pointBorderColor:h.pointBorderColor||w,hoverBackgroundColor:h.hoverBackgroundColor||w+"60",hoverBorderColor:h.hoverBorderColor||w}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const m=r.data||r.modelValue;let h=m;if(Array.isArray(m))if(m.length>0&&typeof m[0]=="object"&&m[0]!==null){const C=Object.keys(m[0]),w=C.find(A=>["label","name","x","category","title"].includes(A.toLowerCase()))||C[0],p=C.find(A=>A!==w&&["value","y","count","amount","total","data"].includes(A.toLowerCase()))||C.find(A=>A!==w&&typeof m[0][A]=="number")||(C.length>1?C.find(A=>A!==w):C[0]);h={labels:m.map(A=>A[w||""]),datasets:[{label:r.label||"Data",data:m.map(A=>A[p||""])}]}}else m.length>0?h={labels:m.map((C,w)=>`Data ${w+1}`),datasets:[{label:r.label||"Data",data:m}]}:h={labels:[],datasets:[]};if(l.value=u(h),!l.value)return;const k={...d(),...r.options,onClick:(C,w)=>{a("click",C,w),r.onClick&&r.onClick(C,w)},onHover:(C,w)=>{a("hover",C,w),r.onHover&&r.onHover(C,w)}};i.value=new Kt(s.value,{type:r.type,data:l.value,options:k}),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}),(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",dy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",uy,"*")):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",fy,[...h[0]||(h[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",my,[e.createElementVNode("div",hy,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",py,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",gy,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"]]),So=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.Label),e.mergeProps(e.unref(o),{class:e.unref(_e)("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"]))}}),by={class:"grid gap-1.5"},yy={key:0,class:"ml-1 text-destructive"},xy=["aria-busy"],ky={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},wy={key:1,class:"flex items-center"},Cy=["id","checked","indeterminate","disabled","required"],Yt=at(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,m=>{d.value=!!m},{immediate:!0});const u=()=>{if(a.disabled)return;const m=!d.value;d.value=m,r("update:modelValue",m)},f=m=>{(m.key===" "||m.key==="Enter")&&(m.preventDefault(),u())};return(m,h)=>(e.openBlock(),e.createElementBlock("div",by,[t.label?(e.openBlock(),e.createBlock(So,{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",yy,"*")):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",ky)):e.createCommentVNode("",!0),h[0]||(h[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",wy,[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,Cy),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(te.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(te.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,xy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),By={class:"w-full"},Ey={key:0,class:"mb-4"},_y={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Sy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ay={key:0,class:"ml-1 text-destructive"},Vy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Dy={key:1,class:"flex flex-wrap gap-4"},Ny={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},My={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Py={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},us=at(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}=Ke(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,V=>{if(!V){s.value=new Set;return}const B=V.map(g=>typeof g=="object"&&g!==null?g.id!==void 0?g.id:g.value:g);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,g;const V=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!V&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const _=((g=a.endpoint)==null?void 0:g.apiMethod)||a.apiMethod||"GET",y={page:1,perPage:100,...a.apiParams};if(V)b=await o(V,_,y);else if(a.apiModule&&a.apiAction){const{DCodeApi:E}=Ke();b=await E(a.apiModule,a.apiAction,y)}let x=b;a.dataPath?x=a.dataPath.split(".").reduce((M,T)=>M&&M[T]!==void 0?M[T]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(x=b.data),Array.isArray(x)?i.value=x:(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 m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=a.endpoint)!=null&&V.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),k=V=>{if(typeof V!="object"||V===null)return V;const B=a.itemValue||a.model||"id";return V[B]},C=V=>{if(typeof V!="object"||V===null)return String(V);const B=a.itemTitle||"name";return V[B]},w=V=>s.value.has(V),p=(V,B)=>{if(a.disabled)return;const g=new Set(s.value);B?g.add(V):g.delete(V),s.value=g;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},A=e.computed(()=>a.skeleton||l.value),D=e.computed(()=>!!a.error||!!c.value),S=e.computed(()=>a.error||c.value);return(V,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",By,[t.label||A.value?(e.openBlock(),e.createElementBlock("div",Ey,[A.value?(e.openBlock(),e.createElementBlock("div",_y)):(e.openBlock(),e.createElementBlock("h3",Sy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ay,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Vy,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("div",Dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,g=>e.createElementVNode("div",{key:`skeleton-${g}`,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},[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Ny," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",My,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(g,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(Yt,{"model-value":w(k(g)),title:C(g),disabled:t.disabled,"onUpdate:modelValue":_=>p(k(g),_)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),D.value&&S.value?(e.openBlock(),e.createElementBlock("div",Py,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(S.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ty=["aria-busy"],vy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Oy={key:1,class:"flex justify-end"},Fy=["for"],zy={key:0,class:"ml-1 text-destructive"},Ry={class:"relative w-full group"},Iy={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Ly={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},$y=["id","disabled","readonly","placeholder","maxlength"],jy={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"},Uy={key:1,class:"flex items-center gap-1 text-xs text-destructive"},fs=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 x=o.required,E=o["aria-required"];return x===""||x===!0||x==="true"||(E==="true"||E===!0)}),c=e.computed(()=>{const x=o.maxlength??o.maxLength;let E=Number.NaN;return typeof x=="number"?E=x:typeof x=="string"&&(E=Number.parseInt(x,10)),Number.isFinite(E)&&E>0?E: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})),m=x=>{const E=x.replaceAll(/\D/g,"");return E?Number(E):null},h=x=>f.value.format(x),k=e.ref(""),C=e.ref(null);e.watch(()=>a.modelValue,x=>{x==null?k.value="":m(k.value)!==x&&(k.value=h(x))},{immediate:!0});const w=(x,E)=>{let M=0;for(let T=0;T<E;T++)/\d/.test(x[T])&&M++;return M},p=(x,E)=>{let M=0;for(let T=0;T<x.length;T++)if(/\d/.test(x[T])&&(M++,M===E))return T+1;return x.length},A=x=>{const E=x.target,M=E.value,T=E.selectionStart??M.length,$=m(M);if($===null){k.value="",r("update:modelValue",null);return}const v=h($);if(M!==v){const I=w(M,T);k.value=v,e.nextTick(()=>{if(C.value){const j=p(v,I);C.value.setSelectionRange(j,j)}})}r("update:modelValue",$)},D=()=>{k.value="",r("update:modelValue",null),r("clear")},S=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?k.value.length>0:!0),V=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:x,maxlength:E,maxLength:M,...T}=o;return T}),g=e.computed(()=>k.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),_=e.computed(()=>b.value&&g.value>0),y=e.computed(()=>`${g.value} / ${c.value}`);return(x,E)=>(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",vy)):e.createCommentVNode("",!0),E[2]||(E[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",Oy,[...E[1]||(E[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",zy,"*")):e.createCommentVNode("",!0)],8,Fy)):e.createCommentVNode("",!0),e.createElementVNode("div",Ry,[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",V.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",Iy,[e.createElementVNode("span",Ly,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:C,"onUpdate:modelValue":E[0]||(E[0]=M=>k.value=M),onInput:A,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",S.value?"pr-8":""]}),null,16,$y),[[e.vModelText,k.value]]),S.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:D},[e.createVNode(e.unref(te.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),_.value&&!V.value?(e.openBlock(),e.createElementBlock("p",jy,e.toDisplayString(y.value),1)):e.createCommentVNode("",!0)]),V.value?(e.openBlock(),e.createElementBlock("p",Uy,[e.createVNode(e.unref(te.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ty))}}),Wy={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"}},Hy=(t,n,o)=>{let r;const a=Wy[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 Hn(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const qy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ky={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xy={date:Hn({formats:qy,defaultWidth:"full"}),time:Hn({formats:Gy,defaultWidth:"full"}),dateTime:Hn({formats:Ky,defaultWidth:"full"})},Yy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Jy=(t,n,o,r)=>Yy[t];function vt(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 Qy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ex={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"]},tx={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"]},nx={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"}},ox={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"}},rx={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:vt({values:Qy,defaultWidth:"wide"}),quarter:vt({values:Zy,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vt({values:ex,defaultWidth:"wide"}),day:vt({values:tx,defaultWidth:"wide"}),dayPeriod:vt({values:nx,defaultWidth:"wide",formattingValues:ox,defaultFormattingWidth:"wide"})};function Ot(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)):ax(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 ax(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 od(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 ix=/^(\d+)(th|st|nd|rd)?/i,lx=/\d+/i,cx={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},dx={any:[/^b/i,/^(a|c)/i]},ux={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fx={any:[/1/i,/2/i,/3/i,/4/i]},mx={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},hx={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]},px={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},gx={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]},bx={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},yx={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}},xx={ordinalNumber:od({matchPattern:ix,parsePattern:lx,valueCallback:t=>parseInt(t,10)}),era:Ot({matchPatterns:cx,defaultMatchWidth:"wide",parsePatterns:dx,defaultParseWidth:"any"}),quarter:Ot({matchPatterns:ux,defaultMatchWidth:"wide",parsePatterns:fx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ot({matchPatterns:mx,defaultMatchWidth:"wide",parsePatterns:hx,defaultParseWidth:"any"}),day:Ot({matchPatterns:px,defaultMatchWidth:"wide",parsePatterns:gx,defaultParseWidth:"any"}),dayPeriod:Ot({matchPatterns:bx,defaultMatchWidth:"any",parsePatterns:yx,defaultParseWidth:"any"})},kx={code:"en-US",formatDistance:Hy,formatLong:Xy,formatRelative:Jy,localize:rx,match:xx,options:{weekStartsOn:0,firstWeekContainsDate:1}},wx={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"}},Cx=(t,n,o)=>{let r;const a=wx[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},Bx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},Ex={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},_x={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sx={date:Hn({formats:Bx,defaultWidth:"full"}),time:Hn({formats:Ex,defaultWidth:"full"}),dateTime:Hn({formats:_x,defaultWidth:"full"})},Ax={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},Vx=(t,n,o,r)=>Ax[t],Dx={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},Nx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},Mx={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"]},Px={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"]},Tx={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"}},vx={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"}},Ox={ordinalNumber:(t,n)=>"ke-"+Number(t),era:vt({values:Dx,defaultWidth:"wide"}),quarter:vt({values:Nx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vt({values:Mx,defaultWidth:"wide"}),day:vt({values:Px,defaultWidth:"wide"}),dayPeriod:vt({values:Tx,defaultWidth:"wide",formattingValues:vx,defaultFormattingWidth:"wide"})},Fx=/^ke-(\d+)?/i,zx=/\d+/i,Rx={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},Ix={any:[/^s/i,/^(m|e)/i]},Lx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},jx={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},Ux={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]},Wx={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},Hx={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]},qx={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},Gx={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}},Kx={ordinalNumber:od({matchPattern:Fx,parsePattern:zx,valueCallback:t=>parseInt(t,10)}),era:Ot({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),quarter:Ot({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ot({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),day:Ot({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),dayPeriod:Ot({matchPatterns:qx,defaultMatchWidth:"any",parsePatterns:Gx,defaultParseWidth:"any"})},Xx={code:"id",formatDistance:Cx,formatLong:Sx,formatRelative:Vx,localize:Ox,match:Kx,options:{weekStartsOn:1,firstWeekContainsDate:1}},rd={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)"}}},ad="dcode-dp-theme-forced";function Yx(t,n=ad){const o=rd[t]??rd.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,17 +63,17 @@
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 Lk(t,n=Ud){e.watch(t,o=>Ik(o,n),{immediate:!0})}const $k={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jk=["for"],Uk={key:0,class:"ml-1 text-destructive"},Wk=["disabled","onClick"],Hk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},qk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Gk={class:"h-full p-2 flex flex-col gap-3 w-32"},Xk=["onClick"],Kk={class:"flex items-center justify-end gap-2 w-full p-2"},Yk=["disabled","onClick"],Jk={key:1,class:"text-xs text-destructive"},oa=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,v=o["aria-required"];return T===""||T===!0||T==="true"||v==="true"||v===!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"?vd:Rk),f=e.computed(()=>r.range?2:!1),m=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}),h=T=>{const v=new Date(T);return v.setHours(0,0,0,0),v},p=T=>{const v=new Date(T);return v.setHours(23,59,59,999),v},k=(T,v)=>{const X=new Date(T);return X.setDate(X.getDate()+v),X},x=e.computed(()=>{if(r.disablePast)return h(new Date)}),g=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return p(k(new Date,r.maxDaysAhead))}),S=e.ref(null),E=e.ref(null),C=T=>{E.value={month:T.month,year:T.year}},B=e.ref(!1);let w=null;e.onMounted(()=>{const T=document.documentElement,v=()=>B.value=T.classList.contains("dark");v(),w=new MutationObserver(v),w.observe(T,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{w==null||w.disconnect(),w=null}),Lk(e.toRef(r,"tone"));const y=T=>{const v=new Date(T),X=v.getDay(),O=v.getDate()-X+(X===0?-6:1);return v.setDate(O),h(v)},b=T=>{const v=y(T);return v.setDate(v.getDate()+6),p(v)},_=T=>{const v=new Date(T);return v.setDate(1),h(v)},V=T=>{const v=new Date(T);return v.setMonth(v.getMonth()+1),v.setDate(0),p(v)},D=e.computed(()=>{if(!r.range)return[];const T=new Date,v=h(T),X=y(T),O=b(T),H=_(T),Y=V(T),oe=(M,L)=>{let ee=M;r.disablePast&&ee<v&&(ee=v);let Q=L;if(r.autoRangeDays&&r.autoRangeDays>0){const W=p(k(ee,r.autoRangeDays-1));Q>W&&(Q=W)}return Q<ee&&(Q=p(new Date(ee))),[ee,Q]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:oe(X,O)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:oe(H,Y)}]}),N=async T=>{var L,ee;const v=r.modelType||"yyyy-MM-dd";if(T.length===0){d.value=null;return}if(T.length<2)return;const X=$d(T[0],v),O=$d(T[1],v);d.value=[X,O],await e.nextTick();const H=T[0],Y=H.getMonth(),oe=H.getFullYear();E.value&&E.value.month===Y&&E.value.year===oe||(L=S.value)==null||L.setMonthYear({month:Y,year:oe}),(ee=S.value)==null||ee.openMenu()};return(T,v)=>(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",$k)):e.createCommentVNode("",!0),v[2]||(v[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",Uk,"*")):e.createCommentVNode("",!0)],8,jk)):e.createCommentVNode("",!0),e.createVNode(e.unref(yu.VueDatePicker),{ref_key:"dpRef",ref:S,modelValue:d.value,"onUpdate:modelValue":v[1]||(v[1]=X=>d.value=X),dark:B.value,range:m.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":g.value,"preset-ranges":D.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:X,onInput:O,onEnter:H,onTab:Y,onBlur:oe,onFocus:M,onKeypress:L,onPaste:ee,toggleMenu:Q})=>[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:W=>Q()},[e.createVNode(e.unref(le.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Wk),v[4]||(v[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",Hk,e.toDisplayString(t.prependInner),1),v[3]||(v[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:X,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:W=>Q(),onFocus:W=>M(),onBlur:W=>oe(),onInput:W=>O(W),onKeydown:[e.withKeys(W=>H(W),["enter"]),e.withKeys(W=>Y(W),["tab"])],onKeypress:W=>L(W),onPaste:W=>ee()},null,42,qk)],2)]),"action-buttons":e.withCtx(({selectDate:X,selectionDisabled:O})=>[e.createElementVNode("div",Kk,[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:v[0]||(v[0]=H=>{var Y;return(Y=S.value)==null?void 0:Y.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:O,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=>X()},e.toDisplayString(t.selectLabel),9,Yk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Gk,[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.value,X=>(e.openBlock(),e.createElementBlock("button",{key:X.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:O=>N(X.range)},e.toDisplayString(X.label),9,Xk))),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",Jk,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=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Zk=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=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.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(Be.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Oe)("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(Be.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}))}}),ew=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(Oe)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),tw=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(Oe)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),nw={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"},ow={class:"flex items-center gap-3"},rw={class:"flex flex-col"},aw={key:0,class:"flex items-center gap-2"},sw={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"},iw={class:"flex justify-end gap-3 flex-wrap"},Mn=Dt(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?$t[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(Zk),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",nw,[e.createElementVNode("div",ow,[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",rw,[e.createVNode(e.unref(tw),{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(ew),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",aw,[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",sw,[e.createElementVNode("div",iw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),ho=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&&$t[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))}}),lw={class:"flex flex-col gap-3 w-full"},cw={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"},dw={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"},uw={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"},fw={class:"text-sm font-medium text-slate-500"},mw={class:"flex items-center justify-between gap-2"},hw=["onClick"],pw={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"},gw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},bw=["onClick"],yw=["for","onDrop"],xw={class:"text-xs text-slate-500 dark:text-slate-400"},kw={key:2,class:"text-xs text-slate-400"},ww=["id","disabled","accept","onChange"],Cw={class:"flex flex-col items-center justify-center min-h-[300px]"},Ew=["src","alt"],Bw=["src"],_w={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Sw={class:"text-sm font-medium"},Vw=["href"],Ls=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}=Ot.useI18n(),i=e.computed(()=>{const w=o.endpoint;if(!(w!=null&&w.apiUrl))return null;let y=w.apiUrl;if(!y.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),_=y.startsWith("/")?y:`/${y}`;y=`${b}${_}`}return y}),l=e.computed(()=>{const w=c.value.length;return w<=1?"grid-cols-1":w===2?"grid-cols-1 md:grid-cols-2":w===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":w===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),m=e.ref(!1),h=e.ref(""),p=e.ref(""),k=e.ref(""),x=async()=>{var w;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((w=o.endpointReference)!=null&&w.apiUrl)){f.value=!1;return}try{const{apiUrl:y}=ct(),b=await y(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let _=(b==null?void 0:b.data)||b;Array.isArray(_)||(_=[_]),c.value=_}catch(y){console.error("Failed to fetch dynamic document list",y)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),x()}),e.onBeforeUnmount(()=>{d.value.forEach(w=>{w._localPreviewUrl&&URL.revokeObjectURL(w._localPreviewUrl)})}),e.watch(()=>o.modelValue,w=>{if(Array.isArray(w)&&JSON.stringify(w)!==JSON.stringify(d.value)){const y=JSON.parse(JSON.stringify(w));y.forEach(b=>{const _=d.value.find(V=>V.typeDocument===b.typeDocument||V.idDocumentType===b.idDocumentType);_!=null&&_._localPreviewUrl&&(b._localPreviewUrl=_._localPreviewUrl)}),d.value=y}},{deep:!0}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiUrl},(w,y)=>{w!==y&&x()}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiMethod},(w,y)=>{w!==y&&x()}),e.watch(()=>o.items,w=>{c.value=w??[],f.value=!1},{deep:!0,immediate:!0});const g=w=>{const y=w[o.itemValue]||w.id||w.typeDocument;return d.value.find(b=>b.typeDocument===y||b.idDocumentType===y||b[o.itemValue]===y)||null},S=async(w,y,b)=>{var T,v,X,O;const _=b.target,V=(T=_.files)==null?void 0:T[0];if(!V)return;const D=w[o.itemValue]||w.id||w.typeDocument,N=URL.createObjectURL(V);if(!i.value){const H=[...d.value],Y=H.findIndex(M=>M.typeDocument===D||M.idDocumentType===D);(v=H[Y])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(H[Y]._localPreviewUrl);const oe={id:null,idDocument:null,idDocumentType:D,filename:V.name,document:D,documentUrl:V.name,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};Y>-1?H[Y]={...H[Y],...oe}:H.push(oe),d.value=H,r("update:modelValue",H);return}u.value.add(y);try{const{apiUrl:H}=ct(),Y=new FormData;Y.append("doc",V),Y.append("typeDocument",String(D));const oe=await H(i.value,((X=o.endpoint)==null?void 0:X.apiMethod)||"POST",Y),M=Array.isArray(oe==null?void 0:oe.data)?oe.data[0]:(oe==null?void 0:oe.data)||oe,L=(M==null?void 0:M.url)||(M==null?void 0:M.document)||V.name,ee=(M==null?void 0:M.id)||null,Q=(M==null?void 0:M.filename)||(M==null?void 0:M.name)||V.name,W=[...d.value],ie=W.findIndex(Ce=>Ce.typeDocument===D||Ce.idDocumentType===D);(O=W[ie])!=null&&O._localPreviewUrl&&URL.revokeObjectURL(W[ie]._localPreviewUrl);const de={...M,id:ee||(M==null?void 0:M.idDocument)||(M==null?void 0:M.id_document)||null,idDocument:(M==null?void 0:M.idDocument)||ee||(M==null?void 0:M.id_document)||null,idDocumentType:D,filename:Q,document:D,documentUrl:L,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};ie>-1?W[ie]={...W[ie],...de}:W.push(de),d.value=W,r("update:modelValue",W),r("uploaded",M),r("success",M)}catch(H){console.error("Upload failed",H)}finally{u.value.delete(y),_.value=""}},E=w=>{const y=w[o.itemValue]||w.id||w.typeDocument,b=d.value.find(V=>V.typeDocument===y||V.idDocumentType===y);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const _=d.value.filter(V=>V.typeDocument!==y&&V.idDocumentType!==y);d.value=_,r("update:modelValue",_)},C=w=>{const y=g(w);if(!y)return;let b=y._localPreviewUrl;if(!b)if(y.server&&y.url){const D=y.server.replace(/\/+$/,""),N=y.url.replace(/^\/+/,"");b=`${D}/${N}`}else b=y.document||y.url;if(!b)return;const _=y.mime||y._fileType||"",V=_==="application/pdf"||b.toLowerCase().endsWith(".pdf");V&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),h.value=b,p.value=w[o.itemTitle]||w.name||y.filename||"Preview Document",k.value=_||(V?"application/pdf":"image/jpeg"),m.value=!0},B=(w,y,b)=>{var D,N;b.preventDefault();const _=(N=(D=b.dataTransfer)==null?void 0:D.files)==null?void 0:N[0];if(!_)return;S(w,y,{target:{files:[_],value:""}})};return(w,y)=>(e.openBlock(),e.createElementBlock("div",lw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(ho,{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",cw,[e.createVNode(ho,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",dw,[e.createVNode(e.unref(le.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",uw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",fw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,_)=>{var V;return e.openBlock(),e.createElementBlock("div",{key:_,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.createElementVNode("div",mw,[e.createVNode(ho,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),g(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:D=>C(b)},[e.createVNode(e.unref(le.Eye),{class:"w-4 h-4"})],8,hw)):e.createCommentVNode("",!0)]),g(b)?(e.openBlock(),e.createElementBlock("div",pw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",gw,e.toDisplayString(((V=g(b))==null?void 0:V.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:D=>E(b)},[e.createVNode(e.unref(le.X),{class:"w-4 h-4"})],8,bw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${_}`,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(_)?"pointer-events-none opacity-70":""]]),onDragover:y[0]||(y[0]=e.withModifiers(()=>{},["prevent"])),onDrop:D=>!t.disabled&&!u.value.has(_)&&B(b,_,D)},[u.value.has(_)?(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",xw,e.toDisplayString(u.value.has(_)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",kw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${_}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(_),accept:t.typeFile,onChange:D=>S(b,_,D)},null,40,ww)],42,yw))])}),128))],2),e.createVNode(Mn,{modelValue:m.value,"onUpdate:modelValue":y[2]||(y[2]=b=>m.value=b),title:p.value,"max-width":k.value==="application/pdf"?"720":"500",class:e.normalizeClass(k.value==="application/pdf"?"max-w-[40vw]":""),"content-class":k.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:y[1]||(y[1]=b=>m.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cw,[k.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:h.value,alt:p.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Ew)):k.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${h.value}${h.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,Bw)):(e.openBlock(),e.createElementBlock("div",_w,[e.createVNode(e.unref(le.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Sw,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:h.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Vw)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),Wd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>$t[n.icon]??$t.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ht),{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}))}}),Aw=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(Oe)(e.unref(Nw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Dw=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(Oe)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Nw=wr("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"}}),$s=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(Oe)(e.unref(Mw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Mw=wr("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"}}),js=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(Oe)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Us=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(Oe)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ws=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(Oe)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Hs=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(Oe)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Tw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},Pw={class:"flex flex-wrap items-center justify-center gap-2"},vw=["accept","multiple"],ra=Dt(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 y;o.disabled||(y=a.value)==null||y.click()}function f(y){const b=y/1024,_=b/1024;return _>=1?`${_.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${y} B`}function m(y){var _;if(!y)return"File tidak valid";if((_=o.accept)!=null&&_.includes("image/")&&!y.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return y.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function h(y){l.value=y.name,c.value=y.size}function p(y){if(i.value=null,!y.length)return;if(o.mode==="single"){const _=y[0],V=m(_);if(V){i.value=V,r("error",V);return}o.showSelected&&h(_),r("picked",_);return}const b=[];for(const _ of y){const V=m(_);if(V){i.value=V,r("error",V);return}b.push(_)}b.length&&(o.showSelected&&h(b[0]),r("picked:multiple",b))}function k(y){const b=y.target,_=Array.from(b.files??[]);p(_),b.value=""}function x(){o.disabled||(s.value=!0)}function g(){o.disabled||(s.value=!0)}function S(){s.value=!1}function E(y){var V,D;if(o.disabled)return;s.value=!1;const b=Array.from(((V=y.dataTransfer)==null?void 0:V.files)??[]),_=(D=o.accept)!=null&&D.includes("image/")?b.filter(N=>N.type.startsWith("image/")):b;p(_)}const C=e.computed(()=>(o.accept||"file/*").split(",").map(y=>y.trim()).filter(Boolean).map(y=>y==="image/*"?"IMAGE":y.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const B=e.ref(!1),w=e.computed(()=>{if(o.disabled||!B.value)return{};const y=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:y?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:y?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(y,b)=>(e.openBlock(),e.createBlock(e.unref(js),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Ws),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Hs),{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(Us),{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"},w.value]),onClick:u,onDragenter:e.withModifiers(x,["prevent"]),onDragover:e.withModifiers(g,["prevent"]),onDragleave:e.withModifiers(S,["prevent"]),onDrop:e.withModifiers(E,["prevent"]),onMouseenter:b[0]||(b[0]=_=>B.value=!0),onMouseleave:b[1]||(b[1]=_=>B.value=!1)},[e.createElementVNode("div",Tw,[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",Pw,[e.createVNode(e.unref($s),{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($s),{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($s),{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:k},null,40,vw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(Aw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Dw),{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"]]),Ow={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Fw=["src"],zw={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"},Rw={class:"space-y-0.5"},Iw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Lw={class:"text-xs opacity-70"},$w=["disabled"],jw={key:1},Uw=["disabled"],Ww={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Hw={class:"flex gap-2"},qw={class:"font-medium truncate"},Gw={class:"flex gap-2"},Xw={class:"font-medium"},Kw={class:"flex gap-2"},Yw={class:"font-medium truncate"},qs=Dt(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,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(h){const p=h/1024,k=p/1024;return k>=1?`${k.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${h} 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 m=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(h,p)=>t.file?(e.openBlock(),e.createBlock(js,{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(Ws,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Hs,{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",Ow,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Us,{class:"pt-2"},{default:e.withCtx(()=>{var k,x,g,S,E;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`},m.value]),onMouseenter:p[2]||(p[2]=C=>c.value=!0),onMouseleave:p[3]||(p[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,Fw)):(e.openBlock(),e.createElementBlock("div",zw,[e.createVNode(e.unref(le.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Rw,[e.createElementVNode("p",Iw,e.toDisplayString((k=l.value)==null?void 0:k.name),1),e.createElementVNode("p",Lw,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:p[0]||(p[0]=C=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,$w)):(e.openBlock(),e.createElementBlock("div",jw)),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:p[1]||(p[1]=C=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,Uw)):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",Ww,[e.createElementVNode("div",Hw,[p[4]||(p[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",qw,e.toDisplayString((g=l.value)==null?void 0:g.name),1)]),e.createElementVNode("div",Gw,[p[5]||(p[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Xw,e.toDisplayString((S=l.value)==null?void 0:S.size),1)]),e.createElementVNode("div",Kw,[p[6]||(p[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Yw,e.toDisplayString((E=l.value)==null?void 0:E.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function Gs(){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 Jw={class:"space-y-3"},Qw={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"},Hd=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:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.ref(null);function l(w){i.value=w,r("error",w)}function c(){i.value=null}const d=e.computed(()=>{const w=(o.allowedTypes??"").trim();return w?w.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(w){const y=w.lastIndexOf(".");return y>=0?w.slice(y).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const w=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...w].join(",")}return o.accept}),m=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function h(w){if(d.value.length){const y=(w.type||"").toLowerCase(),b=u(w.name);return d.value.some(_=>_.includes("/")?y===_:_.startsWith(".")?b===_:b===`.${_}`)}if(o.accept){if(o.accept==="*/*")return!0;const y=o.accept.split(",").map(V=>V.trim().toLowerCase()),b=(w.type||"").toLowerCase(),_=u(w.name);return y.some(V=>{if(V.endsWith("/*")){const D=V.slice(0,-2);return b.startsWith(D)}return V.startsWith(".")?_===V:b===V})}return!0}function p(w){return w*1024*1024}async function k(w){return w?h(w)?o.minSizeMb!=null&&w.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&w.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${m.value}`:"File tidak valid"}const{DCodeApi:x}=ct(),g=Gs(),S=e.ref(!1);async function E(w){var y;if(o.uploadFn){try{S.value=!0;const b=await o.uploadFn(w);a.value=w,r("uploaded",b)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}return}if(!((y=o.endpoint)!=null&&y.apiUrl)){a.value=w;return}if(typeof x!="function"){l("useApi() must expose DCodeApi()");return}try{S.value=!0;const b=new FormData;b.append("doc",w);const _=(o.endpoint.apiMethod||"POST").toUpperCase(),V=o.endpoint.apiUrl,D=await x("","",b,{_url:V,_method:_,withCredentials:!0,transformRequest:[(T,v)=>(v&&(delete v["Content-Type"],delete v["content-type"]),T)]}),N=(D==null?void 0:D.data)??D;a.value=w,r("uploaded",N)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}}async function C(w){var b;if(o.disabled)return;c();const y=await k(w);if(y){l(y);return}s.value=w,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await E(w):a.value=w}function B(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,w=>{w&&!s.value&&(s.value=w),w||(s.value=null)},{immediate:!0}),(w,y)=>(e.openBlock(),e.createElementBlock("div",Jw,[a.value?S.value?(e.openBlock(),e.createElementBlock("div",Qw,[...y[1]||(y[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(qs,{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:B},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||S.value,onPicked:C,error:i.value,onError:y[0]||(y[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Zw=["for"],e1={key:0,class:"!ml-1 !text-destructive"},t1={class:"relative w-full block box-border"},n1={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},o1=["id","readonly","disabled","placeholder"],r1={class:"absolute inset-y-0 right-4 flex items-center z-10"},a1={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"},s1={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},i1={key:1,class:"text-sm text-muted-foreground text-center"},l1=["onClick","title"],c1={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},d1={class:"flex items-center justify-center flex-1"},u1={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},f1={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},qd=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=$t,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(""),m=e.ref(!1),h=e.ref(!1),p=e.ref(!1),k=e.shallowRef([]),x=e.ref(o.pageSize),g=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),S=async()=>{if(h.value||p.value)return;p.value=!0,await new Promise(L=>setTimeout(L,0));const M=Object.keys(a).filter(L=>!g.has(L)).filter(L=>/^[A-Z]/.test(L)).filter(L=>typeof a[L]=="function"||typeof a[L]=="object"&&a[L]).sort((L,ee)=>L.localeCompare(ee));k.value=M,h.value=!0,p.value=!1},E=e.computed(()=>!h.value||!u.value||!k.value.includes(u.value)?null:a[u.value]),C=e.ref(u.value),B=e.computed(()=>!!u.value&&!d.value),w=e.computed(()=>{if(!h.value)return[];const M=(f.value??"").trim().toLowerCase();return M?k.value.filter(L=>L.toLowerCase().includes(M)):k.value}),y=e.computed(()=>w.value.slice(0,x.value)),b=e.computed(()=>{const M=o.columns;return M<=2?"grid-cols-2":M===3?"grid-cols-3":M===4?"grid-cols-4":M===5?"grid-cols-5":M>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>E.value&&!d.value?"!pl-12":"!pl-3");const _=async()=>{var M;await e.nextTick(),(M=i.value)==null||M.focus()},V=async M=>{if(o.disabled)return;const L=M!==!1;if(m.value){m.value=!1;return}d.value=!0,await S(),L&&(f.value="",C.value=""),x.value=o.pageSize,await _()},D=()=>{d.value=!1,f.value="",C.value=u.value,x.value=o.pageSize},N=async()=>{o.disabled||(d.value?D():await V())};let T=null;const v=async M=>{if(o.disabled)return;r("update:modelValue",null),d.value||await V(!1),T&&clearTimeout(T);const L=C.value;T=setTimeout(()=>{f.value=L},300)},X=M=>{o.disabled||(r("update:modelValue",M),D(),queueMicrotask(()=>{var L;return(L=i.value)==null?void 0:L.blur()}))},O=()=>{o.disabled||(r("update:modelValue",null),r("clear"),m.value=!0,D(),queueMicrotask(()=>{var M;return(M=i.value)==null?void 0:M.focus()}))},H=M=>{if(M.key==="Escape"){M.preventDefault(),D();return}if(M.key==="Enter"&&d.value){const L=w.value[0];L&&(M.preventDefault(),X(L))}},Y=M=>{if(!d.value)return;const L=M.target;s.value&&!s.value.contains(L)&&D()},oe=M=>{const L=M.target;L.scrollTop+L.clientHeight>=L.scrollHeight-24&&x.value<w.value.length&&(x.value=Math.min(x.value+o.pageSize,w.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",Y),queueMicrotask(()=>{var M;i.value=((M=s.value)==null?void 0:M.querySelector("input"))??null}),u.value&&S()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Y),T&&clearTimeout(T)}),e.watch(u,M=>{d.value||(C.value=M)}),e.watch(()=>f.value,()=>{x.value=o.pageSize}),(M,L)=>(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",e1,"*")):e.createCommentVNode("",!0)],8,Zw)):e.createCommentVNode("",!0),e.createElementVNode("div",t1,[E.value&&!d.value?(e.openBlock(),e.createElementBlock("div",n1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":L[0]||(L[0]=ee=>C.value=ee),readonly:B.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",[E.value&&!d.value?"pl-10":"pl-4",B.value?"cursor-pointer select-none":""]]),onClick:V,onFocus:V,onInput:v,onKeydown:H},null,42,o1),[[e.vModelText,C.value]]),e.createElementVNode("div",r1,[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:L[1]||(L[1]=e.withModifiers(()=>{},["prevent"])),onClick:O,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:L[2]||(L[2]=e.withModifiers(()=>{},["prevent"])),onClick:N,title:"Open"},[e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",a1,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:oe},[p.value?(e.openBlock(),e.createElementBlock("div",s1,[e.createVNode(e.unref(le.Loader2),{class:"h-4 w-4 animate-spin"}),L[3]||(L[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):h.value&&w.value.length===0?(e.openBlock(),e.createElementBlock("div",i1," 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(y.value,ee=>(e.openBlock(),e.createElementBlock("button",{key:ee,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ee?"ring-1 ring-primary":""]),onClick:Q=>X(ee),title:ee},[e.createElementVNode("div",c1,[e.createElementVNode("div",d1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[ee]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",u1,e.toDisplayString(ee),1)])],10,l1))),128))],2)),h.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("div",f1," Showing "+e.toDisplayString(y.value.length)+" / "+e.toDisplayString(w.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),m1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},h1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},p1={class:"relative overflow-auto p-0"},Xs=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:E=>r("update:modelValue",E)}),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 m(E,C,B,w,y){const b=await new Promise((D,N)=>{const T=URL.createObjectURL(E),v=new Image;v.onload=()=>{URL.revokeObjectURL(T),D(v)},v.onerror=X=>{URL.revokeObjectURL(T),N(X)},v.src=T}),_=document.createElement("canvas");_.width=C,_.height=B;const V=_.getContext("2d");return V?(V.drawImage(b,0,0,C,B),await new Promise(D=>{_.toBlob(N=>D(N||E),w,y)})):E}function h(){if(!l||!i.value)return;const E=l.getPlugin("Dashboard"),C=l.getFile(i.value);!E||!C||requestAnimationFrame(()=>{try{E.openFileEditor(C)}catch{try{E.openFileEditor(i.value)}catch{}}})}async function p(E){if(l){l.cancelAll(),i.value=null;try{const C=l.addFile({name:E.name,type:E.type,data:E,source:"Local",isRemote:!1});i.value=String(C)}catch{}}}function k(){if(!s.value)return;l&&f(),l=new xu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const E=document.documentElement.classList.contains("dark");l.use(hi,{target:s.value,inline:!0,height:480,theme:E?"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"),B=l.getPlugin("Dashboard");B&&B.setOptions({theme:C?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(ku,{target:hi,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(()=>h(),80)}),l.on("file-editor:complete",async C=>{const B=++d;try{const w=C.data,y=w.type||C.type||"image/jpeg";let b=w;if(o.outputWidth&&o.outputHeight&&(b=await m(w,o.outputWidth,o.outputHeight,y,o.quality)),c||B!==d)return;const _=C.name||"edited-image.jpg",V=new File([b],_,{type:y});await x(V,"UPPY_EDITOR_COMPLETE"),r("done",V),a.value=!1}catch{}})}async function x(E,C="CROP_RESULT"){const B=URL.createObjectURL(E);try{const w=await new Promise((y,b)=>{const _=new Image;_.onload=()=>y(_),_.onerror=b,_.src=B});console.group(C),console.log("file:",E),console.table({name:E.name,type:E.type,sizeBytes:E.size,sizeMB:+(E.size/1024/1024).toFixed(3),width:w.naturalWidth,height:w.naturalHeight,ratio:+(w.naturalWidth/w.naturalHeight).toFixed(4)}),console.log("previewUrl:",B),console.groupEnd()}finally{URL.revokeObjectURL(B)}}e.watch(a,async E=>{c=!E,d++,E?(await e.nextTick(),k(),o.file&&await p(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async E=>{a.value&&E&&(await e.nextTick(),await p(E))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const g=E=>{E.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,E=>{E?globalThis.addEventListener("keydown",g):globalThis.removeEventListener("keydown",g)},{immediate:!0});const S=e.ref(!1);return(E,C)=>a.value?(e.openBlock(),e.createElementBlock("div",m1,[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]=B=>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",h1,[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:S.value?1:.7}),onClick:C[1]||(C[1]=B=>a.value=!1),onMouseenter:C[2]||(C[2]=B=>S.value=!0),onMouseleave:C[3]||(C[3]=B=>S.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",p1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),g1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},b1=["src"],y1=["disabled"],x1=["disabled"],k1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},w1={class:"flex gap-2"},C1={class:"font-medium truncate"},E1={class:"flex gap-2"},B1={class:"font-medium"},_1={class:"flex gap-2"},S1={class:"font-medium truncate"},Ks=Dt(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,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(m){const h=m/1024,p=h/1024;return p>=1?`${p.toFixed(2)} MB`:h>=1?`${h.toFixed(1)} KB`:`${m} 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(m,h)=>t.file?(e.openBlock(),e.createBlock(js,{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(Ws,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Hs,{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",g1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Us,{class:"pt-2"},{default:e.withCtx(()=>{var p,k,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:h[2]||(h[2]=g=>l.value=!0),onMouseleave:h[3]||(h[3]=g=>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,b1)):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:h[0]||(h[0]=g=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,y1)):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:h[1]||(h[1]=g=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,x1)):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",k1,[e.createElementVNode("div",w1,[h[4]||(h[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",C1,e.toDisplayString((p=i.value)==null?void 0:p.name),1)]),e.createElementVNode("div",E1,[h[5]||(h[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",B1,e.toDisplayString((k=i.value)==null?void 0:k.size),1)]),e.createElementVNode("div",_1,[h[6]||(h[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",S1,e.toDisplayString((x=i.value)==null?void 0:x.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),V1={class:"space-y-3"},aa=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:O=>r("update:modelValue",O)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(O){c.value=O,r("error",O)}function u(){c.value=null}const f=e.computed(()=>{const O=(o.allowedTypes??"").trim();return O?O.split(/[,\s;]+/g).map(Y=>Y.trim().toLowerCase()).filter(Boolean).map(Y=>Y.includes("/")||Y.startsWith(".")?Y:`.${Y}`):[]});function m(O){const H=O.lastIndexOf(".");return H>=0?O.slice(H).toLowerCase():""}const h=e.computed(()=>{if(f.value.length){const O=f.value.filter(Y=>Y.startsWith("."));return[...f.value.filter(Y=>Y.includes("/")),...O].join(",")}return o.accept||"image/*"}),p=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function k(O){if(f.value.length){const Y=(O.type||"").toLowerCase(),oe=m(O.name);return f.value.some(M=>M.includes("/")?Y===M:M.startsWith(".")?oe===M:oe===`.${M}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(O.type||"").toLowerCase().startsWith("image/"):!0}function x(O){return O*1024*1024}async function g(O){var H;return(H=O.type)!=null&&H.startsWith("image/")?await new Promise(Y=>{const oe=URL.createObjectURL(O),M=new Image;M.onload=()=>{URL.revokeObjectURL(oe),Y({w:M.naturalWidth,h:M.naturalHeight})},M.onerror=()=>{URL.revokeObjectURL(oe),Y(null)},M.src=oe}):null}async function S(O){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const Y=await g(O);return Y?o.minWidth!=null&&Y.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&Y.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&Y.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&Y.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function E(O){return O?k(O)?o.minSizeMb!=null&&O.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&O.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await S(O):`only Allowed: ${p.value}`:"File tidak valid"}function C(O){o.disabled||(i.value=O,s.value=!0)}async function B(O){if(o.disabled)return;u();const H=await E(O);if(H){d(H);return}l.value=O,C(O)}const{DCodeApi:w}=ct(),y=Gs(),b=e.ref(!1);e.ref(null);function _(O,H){return!O||!H?null:O.replace(/\/+$/,"")+"/"+H.replace(/^\/+/,"")}function V(O){var M;const H=(O==null?void 0:O.data)??O,Y=(M=H==null?void 0:H.data)==null?void 0:M[0];if(!Y)return null;const oe=_(Y.server,Y.url);return{...Y,fullUrl:oe?encodeURI(oe):null}}async function D(O){var H;if(o.uploadFn){try{b.value=!0;const Y=await o.uploadFn(O);a.value=O,r("uploaded",Y)}catch(Y){console.error("Upload Error",Y),y.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}return}if(!((H=o.endpoint)!=null&&H.apiUrl)){a.value=O;return}if(typeof w!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const Y=new FormData;Y.append("doc",O);const oe=(o.endpoint.apiMethod||"POST").toUpperCase(),M=o.endpoint.apiUrl,L=await w("","",Y,{_url:M,_method:oe,withCredentials:!0,transformRequest:[(Q,W)=>(W&&(delete W["Content-Type"],delete W["content-type"]),Q)]}),ee=(L==null?void 0:L.data)??L;V(ee),a.value=O,r("uploaded",ee)}catch(Y){console.error("Upload Error",Y),y.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}}async function N(O){var H;u(),o.uploadFn||(H=o.endpoint)!=null&&H.apiUrl?await D(O):a.value=O,s.value=!1,i.value=null}function T(){s.value=!1,i.value=null}async function v(){if(!a.value)return;u();const O=o.editUseOriginal?l.value??a.value:a.value,H=await E(O);if(H){d(H);return}C(O)}function X(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,O=>{O&&!l.value&&(l.value=O),O||(l.value=null)},{immediate:!0}),(O,H)=>(e.openBlock(),e.createElementBlock("div",V1,[a.value?(e.openBlock(),e.createBlock(Ks,{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:v,onRemove:X,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:B,error:c.value,onError:H[0]||(H[0]=Y=>d(Y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Xs,{modelValue:s.value,"onUpdate:modelValue":H[1]||(H[1]=Y=>s.value=Y),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:T},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),A1=["aria-busy"],D1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},N1=["for"],M1={key:0,class:"ml-1 text-destructive"},T1=["id","disabled"],P1={class:"min-w-0 flex-1 text-left"},v1={key:0,class:"flex flex-wrap gap-1.5"},O1={class:"max-w-[220px] truncate"},F1=["onClick"],z1={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"},R1={key:1,class:"text-muted-foreground truncate"},I1={class:"flex items-center gap-2 shrink-0"},L1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},$1=["placeholder","onKeydown"],j1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},U1=["disabled","onClick"],W1={class:"truncate"},H1={key:0,class:"text-primary-600 dark:text-primary-400"},q1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},G1={key:0},X1={key:1},K1={key:1,class:"text-xs text-destructive"},Ys=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 te=o.required,ce=o["aria-required"];return te===""||te===!0||te==="true"||(ce==="true"||ce===!0)}),u=e.computed(()=>!!a.error);function f(te){return te?typeof a.itemTitle=="function"?a.itemTitle(te)??"":String((te==null?void 0:te[a.itemTitle])??""):""}function m(te){return te?typeof a.itemValue=="function"?a.itemValue(te):te==null?void 0:te[a.itemValue]:null}function h(te,ce){return m(te)??ce}const p=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),k=e.computed(()=>{var te;return!!((te=a.endpoint)!=null&&te.apiUrl)||!!a.fetchItems}),x=e.ref([]),g=e.ref(!1),S=e.ref(!1),E=e.computed(()=>{var ce;const te=(ce=a.endpoint)==null?void 0:ce.apiOptions;if(te)return typeof te=="function"?te():te}),C=e.computed(()=>{var Se,et;const te=((Se=a.endpoint)==null?void 0:Se.apiUrl)??"",ce=(((et=a.endpoint)==null?void 0:et.apiMethod)??"GET").toUpperCase(),he=JSON.stringify(E.value??null);return`${ce} ${te} :: ${he}`}),B=e.computed(()=>k.value?x.value:a.items||[]);async function w(){var te;if(k.value&&!(!((te=a.endpoint)!=null&&te.apiUrl)&&!a.fetchItems)&&!g.value){g.value=!0;try{let ce;if(a.fetchItems){const he=await a.fetchItems(),Se=(he==null?void 0:he.data)??he;ce=(Se==null?void 0:Se.data)??Se}else{const{DCodeApi:he}=ct();if(typeof he!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const Se={page:1,perPage:100,...E.value||{}},et=await he("","",Se,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),St=(et==null?void 0:et.data)??et;ce=(St==null?void 0:St.data)??St}x.value=Array.isArray(ce)?ce:[],S.value=!0}catch(ce){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",ce),x.value=[]}finally{g.value=!1}}}e.watch(()=>C.value,()=>{x.value=[],S.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&k.value&&w()});const y=e.computed(()=>{const te=p.value;if(a.returnObject)return te;const ce=new Map;for(const he of B.value)ce.set(m(he),he);return te.map(he=>ce.get(he)??{[a.itemValue]:he,[a.itemTitle]:String(he)})}),b=e.computed(()=>a.maxChips===null?y.value:y.value.slice(0,a.maxChips));function _(te){const ce=p.value;if(a.returnObject){const he=m(te);return ce.some(Se=>m(Se)===he)}return ce.includes(m(te))}const V=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const te=Number(a.maxSelected);return Number.isFinite(te)&&te>0?te:null}),D=e.computed(()=>{const te=V.value;return te===null?!1:p.value.length>=te});function N(te){return!_(te)&&D.value}const T=e.computed(()=>{const te=p.value,ce=new Set;if(a.returnObject)for(const he of te)ce.add(m(he));else for(const he of te)ce.add(he);return ce}),v=e.computed(()=>{const te=T.value;return(B.value||[]).filter(ce=>!te.has(m(ce)))}),X=e.computed(()=>B.value.length===0?!1:v.value.length===0),O=e.ref(null),H=e.ref(null),Y=e.ref(null),oe=e.ref(!1),M=e.ref(""),L=e.ref(0),ee=e.ref(0),{floatingStyles:Q}=$a(O,H,{whileElementsMounted:Fa,placement:"bottom-start",middleware:[za(8),Ia(),Ra({padding:8}),La({apply({rects:te,elements:ce}){Object.assign(ce.floating.style,{width:`${te.reference.width}px`,"--floating-width":`${te.reference.width}px`})}})]}),W=e.computed(()=>Q.value),ie=e.computed(()=>{const te=Number(a.maxRows);return Number.isFinite(te)&&te>0?te:5});async function de(){a.disabled||(oe.value=!0,ee.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),L.value=0}),k.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!S.value)&&!g.value&&await w())}function Ce(){oe.value=!1}function Ne(){oe.value?Ce():de()}function be(te){var he,Se;if(!oe.value)return;const ce=te.target;(he=O.value)!=null&&he.contains(ce)||(Se=H.value)!=null&&Se.contains(ce)||Ce()}e.onMounted(()=>document.addEventListener("mousedown",be)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",be));function J(te){if(a.disabled)return;if(N(te)){r("max");return}const ce=[...p.value];if(a.returnObject){const he=m(te);if(ce.some(et=>m(et)===he))return;r("update:modelValue",[...ce,te])}else{const he=m(te);if(ce.includes(he))return;r("update:modelValue",[...ce,he])}M.value="",ee.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),L.value=0})}function F(te){if(a.disabled)return;const ce=[...p.value];if(a.returnObject){const he=m(te);r("update:modelValue",ce.filter(Se=>m(Se)!==he))}else{const he=m(te);r("update:modelValue",ce.filter(Se=>Se!==he))}}function K(){a.disabled||(r("update:modelValue",[]),r("clear"),Ce())}const ae=e.computed(()=>{const te=M.value.trim().toLowerCase(),ce=v.value;return te?ce.filter(he=>f(he).toLowerCase().includes(te)):ce}),_e=e.computed(()=>ae.value.length);e.watch(oe,te=>{te||(M.value="")});const Re=e.computed(()=>{if(X.value)return a.itemHeight;const te=_e.value;return(te<=0?1:Math.min(te,ie.value))*a.itemHeight}),ze=e.computed(()=>a.virtual?_e.value*a.itemHeight:0),He=e.computed(()=>a.virtual?Math.ceil(Re.value/a.itemHeight)+a.overscan:_e.value),Xe=e.computed(()=>{if(!a.virtual)return 0;const te=Math.floor(L.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,te)}),ot=e.computed(()=>a.virtual?Math.min(_e.value,Xe.value+He.value):_e.value),Ie=e.computed(()=>a.virtual?Xe.value*a.itemHeight:0),mt=e.computed(()=>{const te=ae.value;return a.virtual?te.slice(Xe.value,ot.value):te});function pt(te){const ce=te.target;L.value=ce.scrollTop}function Tt(te){return te===ee.value}function G(te){const ce=Y.value;if(!ce||!a.virtual)return;const he=te*a.itemHeight,Se=he+a.itemHeight,et=ce.scrollTop,St=ce.scrollTop+ce.clientHeight;he<et?ce.scrollTop=he:Se>St&&(ce.scrollTop=Se-ce.clientHeight)}function ue(te){const ce=Math.max(0,_e.value-1);ee.value=Math.min(ce,Math.max(0,ee.value+te)),G(ee.value)}function Ee(){const te=ae.value[ee.value];te&&J(te)}const Ue=e.computed(()=>a.clearable&&!a.disabled&&y.value.length>0),Me=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":oe.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(te,ce)=>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",D1)):e.createCommentVNode("",!0),ce[3]||(ce[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",M1,"*")):e.createCommentVNode("",!0)],8,N1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:O,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",Me.value]]),disabled:a.disabled,onClick:Ne},[e.createElementVNode("div",P1,[y.value.length?(e.openBlock(),e.createElementBlock("div",v1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(he,Se)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${h(he,Se)}`,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",O1,e.toDisplayString(f(he)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(et=>F(he),["stop"]),"aria-label":"Remove"}," ✕ ",8,F1))]))),128)),a.maxChips!==null&&y.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",z1," +"+e.toDisplayString(y.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",R1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",I1,[Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(K,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,T1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[oe.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-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(W.value)},[a.searchable&&!X.value?(e.openBlock(),e.createElementBlock("div",L1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":ce[0]||(ce[0]=he=>M.value=he),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:[ce[1]||(ce[1]=e.withKeys(e.withModifiers(he=>ue(1),["prevent"]),["down"])),ce[2]||(ce[2]=e.withKeys(e.withModifiers(he=>ue(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(Ee,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Ce,["prevent"]),["esc"])]},null,40,$1),[[e.vModelText,M.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:Y,class:"relative overflow-auto",style:e.normalizeStyle({height:Re.value+"px"}),onScroll:pt},[X.value?(e.openBlock(),e.createElementBlock("div",j1," 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:ze.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(${Ie.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(he,Se)=>(e.openBlock(),e.createElementBlock("button",{key:String(h(he,Xe.value+Se)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[N(he)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Tt(Xe.value+Se)?"bg-neutral-50 dark:bg-neutral-800/60":"",_(he)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||N(he),onClick:et=>J(he)},[e.createElementVNode("span",W1,e.toDisplayString(f(he)),1),_(he)?(e.openBlock(),e.createElementBlock("span",H1,"✓")):e.createCommentVNode("",!0)],14,U1))),128))],6),_e.value===0?(e.openBlock(),e.createElementBlock("div",q1,[g.value?(e.openBlock(),e.createElementBlock("span",G1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",X1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",K1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,A1)),[[e.vShow,i.value]])}}),Y1={class:"space-y-4"},J1={key:0,class:"flex flex-col gap-0.5"},Q1=["for"],Z1=["for"],eC={class:"text-[11px] text-gray-500 dark:text-gray-400"},tC={class:"flex items-center gap-2 flex-nowrap"},nC=["id","value","disabled","onKeydown","onInput","onPaste"],sa=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}=ct(),f=Gs(),m=e.computed(()=>{const w=Number(s.totalInput);return w&&w>0?w:6}),h=()=>{c.value=Array.from({length:m.value},(w,y)=>{var b;return((b=s.default)==null?void 0:b[y])??""}),i("updateOtp",c.value.join(""))};h(),e.watch(()=>[s.totalInput,s.default],()=>h());const p=w=>{w<0||w>=m.value||e.nextTick(()=>{var y;return(y=l.value[w])==null?void 0:y.focus()})},k=w=>w.match(/[a-zA-Z0-9]/)?w.match(/[a-zA-Z0-9]/)[0]:"";async function x(w){var y;if(i("complete",w),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(w);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((y=s.endpoint)!=null&&y.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.endpoint.apiUrl,V=await u("","",{otp:w},{_url:_,_method:b,withCredentials:!0}),D=(V==null?void 0:V.data)??V;i("success",D)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const g=(w,y)=>{c.value[w]=k(y);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===m.value&&x(b)},S=(w,y)=>{const b=w.key,_=/^\d$/.test(b),V=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(w.preventDefault(),c.value[y]){g(y,"");return}y>0&&(g(y-1,""),p(y-1));return}if(b==="ArrowLeft"){w.preventDefault(),p(y-1);return}if(b==="ArrowRight"){w.preventDefault(),p(y+1);return}if(_||V){w.preventDefault(),g(y,b),y<m.value-1&&p(y+1);return}b.length===1&&w.preventDefault()},E=(w,y)=>{const b=w.target,_=b.value??"",V=k(_);b.value=V,g(y,V),V&&y<m.value-1&&p(y+1)},C=(w,y)=>{var N;w.preventDefault();const _=(((N=w.clipboardData)==null?void 0:N.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!_)return;let V=y;for(const T of _){if(V>=m.value)break;c.value[V]=T,V++}const D=c.value.join("");i("updateOtp",D),i("update:modelValue",D),D.length===m.value&&x(D),p(Math.min(V,m.value-1))},B=w=>y=>{l.value[w]=(y==null?void 0:y.$el)??y};return(w,y)=>(e.openBlock(),e.createElementBlock("div",Y1,[s.label||m.value?(e.openBlock(),e.createElementBlock("div",J1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,Q1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Z1)),e.createElementVNode("p",eC," Ketik "+e.toDisplayString(m.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",tC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:B(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-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:_=>S(_,b-1),onInput:_=>E(_,b-1),onPaste:_=>C(_,b-1)},null,42,nC))),128))])]))}}),oC={class:"w-full"},rC={key:0,class:"flex items-center justify-between mb-2"},aC={key:0,class:"text-sm font-medium text-gray-700"},sC={key:1,class:"text-sm text-gray-600"},iC={name:"DCodeProgress"},Gd=e.defineComponent({...iC,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",oC,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",rC,[t.label?(e.openBlock(),e.createElementBlock("span",aC,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",sC,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)]))}}),lC={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Xd=Dt(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",lC,[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"]]),cC={class:"grid gap-3"},dC={key:0,class:"ml-1 text-destructive"},uC={class:"flex flex-col"},fC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},mC={class:"relative flex-shrink-0 mt-0.5"},hC=["id","name","value","checked","disabled","required","onChange"],pC=["onClick"],gC=["for"],bC={key:0,class:"ml-1 text-red-500"},yC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Js=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}=ct(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var C,B;const E=((C=a.endpoint)==null?void 0:C.apiUrl)||a.apiUrl;if(E){i.value=!0,l.value=null;try{const w={page:1,perPage:100},y=((B=a.endpoint)==null?void 0:B.apiMethod)||a.apiMethod,b=await o(E,y,w);let _=b;a.dataPath?_=a.dataPath.split(".").reduce((D,N)=>D&&D[N]!=="undefined"?D[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(_=b.data),Array.isArray(_)?s.value=_:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(w){console.error("DCodeRadio fetch error:",w),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var E;((E=a.endpoint)!=null&&E.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 E=a.itemValue||a.model||"id",C=a.itemTitle||(a.label===""?"name":a.label);return C&&a.label!==""?[{[E]:E,[C]:C}]:[]}),u=E=>{if(typeof E!="object")return E;const C=a.itemValue||a.model||"id";return E[C]},f=E=>{if(typeof E!="object")return String(E);const C=a.itemTitle||"name";return E[C]},m=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),h=e.computed(()=>!!a.error||!!l.value),p=e.computed(()=>a.error||l.value),k=E=>E==null?a.modelValue===E:String(a.modelValue)===String(E),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]),g=(E,C)=>{C.target.checked&&(r("update:modelValue",E),r("change",E))},S=E=>{!a.disabled&&!k(E)&&(r("update:modelValue",E),r("change",E))};return(E,C)=>(e.openBlock(),e.createElementBlock("div",cC,[t.label?(e.openBlock(),e.createBlock(er,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",uC,[i.value?(e.openBlock(),e.createElementBlock("div",fC,[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,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:e.normalizeClass(["flex items-start",x.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",mC,[e.createElementVNode("input",{id:t.id?`${t.id}-${w}`:`${m.value}-${w}`,name:m.value,type:"radio",value:u(B),checked:k(u(B)),disabled:t.disabled,required:t.required&&w===0,onChange:y=>g(u(B),y),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,hC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:y=>S(u(B))},[e.createElementVNode("label",{for:t.id?`${t.id}-${w}`:`${m.value}-${w}`,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(B))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",bC,"*")):e.createCommentVNode("",!0)],10,gC)],8,pC)],2))),128))],2),h.value&&p.value?(e.openBlock(),e.createElementBlock("div",yC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(p.value),1)])):e.createCommentVNode("",!0)])]))}}),xC={class:"grid gap-3"},kC={key:0,class:"ml-1 text-destructive"},wC={class:"flex flex-col"},CC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},EC=["onClick"],BC=["id","name","value","checked","disabled","required","onChange"],_C={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},SC=["for"],VC={key:0,class:"ml-1 text-red-500"},AC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Qs=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}=ct(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,_=>{s.value=_},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var V,D;const _=((V=a.endpoint)==null?void 0:V.apiUrl)||a.apiUrl;if(_){l.value=!0,c.value=null;try{const N={page:1,perPage:100},T=((D=a.endpoint)==null?void 0:D.apiMethod)||a.apiMethod,v=await o(_,T,N);let X=v;a.dataPath?X=a.dataPath.split(".").reduce((H,Y)=>H&&H[Y]!=="undefined"?H[Y]:void 0,v):typeof v=="object"&&!Array.isArray(v)&&v.data&&(X=v.data),Array.isArray(X)?i.value=X:(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 m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const _=a.itemValue||a.model||"id",V=a.itemTitle||(a.label===""?"name":a.label);return V&&a.label!==""?[{[_]:_,[V]:V}]:[]}),p=_=>{if(typeof _!="object")return _;const V=a.itemValue||a.model||"id";return _[V]},k=_=>{if(typeof _!="object")return String(_);const V=a.itemTitle||"name";return _[V]},x=Math.random().toString(36).slice(2,7),g=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${x}`),S=e.computed(()=>!!a.error||!!c.value),E=e.computed(()=>a.error||c.value),C=_=>{const V=s.value;return _==null?V===_:String(V)===String(_)},B=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]),w=e.computed(()=>a.icon&&$t[a.icon]||null),y=(_,V)=>{V.target.checked&&(s.value=_,r("update:modelValue",_),r("change",_))},b=_=>{a.disabled||C(_)||(s.value=_,r("update:modelValue",_),r("change",_))};return(_,V)=>(e.openBlock(),e.createElementBlock("div",xC,[t.label?(e.openBlock(),e.createBlock(er,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",kC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",wC,[l.value?(e.openBlock(),e.createElementBlock("div",CC,[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(h.value,(D,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",C(p(D))?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&&b(p(D))},[e.createElementVNode("input",{id:t.id?`${t.id}-${N}`:`${g.value}-${N}`,name:g.value,type:"radio",value:p(D),checked:C(p(D)),disabled:t.disabled,required:t.required&&N===0,onChange:T=>y(p(D),T),class:"sr-only",tabindex:"-1"},null,40,BC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",C(p(D))?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"])},[w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",_C,[...V[1]||(V[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${N}`:`${g.value}-${N}`,class:e.normalizeClass([B.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",C(p(D))?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(k(D))+" ",1),t.required&&h.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",VC,"*")):e.createCommentVNode("",!0)],10,SC)],10,EC))),128))],2),S.value&&E.value?(e.openBlock(),e.createElementBlock("div",AC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])]))}}),DC={key:0,class:"ml-1 text-destructive"},NC={class:"relative w-full"},MC={key:0,class:"mb-2 flex items-center justify-between"},TC={class:"text-sm text-muted-foreground"},PC={class:"text-sm font-medium text-foreground"},vC={class:"text-sm text-muted-foreground"},OC={class:"relative"},FC=["id","value","min","max","step","disabled","placeholder"],zC={key:1,class:"relative mt-2"},RC={class:"text-xs text-muted-foreground mt-1"},IC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},LC={name:"DCodeSlider"},ia=e.defineComponent({...LC,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 B={sm:"h-2",md:"h-2.5",lg:"h-3"},w={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",B[a.size],w[a.color]||w.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),m=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(" ")),h=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),p=e.computed(()=>{const B=a.max-a.min;return(a.modelValue-a.min)/B*100}),k=B=>{const w=B.target,y=parseFloat(w.value);r("update:modelValue",y),r("input",y)},x=B=>{const w=B.target,y=parseFloat(w.value);r("change",y)},g=()=>{i.value=!0},S=()=>{i.value=!1},E=B=>{const w=a.max-a.min;return(B-a.min)/w*100},C=e.computed(()=>{const B={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 Jx(t,n=ad){e.watch(t,o=>Yx(o,n),{immediate:!0})}const Qx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zx=["for"],ek={key:0,class:"ml-1 text-destructive"},tk=["disabled","onClick"],nk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},ok=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],rk={class:"flex items-center justify-end gap-2 w-full p-2"},ak=["disabled","onClick"],sk={key:1,class:"text-xs text-destructive"},_r=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 x=o.required,E=o["aria-required"];return x===""||x===!0||x==="true"||E==="true"||E===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:x=>{a("update:modelValue",x),a("change",x)}}),u=e.computed(()=>r.locale==="en"?kx:Xx),f=e.computed(()=>r.range?2:!1),m=e.computed(()=>{if(!r.range)return!1;const x={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(x.maxRange=r.autoRangeDays,x.autoRange=r.autoRangeDays),x}),h=x=>{const E=new Date(x);return E.setHours(0,0,0,0),E},k=x=>{const E=new Date(x);return E.setHours(23,59,59,999),E},C=(x,E)=>{const M=new Date(x);return M.setDate(M.getDate()+E),M},w=e.computed(()=>{if(r.disablePast)return h(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return k(C(new Date,r.maxDaysAhead))}),A=e.ref(null),D=e.ref(null),S=x=>{D.value={month:x.month,year:x.year}},V=e.ref(!1);let B=null;e.onMounted(()=>{const x=document.documentElement,E=()=>V.value=x.classList.contains("dark");E(),B=new MutationObserver(E),B.observe(x,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Jx(e.toRef(r,"tone"));const g=x=>{const E=new Date(x),M=E.getDay(),T=E.getDate()-M+(M===0?-6:1);return E.setDate(T),h(E)},b=x=>{const E=g(x);return E.setDate(E.getDate()+6),k(E)},_=x=>{const E=new Date(x);return E.setDate(1),h(E)},y=x=>{const E=new Date(x);return E.setMonth(E.getMonth()+1),E.setDate(0),k(E)};return e.computed(()=>{if(!r.range)return[];const x=new Date,E=h(x),M=g(x),T=b(x),$=_(x),v=y(x),I=(j,U)=>{let P=j;r.disablePast&&P<E&&(P=E);let R=U;if(r.autoRangeDays&&r.autoRangeDays>0){const G=k(C(P,r.autoRangeDays-1));R>G&&(R=G)}return R<P&&(R=k(new Date(P))),[P,R]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:I(M,T)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:I($,v)}]}),(x,E)=>(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",Qx)):e.createCommentVNode("",!0),E[2]||(E[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",ek,"*")):e.createCommentVNode("",!0)],8,Zx)):e.createCommentVNode("",!0),e.createVNode(e.unref(Jd.VueDatePicker),{ref_key:"dpRef",ref:A,modelValue:d.value,"onUpdate:modelValue":E[1]||(E[1]=M=>d.value=M),dark:V.value,range:m.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":w.value,"max-date":p.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:S},{"dp-input":e.withCtx(({value:M,onInput:T,onEnter:$,onTab:v,onBlur:I,onFocus:j,onKeypress:U,onPaste:P,toggleMenu:R})=>[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:G=>R()},[e.createVNode(e.unref(te.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,tk),E[4]||(E[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",nk,e.toDisplayString(t.prependInner),1),E[3]||(E[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:M,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:G=>R(),onFocus:G=>j(),onBlur:G=>I(),onInput:G=>T(G),onKeydown:[e.withKeys(G=>$(G),["enter"]),e.withKeys(G=>v(G),["tab"])],onKeypress:G=>U(G),onPaste:G=>P()},null,42,ok)],2)]),"action-buttons":e.withCtx(({selectDate:M,selectionDisabled:T})=>[e.createElementVNode("div",rk,[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:E[0]||(E[0]=$=>{var v;return(v=A.value)==null?void 0:v.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:T,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:$=>M()},e.toDisplayString(t.selectLabel),9,ak)])]),_:1},8,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",sk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),ik=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=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),lk=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=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.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(fe.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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(fe.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(te.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ck=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(_e)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),dk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(_e)("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/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},fk={class:"flex items-center gap-3"},mk={class:"flex flex-col"},hk={key:0,class:"flex items-center gap-2"},pk={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"},gk={class:"flex justify-end gap-3 flex-wrap"},Jt=at(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?At[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(ik),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(lk),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",uk,[e.createElementVNode("div",fk,[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",mk,[e.createVNode(e.unref(dk),{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(ck),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",hk,[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",pk,[e.createElementVNode("div",gk,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),Dn=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(()=>bn(o.icon,At)),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))}}),bk={class:"flex flex-col gap-3 w-full"},yk={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"},xk={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"},kk={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"},wk={class:"text-sm font-medium text-slate-500"},Ck={class:"flex items-center justify-between gap-2"},Bk=["onClick"],Ek={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"},_k={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},Sk=["onClick"],Ak=["for","onDrop"],Vk={class:"text-xs text-slate-500 dark:text-slate-400"},Dk={key:2,class:"text-xs text-slate-400"},Nk=["id","disabled","accept","onChange"],Mk={class:"flex flex-col items-center justify-center min-h-[300px]"},Pk=["src","alt"],Tk=["src"],vk={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Ok={class:"text-sm font-medium"},Fk=["href"],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}=gt.useI18n(),i=e.computed(()=>{const B=o.endpoint;if(!(B!=null&&B.apiUrl))return null;let g=B.apiUrl;if(!g.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),_=g.startsWith("/")?g:`/${g}`;g=`${b}${_}`}return g}),l=e.computed(()=>{const B=c.value.length;return B<=1?"grid-cols-1":B===2?"grid-cols-1 md:grid-cols-2":B===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":B===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),m=e.ref(!1),h=e.ref(""),k=e.ref(""),C=e.ref(""),w=async()=>{var B;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((B=o.endpointReference)!=null&&B.apiUrl)){f.value=!1;return}try{const{apiUrl:g}=Ke(),b=await g(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let _=(b==null?void 0:b.data)||b;Array.isArray(_)||(_=[_]),c.value=_}catch(g){console.error("Failed to fetch dynamic document list",g)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),w()}),e.onBeforeUnmount(()=>{d.value.forEach(B=>{B._localPreviewUrl&&URL.revokeObjectURL(B._localPreviewUrl)})}),e.watch(()=>o.modelValue,B=>{if(Array.isArray(B)&&JSON.stringify(B)!==JSON.stringify(d.value)){const g=JSON.parse(JSON.stringify(B));g.forEach(b=>{const _=d.value.find(y=>y.typeDocument===b.typeDocument||y.idDocumentType===b.idDocumentType);_!=null&&_._localPreviewUrl&&(b._localPreviewUrl=_._localPreviewUrl)}),d.value=g}},{deep:!0}),e.watch(()=>{var B;return(B=o.endpointReference)==null?void 0:B.apiUrl},(B,g)=>{B!==g&&w()}),e.watch(()=>{var B;return(B=o.endpointReference)==null?void 0:B.apiMethod},(B,g)=>{B!==g&&w()}),e.watch(()=>o.items,B=>{c.value=B??[],f.value=!1},{deep:!0,immediate:!0});const p=B=>{const g=B[o.itemValue]||B.id||B.typeDocument;return d.value.find(b=>b.typeDocument===g||b.idDocumentType===g||b[o.itemValue]===g)||null},A=async(B,g,b)=>{var M,T,$,v;const _=b.target,y=(M=_.files)==null?void 0:M[0];if(!y)return;const x=B[o.itemValue]||B.id||B.typeDocument,E=URL.createObjectURL(y);if(!i.value){const I=[...d.value],j=I.findIndex(P=>P.typeDocument===x||P.idDocumentType===x);(T=I[j])!=null&&T._localPreviewUrl&&URL.revokeObjectURL(I[j]._localPreviewUrl);const U={id:null,idDocument:null,idDocumentType:x,filename:y.name,document:x,documentUrl:y.name,typeDocument:x,_localPreviewUrl:E,_fileType:y.type};j>-1?I[j]={...I[j],...U}:I.push(U),d.value=I,r("update:modelValue",I);return}u.value.add(g);try{const{apiUrl:I}=Ke(),j=new FormData;j.append("doc",y),j.append("typeDocument",String(x));const U=await I(i.value,(($=o.endpoint)==null?void 0:$.apiMethod)||"POST",j),P=Array.isArray(U==null?void 0:U.data)?U.data[0]:(U==null?void 0:U.data)||U,R=(P==null?void 0:P.url)||(P==null?void 0:P.document)||y.name,G=(P==null?void 0:P.id)||null,q=(P==null?void 0:P.filename)||(P==null?void 0:P.name)||y.name,W=[...d.value],Z=W.findIndex(ue=>ue.typeDocument===x||ue.idDocumentType===x);(v=W[Z])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(W[Z]._localPreviewUrl);const ne={...P,id:G||(P==null?void 0:P.idDocument)||(P==null?void 0:P.id_document)||null,idDocument:(P==null?void 0:P.idDocument)||G||(P==null?void 0:P.id_document)||null,idDocumentType:x,filename:q,document:x,documentUrl:R,typeDocument:x,_localPreviewUrl:E,_fileType:y.type};Z>-1?W[Z]={...W[Z],...ne}:W.push(ne),d.value=W,r("update:modelValue",W),r("uploaded",P),r("success",P)}catch(I){console.error("Upload failed",I)}finally{u.value.delete(g),_.value=""}},D=B=>{const g=B[o.itemValue]||B.id||B.typeDocument,b=d.value.find(y=>y.typeDocument===g||y.idDocumentType===g);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const _=d.value.filter(y=>y.typeDocument!==g&&y.idDocumentType!==g);d.value=_,r("update:modelValue",_)},S=B=>{const g=p(B);if(!g)return;let b=g._localPreviewUrl;if(!b)if(g.server&&g.url){const x=g.server.replace(/\/+$/,""),E=g.url.replace(/^\/+/,"");b=`${x}/${E}`}else b=g.document||g.url;if(!b)return;const _=g.mime||g._fileType||"",y=_==="application/pdf"||b.toLowerCase().endsWith(".pdf");y&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),h.value=b,k.value=B[o.itemTitle]||B.name||g.filename||"Preview Document",C.value=_||(y?"application/pdf":"image/jpeg"),m.value=!0},V=(B,g,b)=>{var x,E;b.preventDefault();const _=(E=(x=b.dataTransfer)==null?void 0:x.files)==null?void 0:E[0];if(!_)return;A(B,g,{target:{files:[_],value:""}})};return(B,g)=>(e.openBlock(),e.createElementBlock("div",bk,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(Dn,{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",yk,[e.createVNode(Dn,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",xk,[e.createVNode(e.unref(te.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",kk,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",wk,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,_)=>{var y;return e.openBlock(),e.createElementBlock("div",{key:_,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.createElementVNode("div",Ck,[e.createVNode(Dn,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),p(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:x=>S(b)},[e.createVNode(e.unref(te.Eye),{class:"w-4 h-4"})],8,Bk)):e.createCommentVNode("",!0)]),p(b)?(e.openBlock(),e.createElementBlock("div",Ek,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",_k,e.toDisplayString(((y=p(b))==null?void 0:y.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:x=>D(b)},[e.createVNode(e.unref(te.X),{class:"w-4 h-4"})],8,Sk))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${_}`,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(_)?"pointer-events-none opacity-70":""]]),onDragover:g[0]||(g[0]=e.withModifiers(()=>{},["prevent"])),onDrop:x=>!t.disabled&&!u.value.has(_)&&V(b,_,x)},[u.value.has(_)?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(te.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",Vk,e.toDisplayString(u.value.has(_)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",Dk,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${_}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(_),accept:t.typeFile,onChange:x=>A(b,_,x)},null,40,Nk)],42,Ak))])}),128))],2),e.createVNode(Jt,{modelValue:m.value,"onUpdate:modelValue":g[2]||(g[2]=b=>m.value=b),title:k.value,"max-width":C.value==="application/pdf"?"720":"500",class:e.normalizeClass(C.value==="application/pdf"?"max-w-[40vw]":""),"content-class":C.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:g[1]||(g[1]=b=>m.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Mk,[C.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:h.value,alt:k.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Pk)):C.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${h.value}${h.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,Tk)):(e.openBlock(),e.createElementBlock("div",vk,[e.createVNode(e.unref(te.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Ok,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:h.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Fk)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),sd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>At[n.icon]??At.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(_t),{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}))}}),zk=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(_e)(e.unref(Ik)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Rk=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(_e)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ik=Ho("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"}}),hs=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(_e)(e.unref(Lk)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Lk=Ho("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"}}),ps=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(_e)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),gs=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(_e)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),bs=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(_e)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),ys=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(_e)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),$k={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},jk={class:"flex flex-wrap items-center justify-center gap-2"},Uk=["accept","multiple"],Sr=at(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 g;o.disabled||(g=a.value)==null||g.click()}function f(g){const b=g/1024,_=b/1024;return _>=1?`${_.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${g} B`}function m(g){var _;if(!g)return"File tidak valid";if((_=o.accept)!=null&&_.includes("image/")&&!g.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return g.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function h(g){l.value=g.name,c.value=g.size}function k(g){if(i.value=null,!g.length)return;if(o.mode==="single"){const _=g[0],y=m(_);if(y){i.value=y,r("error",y);return}o.showSelected&&h(_),r("picked",_);return}const b=[];for(const _ of g){const y=m(_);if(y){i.value=y,r("error",y);return}b.push(_)}b.length&&(o.showSelected&&h(b[0]),r("picked:multiple",b))}function C(g){const b=g.target,_=Array.from(b.files??[]);k(_),b.value=""}function w(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function A(){s.value=!1}function D(g){var y,x;if(o.disabled)return;s.value=!1;const b=Array.from(((y=g.dataTransfer)==null?void 0:y.files)??[]),_=(x=o.accept)!=null&&x.includes("image/")?b.filter(E=>E.type.startsWith("image/")):b;k(_)}const S=e.computed(()=>(o.accept||"file/*").split(",").map(g=>g.trim()).filter(Boolean).map(g=>g==="image/*"?"IMAGE":g.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const V=e.ref(!1),B=e.computed(()=>{if(o.disabled||!V.value)return{};const g=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:g?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:g?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(g,b)=>(e.openBlock(),e.createBlock(e.unref(ps),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(bs),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(ys),{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(gs),{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(w,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(A,["prevent"]),onDrop:e.withModifiers(D,["prevent"]),onMouseenter:b[0]||(b[0]=_=>V.value=!0),onMouseleave:b[1]||(b[1]=_=>V.value=!1)},[e.createElementVNode("div",$k,[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",jk,[e.createVNode(e.unref(hs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(S.value),1)]),_:1}),e.createVNode(e.unref(hs),{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(hs),{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:C},null,40,Uk)],38),d.value?(e.openBlock(),e.createBlock(e.unref(zk),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Rk),{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"]]),Wk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Hk=["src"],qk={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"},Gk={class:"space-y-0.5"},Kk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Xk={class:"text-xs opacity-70"},Yk=["disabled"],Jk={key:1},Qk=["disabled"],Zk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},ew={class:"flex gap-2"},tw={class:"font-medium truncate"},nw={class:"flex gap-2"},ow={class:"font-medium"},rw={class:"flex gap-2"},aw={class:"font-medium truncate"},xs=at(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,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(h){const k=h/1024,C=k/1024;return C>=1?`${C.toFixed(2)} MB`:k>=1?`${k.toFixed(1)} KB`:`${h} 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 m=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(h,k)=>t.file?(e.openBlock(),e.createBlock(ps,{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(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{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",Wk,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var C,w,p,A,D;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`},m.value]),onMouseenter:k[2]||(k[2]=S=>c.value=!0),onMouseleave:k[3]||(k[3]=S=>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,Hk)):(e.openBlock(),e.createElementBlock("div",qk,[e.createVNode(e.unref(te.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Gk,[e.createElementVNode("p",Kk,e.toDisplayString((C=l.value)==null?void 0:C.name),1),e.createElementVNode("p",Xk,e.toDisplayString((w=l.value)==null?void 0:w.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:k[0]||(k[0]=S=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Yk)):(e.openBlock(),e.createElementBlock("div",Jk)),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:k[1]||(k[1]=S=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Qk)):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",Zk,[e.createElementVNode("div",ew,[k[4]||(k[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",tw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",nw,[k[5]||(k[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",ow,e.toDisplayString((A=l.value)==null?void 0:A.size),1)]),e.createElementVNode("div",rw,[k[6]||(k[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",aw,e.toDisplayString((D=l.value)==null?void 0:D.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function ks(){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 sw={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"},id=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 g=B.lastIndexOf(".");return g>=0?B.slice(g).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}),m=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function h(B){if(d.value.length){const g=(B.type||"").toLowerCase(),b=u(B.name);return d.value.some(_=>_.includes("/")?g===_:_.startsWith(".")?b===_:b===`.${_}`)}if(o.accept){if(o.accept==="*/*")return!0;const g=o.accept.split(",").map(y=>y.trim().toLowerCase()),b=(B.type||"").toLowerCase(),_=u(B.name);return g.some(y=>{if(y.endsWith("/*")){const x=y.slice(0,-2);return b.startsWith(x)}return y.startsWith(".")?_===y:b===y})}return!0}function k(B){return B*1024*1024}async function C(B){return B?h(B)?o.minSizeMb!=null&&B.size<k(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>k(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${m.value}`:"File tidak valid"}const{DCodeApi:w}=Ke(),p=ks(),A=e.ref(!1);async function D(B){var g;if(o.uploadFn){try{A.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{A.value=!1}return}if(!((g=o.endpoint)!=null&&g.apiUrl)){a.value=B;return}if(typeof w!="function"){l("useApi() must expose DCodeApi()");return}try{A.value=!0;const b=new FormData;b.append("doc",B);const _=(o.endpoint.apiMethod||"POST").toUpperCase(),y=o.endpoint.apiUrl,x=await w("","",b,{_url:y,_method:_,withCredentials:!0,transformRequest:[(M,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),M)]}),E=(x==null?void 0:x.data)??x;a.value=B,r("uploaded",E)}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{A.value=!1}}async function S(B){var b;if(o.disabled)return;c();const g=await C(B);if(g){l(g);return}s.value=B,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await D(B):a.value=B}function V(){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,g)=>(e.openBlock(),e.createElementBlock("div",sw,[a.value?A.value?(e.openBlock(),e.createElementBlock("div",iw,[...g[1]||(g[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(xs,{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:V},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||A.value,onPicked:S,error:i.value,onError:g[0]||(g[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),lw=["for"],cw={key:0,class:"!ml-1 !text-destructive"},dw={class:"relative w-full block box-border"},uw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},fw=["id","readonly","disabled","placeholder"],mw={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"},pw={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"},bw=["onClick","title"],yw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},xw={class:"flex items-center justify-center flex-1"},kw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},ww={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},ld=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=At,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(""),m=e.ref(!1),h=e.ref(!1),k=e.ref(!1),C=e.shallowRef([]),w=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),A=async()=>{if(h.value||k.value)return;k.value=!0,await new Promise(R=>setTimeout(R,0));const P=Object.keys(a).filter(R=>!p.has(R)).filter(R=>/^[A-Z]/.test(R)).filter(R=>typeof a[R]=="function"||typeof a[R]=="object"&&a[R]).sort((R,G)=>R.localeCompare(G));C.value=P,h.value=!0,k.value=!1},D=e.computed(()=>u.value?bn(u.value,a):null),S=e.ref(u.value),V=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!h.value)return[];const P=(f.value??"").trim().toLowerCase();return P?C.value.filter(R=>R.toLowerCase().includes(P)):C.value}),g=e.computed(()=>B.value.slice(0,w.value)),b=e.computed(()=>{const P=o.columns;return P<=2?"grid-cols-2":P===3?"grid-cols-3":P===4?"grid-cols-4":P===5?"grid-cols-5":P>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>D.value&&!d.value?"!pl-12":"!pl-3");const _=async()=>{var P;await e.nextTick(),(P=i.value)==null||P.focus()},y=async P=>{if(o.disabled)return;const R=P!==!1;if(m.value){m.value=!1;return}d.value=!0,await A(),R&&(f.value="",S.value=""),w.value=o.pageSize,await _()},x=()=>{d.value=!1,f.value="",S.value=u.value,w.value=o.pageSize},E=async()=>{o.disabled||(d.value?x():await y())};let M=null;const T=async P=>{if(o.disabled)return;r("update:modelValue",null),d.value||await y(!1),M&&clearTimeout(M);const R=S.value;M=setTimeout(()=>{f.value=R},300)},$=P=>{o.disabled||(r("update:modelValue",P),x(),queueMicrotask(()=>{var R;return(R=i.value)==null?void 0:R.blur()}))},v=()=>{o.disabled||(r("update:modelValue",null),r("clear"),m.value=!0,x(),queueMicrotask(()=>{var P;return(P=i.value)==null?void 0:P.focus()}))},I=P=>{if(P.key==="Escape"){P.preventDefault(),x();return}if(P.key==="Enter"&&d.value){const R=B.value[0];R&&(P.preventDefault(),$(R))}},j=P=>{if(!d.value)return;const R=P.target;s.value&&!s.value.contains(R)&&x()},U=P=>{const R=P.target;R.scrollTop+R.clientHeight>=R.scrollHeight-24&&w.value<B.value.length&&(w.value=Math.min(w.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",j),queueMicrotask(()=>{var P;i.value=((P=s.value)==null?void 0:P.querySelector("input"))??null}),u.value&&A()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",j),M&&clearTimeout(M)}),e.watch(u,P=>{d.value||(S.value=P)}),e.watch(()=>f.value,()=>{w.value=o.pageSize}),(P,R)=>(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",cw,"*")):e.createCommentVNode("",!0)],8,lw)):e.createCommentVNode("",!0),e.createElementVNode("div",dw,[D.value&&!d.value?(e.openBlock(),e.createElementBlock("div",uw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(D.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":R[0]||(R[0]=G=>S.value=G),readonly:V.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",[D.value&&!d.value?"pl-10":"pl-4",V.value?"cursor-pointer select-none":""]]),onClick:y,onFocus:y,onInput:T,onKeydown:I},null,42,fw),[[e.vModelText,S.value]]),e.createElementVNode("div",mw,[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:R[1]||(R[1]=e.withModifiers(()=>{},["prevent"])),onClick:v,title:"Clear"},[e.createVNode(e.unref(te.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:R[2]||(R[2]=e.withModifiers(()=>{},["prevent"])),onClick:E,title:"Open"},[e.createVNode(e.unref(te.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:U},[k.value?(e.openBlock(),e.createElementBlock("div",pw,[e.createVNode(e.unref(te.Loader2),{class:"h-4 w-4 animate-spin"}),R[3]||(R[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):h.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",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,G=>(e.openBlock(),e.createElementBlock("button",{key:G,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===G?"ring-1 ring-primary":""]),onClick:q=>$(G),title:G},[e.createElementVNode("div",yw,[e.createElementVNode("div",xw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[G]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",kw,e.toDisplayString(G),1)])],10,bw))),128))],2)),h.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",ww," Showing "+e.toDisplayString(g.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Cw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Bw={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},Ew={class:"relative overflow-auto p-0"},ws=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:D=>r("update:modelValue",D)}),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 m(D,S,V,B,g){const b=await new Promise((x,E)=>{const M=URL.createObjectURL(D),T=new Image;T.onload=()=>{URL.revokeObjectURL(M),x(T)},T.onerror=$=>{URL.revokeObjectURL(M),E($)},T.src=M}),_=document.createElement("canvas");_.width=S,_.height=V;const y=_.getContext("2d");return y?(y.drawImage(b,0,0,S,V),await new Promise(x=>{_.toBlob(E=>x(E||D),B,g)})):D}function h(){if(!l||!i.value)return;const D=l.getPlugin("Dashboard"),S=l.getFile(i.value);!D||!S||requestAnimationFrame(()=>{try{D.openFileEditor(S)}catch{try{D.openFileEditor(i.value)}catch{}}})}async function k(D){if(l){l.cancelAll(),i.value=null;try{const S=l.addFile({name:D.name,type:D.type,data:D,source:"Local",isRemote:!1});i.value=String(S)}catch{}}}function C(){if(!s.value)return;l&&f(),l=new Qd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const D=document.documentElement.classList.contains("dark");l.use(Us,{target:s.value,inline:!0,height:480,theme:D?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const S=document.documentElement.classList.contains("dark"),V=l.getPlugin("Dashboard");V&&V.setOptions({theme:S?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(Zd,{target:Us,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",S=>{i.value=(S==null?void 0:S.id)??null,o.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async S=>{const V=++d;try{const B=S.data,g=B.type||S.type||"image/jpeg";let b=B;if(o.outputWidth&&o.outputHeight&&(b=await m(B,o.outputWidth,o.outputHeight,g,o.quality)),c||V!==d)return;const _=S.name||"edited-image.jpg",y=new File([b],_,{type:g});await w(y,"UPPY_EDITOR_COMPLETE"),r("done",y),a.value=!1}catch{}})}async function w(D,S="CROP_RESULT"){const V=URL.createObjectURL(D);try{const B=await new Promise((g,b)=>{const _=new Image;_.onload=()=>g(_),_.onerror=b,_.src=V});console.group(S),console.log("file:",D),console.table({name:D.name,type:D.type,sizeBytes:D.size,sizeMB:+(D.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",V),console.groupEnd()}finally{URL.revokeObjectURL(V)}}e.watch(a,async D=>{c=!D,d++,D?(await e.nextTick(),C(),o.file&&await k(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async D=>{a.value&&D&&(await e.nextTick(),await k(D))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=D=>{D.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,D=>{D?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const A=e.ref(!1);return(D,S)=>a.value?(e.openBlock(),e.createElementBlock("div",Cw,[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:S[0]||(S[0]=V=>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:S[4]||(S[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bw,[S[6]||(S[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:A.value?1:.7}),onClick:S[1]||(S[1]=V=>a.value=!1),onMouseenter:S[2]||(S[2]=V=>A.value=!0),onMouseleave:S[3]||(S[3]=V=>A.value=!1)},[e.createVNode(e.unref(te.X),{class:"h-4 w-4"}),S[5]||(S[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",Ew,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),_w={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Sw=["src"],Aw=["disabled"],Vw=["disabled"],Dw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Nw={class:"flex gap-2"},Mw={class:"font-medium truncate"},Pw={class:"flex gap-2"},Tw={class:"font-medium"},vw={class:"flex gap-2"},Ow={class:"font-medium truncate"},Cs=at(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,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(m){const h=m/1024,k=h/1024;return k>=1?`${k.toFixed(2)} MB`:h>=1?`${h.toFixed(1)} KB`:`${m} 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(m,h)=>t.file?(e.openBlock(),e.createBlock(ps,{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(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{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",_w,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var k,C,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`},f.value]),onMouseenter:h[2]||(h[2]=p=>l.value=!0),onMouseleave:h[3]||(h[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,Sw)):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:h[0]||(h[0]=p=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Aw)):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:h[1]||(h[1]=p=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Vw)):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",Dw,[e.createElementVNode("div",Nw,[h[4]||(h[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Mw,e.toDisplayString((k=i.value)==null?void 0:k.name),1)]),e.createElementVNode("div",Pw,[h[5]||(h[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Tw,e.toDisplayString((C=i.value)==null?void 0:C.size),1)]),e.createElementVNode("div",vw,[h[6]||(h[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Ow,e.toDisplayString((w=i.value)==null?void 0:w.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),Fw={class:"space-y-3"},Ar=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:v=>r("update:modelValue",v)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(v){c.value=v,r("error",v)}function u(){c.value=null}const f=e.computed(()=>{const v=(o.allowedTypes??"").trim();return v?v.split(/[,\s;]+/g).map(j=>j.trim().toLowerCase()).filter(Boolean).map(j=>j.includes("/")||j.startsWith(".")?j:`.${j}`):[]});function m(v){const I=v.lastIndexOf(".");return I>=0?v.slice(I).toLowerCase():""}const h=e.computed(()=>{if(f.value.length){const v=f.value.filter(j=>j.startsWith("."));return[...f.value.filter(j=>j.includes("/")),...v].join(",")}return o.accept||"image/*"}),k=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function C(v){if(f.value.length){const j=(v.type||"").toLowerCase(),U=m(v.name);return f.value.some(P=>P.includes("/")?j===P:P.startsWith(".")?U===P:U===`.${P}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(v.type||"").toLowerCase().startsWith("image/"):!0}function w(v){return v*1024*1024}async function p(v){var I;return(I=v.type)!=null&&I.startsWith("image/")?await new Promise(j=>{const U=URL.createObjectURL(v),P=new Image;P.onload=()=>{URL.revokeObjectURL(U),j({w:P.naturalWidth,h:P.naturalHeight})},P.onerror=()=>{URL.revokeObjectURL(U),j(null)},P.src=U}):null}async function A(v){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const j=await p(v);return j?o.minWidth!=null&&j.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&j.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&j.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&j.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function D(v){return v?C(v)?o.minSizeMb!=null&&v.size<w(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&v.size>w(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await A(v):`only Allowed: ${k.value}`:"File tidak valid"}function S(v){o.disabled||(i.value=v,s.value=!0)}async function V(v){if(o.disabled)return;u();const I=await D(v);if(I){d(I);return}l.value=v,S(v)}const{DCodeApi:B}=Ke(),g=ks(),b=e.ref(!1);e.ref(null);function _(v,I){return!v||!I?null:v.replace(/\/+$/,"")+"/"+I.replace(/^\/+/,"")}function y(v){var P;const I=(v==null?void 0:v.data)??v,j=(P=I==null?void 0:I.data)==null?void 0:P[0];if(!j)return null;const U=_(j.server,j.url);return{...j,fullUrl:U?encodeURI(U):null}}async function x(v){var I;if(o.uploadFn){try{b.value=!0;const j=await o.uploadFn(v);a.value=v,r("uploaded",j)}catch(j){console.error("Upload Error",j),g.error("Upload Failed",(j==null?void 0:j.message)||"Unknown error"),d((j==null?void 0:j.message)||"Upload Failed")}finally{b.value=!1}return}if(!((I=o.endpoint)!=null&&I.apiUrl)){a.value=v;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const j=new FormData;j.append("doc",v);const U=(o.endpoint.apiMethod||"POST").toUpperCase(),P=o.endpoint.apiUrl,R=await B("","",j,{_url:P,_method:U,withCredentials:!0,transformRequest:[(q,W)=>(W&&(delete W["Content-Type"],delete W["content-type"]),q)]}),G=(R==null?void 0:R.data)??R;y(G),a.value=v,r("uploaded",G)}catch(j){console.error("Upload Error",j),g.error("Upload Failed",(j==null?void 0:j.message)||"Unknown error"),d((j==null?void 0:j.message)||"Upload Failed")}finally{b.value=!1}}async function E(v){var I;u(),o.uploadFn||(I=o.endpoint)!=null&&I.apiUrl?await x(v):a.value=v,s.value=!1,i.value=null}function M(){s.value=!1,i.value=null}async function T(){if(!a.value)return;u();const v=o.editUseOriginal?l.value??a.value:a.value,I=await D(v);if(I){d(I);return}S(v)}function $(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,v=>{v&&!l.value&&(l.value=v),v||(l.value=null)},{immediate:!0}),(v,I)=>(e.openBlock(),e.createElementBlock("div",Fw,[a.value?(e.openBlock(),e.createBlock(Cs,{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:$,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:V,error:c.value,onError:I[0]||(I[0]=j=>d(j))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(ws,{modelValue:s.value,"onUpdate:modelValue":I[1]||(I[1]=j=>s.value=j),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:E,onCancel:M},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),zw=["aria-busy"],Rw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Iw=["for"],Lw={key:0,class:"ml-1 text-destructive"},$w=["id","disabled"],jw={class:"min-w-0 flex-1 text-left"},Uw={key:0,class:"flex flex-wrap gap-1.5"},Ww={class:"max-w-[220px] truncate"},Hw=["onClick"],qw={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"},Gw={key:1,class:"text-muted-foreground truncate"},Kw={class:"flex items-center gap-2 shrink-0"},Xw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},Yw=["placeholder","onKeydown"],Jw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},Qw=["disabled","onClick"],Zw={class:"truncate"},e1={key:0,class:"text-primary-600 dark:text-primary-400"},t1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},n1={key:0},o1={key:1},r1={key:1,class:"text-xs text-destructive"},Bs=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 Q=o.required,oe=o["aria-required"];return Q===""||Q===!0||Q==="true"||(oe==="true"||oe===!0)}),u=e.computed(()=>!!a.error);function f(Q){return Q?typeof a.itemTitle=="function"?a.itemTitle(Q)??"":String((Q==null?void 0:Q[a.itemTitle])??""):""}function m(Q){return Q?typeof a.itemValue=="function"?a.itemValue(Q):Q==null?void 0:Q[a.itemValue]:null}function h(Q,oe){return m(Q)??oe}const k=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),C=e.computed(()=>{var Q;return!!((Q=a.endpoint)!=null&&Q.apiUrl)||!!a.fetchItems}),w=e.ref([]),p=e.ref(!1),A=e.ref(!1),D=e.computed(()=>{var oe;const Q=(oe=a.endpoint)==null?void 0:oe.apiOptions;if(Q)return typeof Q=="function"?Q():Q}),S=e.computed(()=>{var xe,He;const Q=((xe=a.endpoint)==null?void 0:xe.apiUrl)??"",oe=(((He=a.endpoint)==null?void 0:He.apiMethod)??"GET").toUpperCase(),se=JSON.stringify(D.value??null);return`${oe} ${Q} :: ${se}`}),V=e.computed(()=>C.value?w.value:a.items||[]);async function B(){var Q;if(C.value&&!(!((Q=a.endpoint)!=null&&Q.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let oe;if(a.fetchItems){const se=await a.fetchItems(),xe=(se==null?void 0:se.data)??se;oe=(xe==null?void 0:xe.data)??xe}else{const{DCodeApi:se}=Ke();if(typeof se!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const xe={page:1,perPage:100,...D.value||{}},He=await se("","",xe,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),zt=(He==null?void 0:He.data)??He;oe=(zt==null?void 0:zt.data)??zt}w.value=Array.isArray(oe)?oe:[],A.value=!0}catch(oe){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",oe),w.value=[]}finally{p.value=!1}}}e.watch(()=>S.value,()=>{w.value=[],A.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&C.value&&B()});const g=e.computed(()=>{const Q=k.value;if(a.returnObject)return Q;const oe=new Map;for(const se of V.value)oe.set(m(se),se);return Q.map(se=>oe.get(se)??{[a.itemValue]:se,[a.itemTitle]:String(se)})}),b=e.computed(()=>a.maxChips===null?g.value:g.value.slice(0,a.maxChips));function _(Q){const oe=k.value;if(a.returnObject){const se=m(Q);return oe.some(xe=>m(xe)===se)}return oe.includes(m(Q))}const y=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const Q=Number(a.maxSelected);return Number.isFinite(Q)&&Q>0?Q:null}),x=e.computed(()=>{const Q=y.value;return Q===null?!1:k.value.length>=Q});function E(Q){return!_(Q)&&x.value}const M=e.computed(()=>{const Q=k.value,oe=new Set;if(a.returnObject)for(const se of Q)oe.add(m(se));else for(const se of Q)oe.add(se);return oe}),T=e.computed(()=>{const Q=M.value;return(V.value||[]).filter(oe=>!Q.has(m(oe)))}),$=e.computed(()=>V.value.length===0?!1:T.value.length===0),v=e.ref(null),I=e.ref(null),j=e.ref(null),U=e.ref(!1),P=e.ref(""),R=e.ref(0),G=e.ref(0),{floatingStyles:q}=ha(v,I,{whileElementsMounted:ca,placement:"bottom-start",middleware:[da(8),fa(),ua({padding:8}),ma({apply({rects:Q,elements:oe}){Object.assign(oe.floating.style,{width:`${Q.reference.width}px`,"--floating-width":`${Q.reference.width}px`})}})]}),W=e.computed(()=>q.value),Z=e.computed(()=>{const Q=Number(a.maxRows);return Number.isFinite(Q)&&Q>0?Q:5});async function ne(){a.disabled||(U.value=!0,G.value=0,requestAnimationFrame(()=>{j.value&&(j.value.scrollTop=0),R.value=0}),C.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!A.value)&&!p.value&&await B())}function ue(){U.value=!1}function ke(){U.value?ue():ne()}function me(Q){var se,xe;if(!U.value)return;const oe=Q.target;(se=v.value)!=null&&se.contains(oe)||(xe=I.value)!=null&&xe.contains(oe)||ue()}e.onMounted(()=>document.addEventListener("mousedown",me)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",me));function X(Q){if(a.disabled)return;if(E(Q)){r("max");return}const oe=[...k.value];if(a.returnObject){const se=m(Q);if(oe.some(He=>m(He)===se))return;r("update:modelValue",[...oe,Q])}else{const se=m(Q);if(oe.includes(se))return;r("update:modelValue",[...oe,se])}P.value="",G.value=0,requestAnimationFrame(()=>{j.value&&(j.value.scrollTop=0),R.value=0})}function O(Q){if(a.disabled)return;const oe=[...k.value];if(a.returnObject){const se=m(Q);r("update:modelValue",oe.filter(xe=>m(xe)!==se))}else{const se=m(Q);r("update:modelValue",oe.filter(xe=>xe!==se))}}function K(){a.disabled||(r("update:modelValue",[]),r("clear"),ue())}const ee=e.computed(()=>{const Q=P.value.trim().toLowerCase(),oe=T.value;return Q?oe.filter(se=>f(se).toLowerCase().includes(Q)):oe}),he=e.computed(()=>ee.value.length);e.watch(U,Q=>{Q||(P.value="")});const Ve=e.computed(()=>{if($.value)return a.itemHeight;const Q=he.value;return(Q<=0?1:Math.min(Q,Z.value))*a.itemHeight}),Ne=e.computed(()=>a.virtual?he.value*a.itemHeight:0),ze=e.computed(()=>a.virtual?Math.ceil(Ve.value/a.itemHeight)+a.overscan:he.value),Re=e.computed(()=>{if(!a.virtual)return 0;const Q=Math.floor(R.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,Q)}),Ue=e.computed(()=>a.virtual?Math.min(he.value,Re.value+ze.value):he.value),Me=e.computed(()=>a.virtual?Re.value*a.itemHeight:0),Ze=e.computed(()=>{const Q=ee.value;return a.virtual?Q.slice(Re.value,Ue.value):Q});function ct(Q){const oe=Q.target;R.value=oe.scrollTop}function St(Q){return Q===G.value}function H(Q){const oe=j.value;if(!oe||!a.virtual)return;const se=Q*a.itemHeight,xe=se+a.itemHeight,He=oe.scrollTop,zt=oe.scrollTop+oe.clientHeight;se<He?oe.scrollTop=se:xe>zt&&(oe.scrollTop=xe-oe.clientHeight)}function re(Q){const oe=Math.max(0,he.value-1);G.value=Math.min(oe,Math.max(0,G.value+Q)),H(G.value)}function pe(){const Q=ee.value[G.value];Q&&X(Q)}const Ie=e.computed(()=>a.clearable&&!a.disabled&&g.value.length>0),Ee=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":U.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Q,oe)=>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",Rw)):e.createCommentVNode("",!0),oe[3]||(oe[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",Lw,"*")):e.createCommentVNode("",!0)],8,Iw)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:v,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",Ee.value]]),disabled:a.disabled,onClick:ke},[e.createElementVNode("div",jw,[g.value.length?(e.openBlock(),e.createElementBlock("div",Uw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(se,xe)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${h(se,xe)}`,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",Ww,e.toDisplayString(f(se)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(He=>O(se),["stop"]),"aria-label":"Remove"}," ✕ ",8,Hw))]))),128)),a.maxChips!==null&&g.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",qw," +"+e.toDisplayString(g.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Gw,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",Kw,[Ie.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(K,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(te.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,$w),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:I,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(W.value)},[a.searchable&&!$.value?(e.openBlock(),e.createElementBlock("div",Xw,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":oe[0]||(oe[0]=se=>P.value=se),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:[oe[1]||(oe[1]=e.withKeys(e.withModifiers(se=>re(1),["prevent"]),["down"])),oe[2]||(oe[2]=e.withKeys(e.withModifiers(se=>re(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(pe,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ue,["prevent"]),["esc"])]},null,40,Yw),[[e.vModelText,P.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:j,class:"relative overflow-auto",style:e.normalizeStyle({height:Ve.value+"px"}),onScroll:ct},[$.value?(e.openBlock(),e.createElementBlock("div",Jw," 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:Ne.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(${Me.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(se,xe)=>(e.openBlock(),e.createElementBlock("button",{key:String(h(se,Re.value+xe)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[E(se)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",St(Re.value+xe)?"bg-neutral-50 dark:bg-neutral-800/60":"",_(se)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||E(se),onClick:He=>X(se)},[e.createElementVNode("span",Zw,e.toDisplayString(f(se)),1),_(se)?(e.openBlock(),e.createElementBlock("span",e1,"✓")):e.createCommentVNode("",!0)],14,Qw))),128))],6),he.value===0?(e.openBlock(),e.createElementBlock("div",t1,[p.value?(e.openBlock(),e.createElementBlock("span",n1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",o1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",r1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,zw)),[[e.vShow,i.value]])}}),a1={class:"space-y-4"},s1={key:0,class:"flex flex-col gap-0.5"},i1=["for"],l1=["for"],c1={class:"text-[11px] text-gray-500 dark:text-gray-400"},d1={class:"flex items-center gap-2 flex-nowrap"},u1=["id","value","disabled","onKeydown","onInput","onPaste"],Vr=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}=Ke(),f=ks(),m=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),h=()=>{c.value=Array.from({length:m.value},(B,g)=>{var b;return((b=s.default)==null?void 0:b[g])??""}),i("updateOtp",c.value.join(""))};h(),e.watch(()=>[s.totalInput,s.default],()=>h());const k=B=>{B<0||B>=m.value||e.nextTick(()=>{var g;return(g=l.value[B])==null?void 0:g.focus()})},C=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function w(B){var g;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((g=s.endpoint)!=null&&g.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.endpoint.apiUrl,y=await u("","",{otp:B},{_url:_,_method:b,withCredentials:!0}),x=(y==null?void 0:y.data)??y;i("success",x)}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,g)=>{c.value[B]=C(g);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===m.value&&w(b)},A=(B,g)=>{const b=B.key,_=/^\d$/.test(b),y=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(B.preventDefault(),c.value[g]){p(g,"");return}g>0&&(p(g-1,""),k(g-1));return}if(b==="ArrowLeft"){B.preventDefault(),k(g-1);return}if(b==="ArrowRight"){B.preventDefault(),k(g+1);return}if(_||y){B.preventDefault(),p(g,b),g<m.value-1&&k(g+1);return}b.length===1&&B.preventDefault()},D=(B,g)=>{const b=B.target,_=b.value??"",y=C(_);b.value=y,p(g,y),y&&g<m.value-1&&k(g+1)},S=(B,g)=>{var E;B.preventDefault();const _=(((E=B.clipboardData)==null?void 0:E.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!_)return;let y=g;for(const M of _){if(y>=m.value)break;c.value[y]=M,y++}const x=c.value.join("");i("updateOtp",x),i("update:modelValue",x),x.length===m.value&&w(x),k(Math.min(y,m.value-1))},V=B=>g=>{l.value[B]=(g==null?void 0:g.$el)??g};return(B,g)=>(e.openBlock(),e.createElementBlock("div",a1,[s.label||m.value?(e.openBlock(),e.createElementBlock("div",s1,[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,l1)),e.createElementVNode("p",c1," Ketik "+e.toDisplayString(m.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:V(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-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(_,b-1),onInput:_=>D(_,b-1),onPaste:_=>S(_,b-1)},null,42,u1))),128))])]))}}),f1={class:"w-full"},m1={key:0,class:"flex items-center justify-between mb-2"},h1={key:0,class:"text-sm font-medium text-gray-700"},p1={key:1,class:"text-sm text-gray-600"},g1={name:"DCodeProgress"},cd=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",f1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",m1,[t.label?(e.openBlock(),e.createElementBlock("span",h1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",p1,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)]))}}),b1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},dd=at(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",b1,[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"]]),y1={class:"grid gap-3"},x1={key:0,class:"ml-1 text-destructive"},k1={class:"flex flex-col"},w1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},C1={class:"relative flex-shrink-0 mt-0.5"},B1=["id","name","value","checked","disabled","required","onChange"],E1=["onClick"],_1=["for"],S1={key:0,class:"ml-1 text-red-500"},A1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Es=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}=Ke(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var S,V;const D=((S=a.endpoint)==null?void 0:S.apiUrl)||a.apiUrl;if(D){i.value=!0,l.value=null;try{const B={page:1,perPage:100},g=((V=a.endpoint)==null?void 0:V.apiMethod)||a.apiMethod,b=await o(D,g,B);let _=b;a.dataPath?_=a.dataPath.split(".").reduce((x,E)=>x&&x[E]!=="undefined"?x[E]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(_=b.data),Array.isArray(_)?s.value=_:(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 D;((D=a.endpoint)!=null&&D.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 D=a.itemValue||a.model||"id",S=a.itemTitle||(a.label===""?"name":a.label);return S&&a.label!==""?[{[D]:D,[S]:S}]:[]}),u=D=>{if(typeof D!="object")return D;const S=a.itemValue||a.model||"id";return D[S]},f=D=>{if(typeof D!="object")return String(D);const S=a.itemTitle||"name";return D[S]},m=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),h=e.computed(()=>!!a.error||!!l.value),k=e.computed(()=>a.error||l.value),C=D=>D==null?a.modelValue===D:String(a.modelValue)===String(D),w=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=(D,S)=>{S.target.checked&&(r("update:modelValue",D),r("change",D))},A=D=>{!a.disabled&&!C(D)&&(r("update:modelValue",D),r("change",D))};return(D,S)=>(e.openBlock(),e.createElementBlock("div",y1,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",x1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",k1,[i.value?(e.openBlock(),e.createElementBlock("div",w1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),S[0]||(S[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,(V,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",w.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",C1,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${m.value}-${B}`,name:m.value,type:"radio",value:u(V),checked:C(u(V)),disabled:t.disabled,required:t.required&&B===0,onChange:g=>p(u(V),g),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,B1)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:g=>A(u(V))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${m.value}-${B}`,class:e.normalizeClass([w.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(V))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",S1,"*")):e.createCommentVNode("",!0)],10,_1)],8,E1)],2))),128))],2),h.value&&k.value?(e.openBlock(),e.createElementBlock("div",A1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(k.value),1)])):e.createCommentVNode("",!0)])]))}}),V1={class:"grid gap-3"},D1={key:0,class:"ml-1 text-destructive"},N1={class:"flex flex-col"},M1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},P1=["onClick"],T1=["id","name","value","checked","disabled","required","onChange"],v1={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},O1=["for"],F1={key:0,class:"ml-1 text-red-500"},z1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},_s=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}=Ke(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,y=>{s.value=y},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=e.computed(()=>a.disabled||l.value||!!c.value),u=async()=>{var x,E;const y=((x=a.endpoint)==null?void 0:x.apiUrl)||a.apiUrl;if(y){l.value=!0,c.value=null;try{const M={page:1,perPage:100},T=((E=a.endpoint)==null?void 0:E.apiMethod)||a.apiMethod,$=await o(y,T,M);let v=$;a.dataPath?v=a.dataPath.split(".").reduce((j,U)=>j&&j[U]!=="undefined"?j[U]:void 0,$):typeof $=="object"&&!Array.isArray($)&&$.data&&(v=$.data),Array.isArray(v)?i.value=v:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(M){console.error("DCodeRadioCustom fetch error:",M),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},f=e.ref(!1);let m=null;const h=()=>{typeof document<"u"&&(f.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var y;((y=a.endpoint)!=null&&y.apiUrl||a.apiUrl)&&u(),h(),typeof document<"u"&&(m=new MutationObserver(h),m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),m.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{m&&m.disconnect()});const k=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const y=a.itemValue||a.model||"id",x=a.itemTitle||(a.label===""?"name":a.label);return x&&a.label!==""?[{[y]:y,[x]:x}]:[]}),C=y=>{if(typeof y!="object")return y;const x=a.itemValue||a.model||"id";return y[x]},w=y=>{if(typeof y!="object")return String(y);const x=a.itemTitle||"name";return y[x]},p=Math.random().toString(36).slice(2,7),A=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${p}`),D=e.computed(()=>!!a.error||!!c.value),S=e.computed(()=>a.error||c.value),V=y=>{const x=s.value;return y==null?x===y:String(x)===String(y)},B=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]),g=y=>{const x=(y==null?void 0:y.icon)||a.icon;return bn(x,At)},b=(y,x)=>{x.target.checked&&(s.value=y,r("update:modelValue",y),r("change",y))},_=y=>{a.disabled||V(y)||(s.value=y,r("update:modelValue",y),r("change",y))};return(y,x)=>(e.openBlock(),e.createElementBlock("div",V1,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",D1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",N1,[l.value?(e.openBlock(),e.createElementBlock("div",M1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),x[0]||(x[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(k.value,(E,M)=>(e.openBlock(),e.createElementBlock("div",{key:M,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",V(C(E))?f.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":f.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",d.value?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:T=>!d.value&&_(C(E))},[e.createElementVNode("input",{id:t.id?`${t.id}-${M}`:`${A.value}-${M}`,name:A.value,type:"radio",value:C(E),checked:V(C(E)),disabled:d.value,required:t.required&&M===0,onChange:T=>b(C(E),T),class:"sr-only",tabindex:"-1"},null,40,T1),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",V(C(E))?f.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":f.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[g(E)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(E)),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",v1,[...x[1]||(x[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${M}`:`${A.value}-${M}`,class:e.normalizeClass([B.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",V(C(E))?f.value?"text-primary-400":"text-primary-700":f.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(w(E))+" ",1),t.required&&k.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",F1,"*")):e.createCommentVNode("",!0)],10,O1)],10,P1))),128))],2),D.value&&S.value?(e.openBlock(),e.createElementBlock("div",z1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(S.value),1)])):e.createCommentVNode("",!0)])]))}}),R1={key:0,class:"ml-1 text-destructive"},I1={class:"relative w-full"},L1={key:0,class:"mb-2 flex items-center justify-between"},$1={class:"text-sm text-muted-foreground"},j1={class:"text-sm font-medium text-foreground"},U1={class:"text-sm text-muted-foreground"},W1={class:"relative"},H1=["id","value","min","max","step","disabled","placeholder"],q1={key:1,class:"relative mt-2"},G1={class:"text-xs text-muted-foreground mt-1"},K1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},X1={name:"DCodeSlider"},Dr=e.defineComponent({...X1,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 V={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",V[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),m=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(" ")),h=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),k=e.computed(()=>{const V=a.max-a.min;return(a.modelValue-a.min)/V*100}),C=V=>{const B=V.target,g=parseFloat(B.value);r("update:modelValue",g),r("input",g)},w=V=>{const B=V.target,g=parseFloat(B.value);r("change",g)},p=()=>{i.value=!0},A=()=>{i.value=!1},D=V=>{const B=a.max-a.min;return(V-a.min)/B*100},S=e.computed(()=>{const V={sm:16,md:20,lg:24};return`
67
67
  input[type="range"]::-webkit-slider-thumb {
68
68
  ${m.value}
69
- width: ${B[a.size]}px;
70
- height: ${B[a.size]}px;
69
+ width: ${V[a.size]}px;
70
+ height: ${V[a.size]}px;
71
71
  }
72
72
 
73
73
  input[type="range"]::-moz-range-thumb {
74
74
  ${m.value}
75
- width: ${B[a.size]}px;
76
- height: ${B[a.size]}px;
75
+ width: ${V[a.size]}px;
76
+ height: ${V[a.size]}px;
77
77
  border-width: 2px;
78
78
  }
79
79
 
@@ -92,6 +92,6 @@
92
92
  input[type="range"]:focus::-moz-range-thumb {
93
93
  transform: scale(1.1);
94
94
  }
95
- `});return(B,w)=>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(er),{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",DC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",NC,[t.showValue?(e.openBlock(),e.createElementBlock("div",MC,[e.createElementVNode("span",TC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",PC,e.toDisplayString(h.value),1),e.createElementVNode("span",vC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",OC,[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:`${p.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:k,onChange:x,onMousedown:g,onMouseup:S,onTouchstart:g,onTouchend:S},null,42,FC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",zC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,y=>(e.openBlock(),e.createElementBlock("div",{key:y.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${E(y.value)}%`,transform:"translateX(-50%)"})},[w[0]||(w[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",RC,e.toDisplayString(y.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",IC,[w[1]||(w[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]])}}),$C={class:"grid gap-3"},jC={key:0,class:"ml-1 text-destructive"},UC={class:"inline-flex items-center gap-3"},WC=["id","name","aria-checked","aria-label","disabled"],HC={key:0,class:"absolute inset-0 flex items-center justify-center"},qC={class:"relative z-10 flex items-center gap-2"},GC=["id","name","aria-checked","aria-label","disabled"],XC={key:0,class:"absolute inset-0 flex items-center justify-center"},KC={name:"DCodeSwitch"},la=e.defineComponent({...KC,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,m)=>(e.openBlock(),e.createElementBlock("div",$C,[t.title?(e.openBlock(),e.createBlock(er,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",jC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",UC,[e.createVNode(e.unref(pl),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"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",HC,[...m[0]||(m[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,WC)]),_:1}),e.createVNode(e.unref(hl),{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",qC,[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",XC,[...m[1]||(m[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,GC))]),_:1})])]))}}),YC=["aria-busy"],JC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},QC=["for"],ZC={key:0,class:"ml-1 text-destructive"},eE={class:"relative w-full group"},tE=["id","value"],nE={key:0,class:"absolute top-1 right-2"},oE={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"},rE={key:1,class:"text-xs text-destructive"},po=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 J=o.required,F=o["aria-required"];return J===""||J===!0||J==="true"||(F==="true"||F===!0)}),u=e.computed(()=>{const{label:J,class:F,id:K,required:ae,"aria-required":_e,...Re}=o;return Re}),f=e.computed(()=>{const J=o.maxlength;let F=Number.NaN;return typeof J=="number"?F=J:typeof J=="string"&&(F=Number.parseInt(J,10)),Number.isFinite(F)&&F>0?F:-1}),m=J=>f.value>0?J.slice(0,f.value):J,h=e.computed(()=>{const J=a.modelValue;return J==null||String(J).length===0}),p=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!h.value:!0:!1),k=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,J=>{const F=String(J??"");F!==k.value&&(k.value=F)});const x=e.ref(!1),g=e.ref(!1),S=J=>J.split(/(\s+)/).map(F=>{if(F.trim()==="")return F;const K=F.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),E=J=>{const F=J.toLowerCase(),K=F.search(new RegExp("\\p{L}","u"));return K<0?F:F.slice(0,K)+F.charAt(K).toUpperCase()+F.slice(K+1)},C=J=>{switch(a.textCase){case"uppercase":return J.toUpperCase();case"lowercase":return J.toLowerCase();case"titlecase":return S(J);case"sentencecase":return E(J);case"none":default:return J}},B=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),w=J=>{if(!J)return null;const F=Array.isArray(J)?J.join(""):J;return F?new Set(F):null},y=e.computed(()=>w(a.allowChars)),b=(J,F)=>(J.lastIndex=0,J.test(F)),_=J=>{if(J===`
96
- `)return a.valueType!=="number";if(a.valueType==="free")return!0;const F=J===" ",K=/\d/.test(J),ae=new RegExp("\\p{L}","u").test(J),_e=new RegExp("\\p{N}","u").test(J);return a.valueType==="number"?K:a.valueType==="letter"?ae||a.allowSpaces&&F:a.valueType==="letternumber"?ae||_e||a.allowSpaces&&F:!0},V=J=>{let F="";for(const K of J){const ae=!!y.value&&y.value.has(K);a.pattern&&!ae&&!b(a.pattern,K)||!ae&&!_(K)||(F+=K)}return F},D=J=>{const F=V(J),K=a.applyTextCaseToValue?C(F):F;return m(K)};let N=null;const T=J=>{if(J==="")return null;if(a.valueType==="number"&&a.returnNumber){const F=J.replaceAll(`
97
- `,""),K=Number(F);return Number.isFinite(K)?K:null}return J},v=J=>{k.value=J,r("update:modelValue",T(J))},X=(J,F)=>{const K=m(F);g.value=!0,J.value=K,v(K),queueMicrotask(()=>g.value=!1)},O=(J,F)=>{const K=J.selectionStart??J.value.length,ae=J.selectionEnd??J.value.length;if(f.value>0){const _e=J.value.length-(ae-K),Re=f.value-_e;if(Re<=0)return;F=F.slice(0,Re)}J.setRangeText(F,K,ae,"end"),X(J,D(J.value))},H=J=>{var ae;if(!N||x.value||g.value||!((ae=J.inputType)!=null&&ae.startsWith("insert")))return;const F=J.data;if(F==null)return;const K=D(F);K!==F&&(J.preventDefault(),K.length>0&&O(N,K))},Y=J=>{var ae;if(!N||x.value||g.value)return;const F=((ae=J.clipboardData)==null?void 0:ae.getData("text"))??"",K=D(F);K!==F&&(J.preventDefault(),K.length>0&&O(N,K))},oe=async J=>{if(!N||x.value||g.value)return;const F=J.target,K=F.value??"",ae=D(K);if(ae===K){const _e=F.selectionStart??ae.length,Re=F.selectionEnd??ae.length;X(F,ae),await e.nextTick();try{F.setSelectionRange(_e,Re)}catch{}v(ae)}else{const _e=F.selectionStart??ae.length,Re=F.selectionEnd??ae.length;X(F,ae),await e.nextTick();try{F.setSelectionRange(_e,Re)}catch{}}},M=()=>x.value=!0,L=()=>{if(x.value=!1,!N)return;const J=N.value??"",F=D(J);F===J?v(F):X(N,F)};e.onMounted(()=>{if(N=document.getElementById(c.value),!N)return;N.addEventListener("beforeinput",H),N.addEventListener("paste",Y),N.addEventListener("input",oe),N.addEventListener("compositionstart",M),N.addEventListener("compositionend",L);const J=N.value??"",F=D(J);F===J?v(F):X(N,F)}),e.onBeforeUnmount(()=>{N&&(N.removeEventListener("beforeinput",H),N.removeEventListener("paste",Y),N.removeEventListener("input",oe),N.removeEventListener("compositionstart",M),N.removeEventListener("compositionend",L),N=null)});const ee=()=>{k.value="",N&&(N.value=""),r("update:modelValue",null),r("clear")},Q=e.computed(()=>k.value.length),W=e.computed(()=>a.showCharCount?f.value>0:!1),ie=e.computed(()=>W.value&&Q.value>0),de=e.computed(()=>`${Q.value} / ${f.value}`),Ce=e.computed(()=>!!a.error),Ne=e.computed(()=>{const J=o.rows,F=typeof J=="number"?J:Number.parseInt(String(J??""),10);return Number.isFinite(F)&&F>0?F:3}),be=e.computed(()=>({height:`${Ne.value*24+16}px`}));return(J,F)=>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",JC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(be.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",ZC,"*")):e.createCommentVNode("",!0)],8,QC)):e.createCommentVNode("",!0),e.createElementVNode("div",eE,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:k.value},u.value,{style:`text-transform: ${B.value}; padding-right: ${p.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-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",Ce.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,tE),p.value?(e.openBlock(),e.createElementBlock("div",nE,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ee}," ✕ ")])):e.createCommentVNode("",!0),ie.value&&!Ce.value?(e.openBlock(),e.createElementBlock("p",oE,e.toDisplayString(de.value),1)):e.createCommentVNode("",!0)]),Ce.value?(e.openBlock(),e.createElementBlock("p",rE,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,YC)),[[e.vShow,i.value]])}}),Kd=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(Be.AvatarRoot),{class:e.normalizeClass(e.unref(Oe)(e.unref(aE)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Yd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Jd=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(Be.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),aE=wr("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"}}}),ca=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=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.Separator),e.mergeProps(e.unref(o),{class:e.unref(Oe)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),sE={class:"bg-card text-card-foreground"},iE={class:"pb-6 px-3"},lE={key:0,class:"flex justify-center p-8"},cE={key:1,class:"p-8 text-center text-red-500"},dE={key:2,class:"relative"},uE={class:"space-y-6"},fE={class:"rounded-xl border bg-card text-card-foreground shadow"},mE={class:"p-4"},hE={class:"flex items-center justify-between gap-3"},pE={class:"font-medium"},gE={class:"text-xs text-muted-foreground"},bE={class:"mt-1 text-sm text-muted-foreground"},yE={class:"text-foreground"},xE={class:"text-foreground"},kE={class:"mt-1 text-xs text-muted-foreground"},wE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},CE={class:"flex items-center justify-between gap-3"},EE={class:"font-medium"},BE={class:"text-xs text-muted-foreground"},_E={class:"mt-2 text-sm text-muted-foreground"},SE={class:"flex flex-wrap items-center justify-between gap-3"},VE={class:"flex items-center gap-3"},AE={class:"leading-tight"},DE={class:"text-sm font-medium"},NE={class:"text-xs text-muted-foreground"},ME={class:"flex items-center gap-2"},TE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},PE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},vE=["src"],OE={class:"flex-1"},FE={class:"flex items-center justify-between gap-3"},zE={class:"font-medium"},RE={class:"text-xs text-muted-foreground"},IE={class:"mt-1 text-sm text-muted-foreground"},LE={class:"text-left sm:text-center"},$E={class:"text-xs text-muted-foreground"},jE={class:"text-left sm:text-center"},UE={class:"text-xs text-muted-foreground"},WE={class:"text-left sm:text-center"},HE={class:"text-xs text-muted-foreground"},qE={class:"flex items-center justify-between gap-3"},GE={class:"font-medium"},XE={class:"text-xs text-muted-foreground"},KE={class:"mt-2 text-sm text-muted-foreground"},YE={class:"mt-3 flex items-center gap-3"},JE={class:"text-sm font-medium"},QE={class:"flex items-start justify-between gap-3"},ZE={class:"font-medium"},eB={class:"mt-3 grid gap-2 text-sm"},tB={class:"flex items-center justify-between gap-3"},nB={class:"flex items-center gap-2 text-muted-foreground"},oB={class:"font-medium"},rB={class:"flex items-center justify-between gap-3"},aB={class:"flex items-center gap-2 text-muted-foreground"},sB={class:"font-medium"},iB={class:"flex items-center justify-between gap-3"},lB={class:"flex items-center gap-2 text-muted-foreground"},cB={class:"font-medium"},dB={class:"flex items-center justify-between"},uB={class:"flex items-center gap-2"},fB={class:"flex items-start justify-between gap-3"},mB={class:"flex items-center gap-2"},hB={class:"font-medium"},pB={class:"mt-2 text-sm text-muted-foreground"},gB={key:0,class:"mt-1 text-sm text-muted-foreground"},bB={class:"flex flex-wrap items-center justify-between gap-3"},yB={class:"flex items-center gap-2"},xB={class:"text-xs text-muted-foreground"},Qd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=st.useBreakpoints(st.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 m=await f.json();Array.isArray(m)?i.value=m:m.data&&Array.isArray(m.data)?i.value=m.data:m.items&&Array.isArray(m.items)?i.value=m.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(m=>{var h;return(h=m[0])==null?void 0:h.toUpperCase()}).join("");return(f,m)=>{const h=e.resolveComponent("ShoppingCart"),p=e.resolveComponent("DCodeBadge"),k=e.resolveComponent("RefreshCcw"),x=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",sE,[m[8]||(m[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",iE,[a.value?(e.openBlock(),e.createElementBlock("div",lE,[...m[0]||(m[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",cE,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",dE,[m[7]||(m[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",uE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(g,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,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(g.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(g.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",fE,[e.createElementVNode("div",mE,[g.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",hE,[e.createElementVNode("p",pE,e.toDisplayString(g.title),1),e.createElementVNode("p",gE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",bE,[e.createElementVNode("span",yE,e.toDisplayString(g.from),1),e.createVNode(e.unref(le.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",xE,e.toDisplayString(g.to),1)]),e.createElementVNode("p",kE,e.toDisplayString(g.time),1),g.fileName?(e.openBlock(),e.createElementBlock("div",wE,[e.createVNode(e.unref(le.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(g.fileName),1)])):e.createCommentVNode("",!0)],64)):g.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",CE,[e.createElementVNode("p",EE,e.toDisplayString(g.title),1),e.createElementVNode("p",BE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",_E,e.toDisplayString(g.desc),1),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",SE,[e.createElementVNode("div",VE,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[g.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:g.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",AE,[e.createElementVNode("p",DE,e.toDisplayString(g.personName),1),e.createElementVNode("p",NE,e.toDisplayString(g.personRole),1)])]),e.createElementVNode("div",ME,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="product"?(e.openBlock(),e.createElementBlock("div",TE,[e.createElementVNode("div",PE,[g.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:g.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,vE)):(e.openBlock(),e.createBlock(h,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",OE,[e.createElementVNode("div",FE,[e.createElementVNode("p",zE,e.toDisplayString(g.title),1),e.createElementVNode("p",RE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",IE,e.toDisplayString(g.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",LE,[m[1]||(m[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",$E,e.toDisplayString(g.customer),1)]),e.createElementVNode("div",jE,[m[2]||(m[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",UE,e.toDisplayString(g.price),1)]),e.createElementVNode("div",WE,[m[3]||(m[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",HE,e.toDisplayString(g.qty),1)])],2)])])):g.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",qE,[e.createElementVNode("p",GE,e.toDisplayString(g.title),1),e.createElementVNode("p",XE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",KE,e.toDisplayString(g.desc),1),e.createElementVNode("div",YE,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[g.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:g.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",JE,e.toDisplayString(g.personName),1)])],64)):g.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",QE,[e.createElementVNode("p",ZE,e.toDisplayString(g.title),1),e.createVNode(p,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[e.createElementVNode("div",nB,[e.createVNode(e.unref(le.Globe),{class:"h-4 w-4"}),m[4]||(m[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",oB,e.toDisplayString(g.ip),1)]),e.createElementVNode("div",rB,[e.createElementVNode("div",aB,[e.createVNode(e.unref(le.Cpu),{class:"h-4 w-4"}),m[5]||(m[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",sB,e.toDisplayString(g.cpu),1)]),e.createElementVNode("div",iB,[e.createElementVNode("div",lB,[e.createVNode(e.unref(le.CpuIcon),{class:"h-4 w-4"}),m[6]||(m[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",cB,e.toDisplayString(g.memory),1)])]),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(k,{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",fB,[e.createElementVNode("div",mB,[e.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",hB,e.toDisplayString(g.title),1)]),e.createVNode(p,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.chipText),1)]),_:2},1024)]),e.createElementVNode("p",pB,e.toDisplayString(g.desc1),1),g.desc2?(e.openBlock(),e.createElementBlock("p",gB,e.toDisplayString(g.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",bB,[e.createElementVNode("div",yB,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",xB,"Due date: "+e.toDisplayString(g.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),kB={class:"dcode-upload-file"},wB={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"},CB={key:0,class:"text-xs text-gray-500 mt-1"},EB=["accept"],BB={key:1,class:"text-xs text-red-600 mt-1"},Zd=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",kB,[t.label?(e.openBlock(),e.createBlock(ho,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",wB,[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",CB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,EB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",BB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),_B=["onClick"],SB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},VB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},AB={key:1},DB={key:0,class:"text-white"},NB={key:1},MB={key:2},TB=["disabled","onClick"],PB={key:1,class:"mr-2 text-sm font-bold opacity-70"},vB={class:"whitespace-normal text-sm text-center leading-tight"},OB={class:"flex flex-col flex-1 min-w-0"},FB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},zB={class:"text-sm text-muted-foreground"},RB={class:"px-1"},IB=["disabled"],LB=["type"],$B=["disabled"],Zs=Dt(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=ct(),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 y;if(typeof o.modelValue=="string"){const b=(y=o.tabs)==null?void 0:y.findIndex(_=>_.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(y){var b;if(i.value=y,typeof o.modelValue=="string"){const _=(b=o.tabs)==null?void 0:b[y];_?r("update:modelValue",_.key):r("update:modelValue",y)}else r("update:modelValue",y)}}),c=e.computed(()=>{var y;return((y=o.tabs)==null?void 0:y.length)??0}),d=e.computed(()=>{var y;return(y=o.tabs)==null?void 0:y[l.value]});function u(y){return c.value<=0?0:Math.min(Math.max(y,0),c.value-1)}function f(y){return y?typeof y=="string"?$t[y]||null:y:null}const m=e.reactive({});function h(y){return m[y.key]||(m[y.key]={loaded:!1,loading:!1,data:null,error:null}),m[y.key]}function p(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function k(y){const b=y.endpoint||{};return{apiModule:y.apiModule||b.apiModule,apiAction:y.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:y.apiParams}}function x(y){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[y];return!(!b||b.disabled)}async function g(y){if(typeof y.tab.fetchData=="function"){const v=await y.tab.fetchData(),X=(v==null?void 0:v.data)??v;return(X==null?void 0:X.data)??X}const b=k(y.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const V=p();let D;if(b.apiUrl)D=await s("","",V,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const v={...V,...b.apiParams};D=await s(b.apiModule,b.apiAction,v)}const N=(D==null?void 0:D.data)??D;return(N==null?void 0:N.data)??N}async function S(y,{force:b=!1}={}){const _=u(y),V=o.tabs[_];if(!V)return;const D=h(V);if(!(o.cache&&D.loaded&&!b)&&!D.loading){D.loading=!0,D.error=null;try{const N=await g({tabIndex:_,tab:V});D.data=N,D.loaded=!0,r("loaded",{tabIndex:_,tab:V,data:N})}catch(N){const T=typeof(N==null?void 0:N.message)=="string"&&N.message||typeof N=="string"&&N||"Failed to load tab data.";D.error=T,r("error",{tabIndex:_,tab:V,message:T})}finally{D.loading=!1}}}function E(y){const b=u(y);x(b)&&b!==l.value&&(l.value=b)}function C(y=l.value){return S(y,{force:!0})}function B(){const y=u(l.value-1);y!==l.value&&(l.value=y)}function w(){const y=u(l.value+1);y!==l.value&&(l.value=y)}return e.watch(()=>o.tabs,y=>{for(const b of y??[])h(b)},{immediate:!0}),e.watch(()=>l.value,async y=>{var _;const b=(_=o.tabs)==null?void 0:_[y];b&&r("change",{tabIndex:y,tab:b}),await S(y)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async y=>{y&&await S(l.value)},{immediate:!0}),(y,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,(_,V)=>(e.openBlock(),e.createElementBlock("div",{key:_.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"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!_.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",AB,[V<l.value?(e.openBlock(),e.createElementBlock("span",DB,"✓")):(e.openBlock(),e.createElementBlock("span",NB,e.toDisplayString(V+1),1))])):(e.openBlock(),e.createElementBlock("span",MB))],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(_.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(_,V)=>(e.openBlock(),e.createElementBlock("div",{key:_.key,onClick:D=>E(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"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",SB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",VB,e.toDisplayString(_.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"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,_B))),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,(_,V)=>(e.openBlock(),e.createElementBlock("button",{key:_.key,type:"button",disabled:!x(V),onClick:D=>E(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(Oe)("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"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",PB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",vB,e.toDisplayString(_.title),1)],10,TB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ca),{key:0})),e.createElementVNode("div",OB,[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 _,V,D,N;return[(e.openBlock(),e.createElementBlock("div",{key:((_=d.value)==null?void 0:_.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(V=m[d.value.key])!=null&&V.loading?e.renderSlot(y.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",FB,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(y.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=m[d.value.key])==null?void 0:D.data,loaded:(N=m[d.value.key])==null?void 0:N.loaded,reload:C},()=>[e.createElementVNode("div",zB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",RB,"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:B,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,IB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:w,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,LB)):(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,$B))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),jB={class:"permission-menu w-full space-y-4"},UB={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"},WB={class:"flex items-center justify-between"},HB={class:"flex items-center gap-3 flex-1"},qB=["onClick"],GB={key:1,class:"w-7"},XB={key:2,class:"flex-shrink-0"},KB={class:"text-lg font-semibold flex-1"},YB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},JB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},QB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},ZB=["checked","disabled","onChange"],e2={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},t2={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},n2={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},o2={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"},r2={class:"flex items-center justify-between"},a2={class:"flex items-center gap-3 flex-1"},s2={key:0,class:"flex-shrink-0"},i2={class:"text-base font-semibold flex-1"},l2={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},c2={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},d2=["checked","onChange"],u2={class:"text-xs font-medium"},f2={key:0,class:"p-3"},m2={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},h2=["checked","disabled","onChange"],p2={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},ei=Dt(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}=Ot.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)=>{(N=>{N.forEach(T=>{T.permission.forEach(v=>{const X=`${T.id}-${v.id}-parent`,O=v.code==="VIEW"||v.name.toUpperCase()==="VIEW";l.value.has(X)||l.value.set(X,O||(V?T.checked??!1:!1))}),T.detail&&T.detail.length>0&&T.detail.forEach(v=>{v.permission.forEach(X=>{const O=`${v.id}-${X.id}-child`,H=X.code==="VIEW"||X.name.toUpperCase()==="VIEW";l.value.has(O)||l.value.set(O,H||(V?v.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 D=V.menuId,N=V.actionsIds;i.value.forEach(T=>{T.id===D&&N.forEach(v=>{const X=`${D}-${v}-parent`;l.value.set(X,!0)}),T.detail&&T.detail.length>0&&T.detail.forEach(v=>{v.id===D&&N.forEach(X=>{const O=`${D}-${X}-child`;l.value.set(O,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(V,D)=>{D===0&&V>0&&u()});const f=V=>V.detail&&V.detail.length>0,m=V=>{c.value.has(V)?c.value.delete(V):c.value.add(V)},h=V=>c.value.has(V),p=(V,D,N=!1)=>{const T=`${V}-${D}-${N?"child":"parent"}`;return l.value.get(T)??!1},k=()=>{const V=w();s("update:modelValue",V.permissions)},x=(V,D,N,T=!1)=>{const v=N.target.checked,X=`${V}-${D}-${T?"child":"parent"}`;l.value.set(X,v),s("permission-change",V,D,v,!T),k()},g=V=>V.permission.filter(S),S=V=>V.code==="VIEW"||V.name.toUpperCase()==="VIEW",E=(V,D,N)=>{const T=N.target.checked;D.permission.forEach(v=>{if(S(v)){const O=`${D.id}-${v.id}-child`;l.value.set(O,!0);return}const X=`${D.id}-${v.id}-child`;l.value.set(X,T)}),l.value=new Map(l.value),s("menu-check",D.id,T),k()},C=(V,D=!1)=>{const N=D?V.permission:g(V);return!N||N.length===0?!1:N.every(T=>{const v=`${V.id}-${T.id}-${D?"child":"parent"}`;return l.value.get(v)??!1})},B=()=>{const V={};return i.value.forEach(D=>{var N;V[D.id]={name:D.name,parentPermissions:D.permission.map(T=>({id:T.id,name:T.name,checked:p(D.id,T.id,!1)})),children:((N=D.detail)==null?void 0:N.map(T=>({id:T.id,name:T.name,permissions:T.permission.map(v=>({id:v.id,name:v.name,checked:p(T.id,v.id,!0)}))})))||[]}}),V},w=()=>{const V=[],D=(N,T=!1)=>{const v=[];N.permission.forEach(X=>{const O=`${N.id}-${X.id}-${T?"child":"parent"}`;(l.value.get(O)??!1)&&v.push(X.id)}),v.length>0&&V.push({menuId:N.id,actionsIds:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{D(T,!0)})}),{permissions:V}};return n({getCurrentStates:B,getPermissionsForDatabase:w,getAllPermissionsWithStatus:()=>{const V=[],D=(N,T=!1)=>{const v=N.permission.map(O=>{const H=`${N.id}-${O.id}-${T?"child":"parent"}`,Y=l.value.get(H)??!1;return{id:O.id,name:O.name,checked:Y}}),X=v.filter(O=>O.checked).map(O=>O.id);V.push({menuId:N.id,menuName:N.name,actionsIds:X,actions:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{D(T,!0)})}),{permissions:V}},permissionStates:l,expandAll:()=>{i.value.forEach(V=>{f(V)&&c.value.add(V.id)})},collapseAll:()=>{c.value.clear()}}),(V,D)=>(e.openBlock(),e.createElementBlock("div",jB,[(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",UB,[e.createElementVNode("div",WB,[e.createElementVNode("div",HB,[f(N)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:T=>m(N.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[h(N.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,qB)):(e.openBlock(),e.createElementBlock("div",GB)),t.showIcons&&N.icon?(e.openBlock(),e.createElementBlock("span",XB,[e.createElementVNode("i",{class:e.normalizeClass([N.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",KB,e.toDisplayString(N.name),1)])])]),N.permission&&N.permission.length>0&&!f(N)?(e.openBlock(),e.createElementBlock("div",YB,[e.createElementVNode("h4",JB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",QB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g(N),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:S(T)||p(N.id,T.id,!1),disabled:S(T),onChange:v=>x(N.id,T.id,v,!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",S(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,ZB),e.createElementVNode("span",e2,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(N)&&h(N.id)?(e.openBlock(),e.createElementBlock("div",t2,[e.createElementVNode("h4",n2,[D[0]||(D[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,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",o2,[e.createElementVNode("div",r2,[e.createElementVNode("div",a2,[t.showIcons&&T.icon?(e.openBlock(),e.createElementBlock("span",s2,[e.createElementVNode("i",{class:e.normalizeClass([T.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",i2,e.toDisplayString(T.name),1),T.path?(e.openBlock(),e.createElementBlock("span",l2,e.toDisplayString(T.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",c2,[e.createElementVNode("input",{type:"checkbox",checked:C(T,!0),onChange:v=>E(N,T,v),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,d2),e.createElementVNode("span",u2,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),T.permission&&T.permission.length>0?(e.openBlock(),e.createElementBlock("div",f2,[e.createElementVNode("div",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.permission,v=>(e.openBlock(),e.createElementBlock("label",{key:v.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:S(v)||p(T.id,v.id,!0),disabled:S(v),onChange:X=>x(T.id,v.id,X,!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",S(v)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,h2),e.createElementVNode("span",p2,e.toDisplayString(v.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),g2={class:"space-y-4"},b2={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},y2={key:0,class:"text-danger-500"},x2={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},k2={class:"text-neutral-600 dark:text-neutral-400"},w2={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},C2={class:"text-neutral-500 dark:text-neutral-400"},E2={key:3,class:"space-y-3"},B2={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},_2={class:"flex items-center gap-3"},S2={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},V2={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},A2={class:"flex items-center gap-2 text-sm font-medium"},D2={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},N2={class:"p-4"},M2={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},T2={class:"ml-2 flex-1 min-w-0"},P2=["for"],v2={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},O2={key:4,class:"mt-1 text-xs text-danger-600"},ti=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}=Ot.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=g=>{if(console.log(g),!g)return[];if(Array.isArray(g)&&g.length>0&&g[0].module&&Array.isArray(g[0].permissions))return g.map(S=>({menuId:S.menuId,module:S.module,label:S.label||S.module,permissions:S.permissions}));if(Array.isArray(g)&&g.length>0&&g[0].key){const S={};return g.forEach(E=>{const C=E.key,B=C&&C.includes(".")?C.split(".")[0]:"other";S[B]||(S[B]={menuId:0,module:B,label:B,permissions:[]}),S[B].permissions.push({id:E.id,key:E.key,label:E.label,description:E.description})}),Object.values(S)}if(Array.isArray(g)&&g.length>0&&g[0].id&&g[0].name&&Array.isArray(g[0].permission)){const S=[],E=(C,B="")=>{const w=B?`${B}.${C.name}`:C.name,y=w.toLowerCase().replace(/\s+/g,"_"),b=[];if(C.detail&&Array.isArray(C.detail)&&C.detail.forEach(_=>{b.push(_.id)}),C.permission&&C.permission.length>0){const _=C.permission.map(V=>({id:V.id,key:`${y}.${V.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${V.name} ${C.name}`,description:`Permission to ${V.name.toLowerCase()} ${C.name.toLowerCase()}`}));S.push({menuId:C.id,module:y,label:C.name,permissions:_,subMenuIds:b.length>0?b:void 0})}C.detail&&Array.isArray(C.detail)&&C.detail.forEach(_=>{E(_,w)})};return g.forEach(C=>E(C)),S}return g.data?u(g.data):[]},f=async()=>{s.value=!0;try{let g;o.treeData&&o.treeData.length>0?g=o.treeData:g=[];const S=u(g);i.value=S;const E={},C=[],B={};S.forEach(y=>{y.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;B[_]=y.menuId})});const w=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(y=>{C.push(y.menuId),y.actionsIds&&Array.isArray(y.actionsIds)&&y.actionsIds.forEach(b=>w.add(b))}),S.forEach(y=>y.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;E[_]=w.has(_)})),l.value=E,c.value=C,d.value=B}catch{i.value=[]}finally{s.value=!1}},m=g=>g.permissions.filter(S=>{const E=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[E]}).length,h=g=>g.permissions.every(S=>{const E=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[E]}),p=g=>{const S=m(g);return S>0&&S<g.permissions.length},k=e.ref(!1),x=(g,S)=>{k.value=!0,g.permissions.map(B=>typeof B.id=="string"?parseInt(B.id):B.id),g.permissions.forEach(B=>{const w=typeof B.id=="string"?parseInt(B.id):B.id;l.value[w]=S});let E=o.modelValue?[...o.modelValue]:[],C=[g.menuId];g.subMenuIds&&g.subMenuIds.length>0&&(C=[...C,...g.subMenuIds],g.subMenuIds.forEach(B=>{const w=i.value.find(y=>y.menuId===B);w&&w.permissions.forEach(y=>{const b=typeof y.id=="string"?parseInt(y.id):y.id;l.value[b]=S})})),S?C.forEach(B=>{const w=i.value.find(y=>y.menuId===B);if(w){const y=w.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),b=E.findIndex(_=>_.menuId===B);b!==-1?E[b]={menuId:B,actionsIds:y}:E.push({menuId:B,actionsIds:y})}}):E=E.filter(B=>!C.includes(B.menuId)),c.value=E.map(B=>B.menuId),console.log("Full Result:",JSON.stringify(E,null,2)),r("update:modelValue",E),setTimeout(()=>{k.value=!1},100)};return e.watch(()=>o.modelValue,g=>{if(!g)return;const S=new Set,E=[];g.forEach(C=>{E.push(C.menuId),C.actionsIds&&Array.isArray(C.actionsIds)&&C.actionsIds.forEach(B=>S.add(B))}),Object.keys(l.value).forEach(C=>{const B=parseInt(C);l.value[B]=S.has(B)}),c.value=E}),e.watch(()=>o.treeData,g=>{g&&g.length>0&&f()},{deep:!0}),e.watch(l,(g,S)=>{if(k.value)return;if(Object.keys(g).map(C=>parseInt(C)).filter(C=>g[C]!==(S==null?void 0:S[C])).length>0){let C=o.modelValue?[...o.modelValue]:[];const B={};Object.keys(g).forEach(w=>{const y=parseInt(w);if(g[y]){const b=d.value[y];console.log(`Permission ${y} belongs to Menu ${b}`),b!==void 0&&(B[b]||(B[b]=[]),B[b].push(y))}}),Object.keys(B).forEach(w=>{const y=parseInt(w),b=B[y],_=C.findIndex(V=>V.menuId===y);_!==-1?C[_]={menuId:y,actionsIds:b}:C.push({menuId:y,actionsIds:b})}),C=C.filter(w=>B[w.menuId]&&B[w.menuId].length>0),c.value=C.map(w=>w.menuId),console.log("Result:",JSON.stringify(C,null,2)),r("update:modelValue",C)}},{deep:!0}),e.onMounted(f),(g,S)=>(e.openBlock(),e.createElementBlock("div",g2,[t.label?(e.openBlock(),e.createElementBlock("label",b2,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",y2,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",x2,[e.createVNode(e.unref(le.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",k2,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",w2,[e.createElementVNode("p",C2,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",E2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.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",B2,[e.createElementVNode("div",_2,[e.createVNode(pn,{modelValue:h(E),indeterminate:p(E),"onUpdate:modelValue":C=>x(E,!!C),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",S2,e.toDisplayString(E.label||E.module),1),e.createElementVNode("div",V2,e.toDisplayString(m(E))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(E.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",A2,[e.createElementVNode("div",D2,e.toDisplayString(m(E))+"/"+e.toDisplayString(E.permissions.length),1)])]),e.createElementVNode("div",N2,[e.createElementVNode("div",M2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.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(pn,{modelValue:l.value[typeof C.id=="string"?parseInt(C.id):C.id],"onUpdate:modelValue":B=>l.value[typeof C.id=="string"?parseInt(C.id):C.id]=B,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",T2,[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,P2),C.description?(e.openBlock(),e.createElementBlock("p",v2,e.toDisplayString(C.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",O2,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),F2=(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)},z2=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)}}),R2=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):z2(t),I2={key:0,class:"fixed inset-0 z-[100] flex justify-end"},L2={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"},$2={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},j2={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},U2={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},W2={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},H2={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},q2=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(Ke,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",I2,[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",L2,[e.createElementVNode("div",$2,[e.createElementVNode("div",null,[e.createElementVNode("h3",j2,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",U2,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Ke,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",W2,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",H2,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),G2={key:0},X2=["value","name"],eu=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=Ot.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:no,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:po,DCodeTextArea:po,DCodeCheckbox:pn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia},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(m=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(m)&&!f.hasOwnProperty(m)&&(f[m]=u[m])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,X2)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),K2=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=st.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(Oe)("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)]])}}),Y2=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=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.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"]))}}),J2=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(Oe)("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"]))}}),Q2=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(Oe)("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"]))}}),Z2=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=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(Oe)(e.unref(to)({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"]))}}),e_=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=st.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(Oe)(e.unref(to)({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"]))}}),t_=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=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(Oe)(e.unref(to)({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"]))}}),n_=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=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(Oe)(e.unref(to)({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"]))}}),o_=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=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(Oe)(e.unref(to)({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"]))}}),r_=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=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),a_=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=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Oe)("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(c_)),e.createVNode(e.unref(Be.SelectViewport),{class:e.normalizeClass(e.unref(Oe)("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(l_))]),_:3},16,["class"])]),_:3}))}}),s_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},i_=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=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(Oe)("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",s_,[e.createVNode(e.unref(Be.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(le.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(Be.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),l_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(Oe)("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"]))}}),c_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(Oe)("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"]))}}),d_=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=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(Oe)("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(Be.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"]))}}),u_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),nr={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},go={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},Et={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},f_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},m_={dangerouslyHTMLString:!1,multiple:!0,position:nr.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},h_={rtl:!1,newestOnTop:!1,toastClassName:""},tu={...m_,...h_};Et.DEFAULT;var Le=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Le||{}),ni=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(ni||{});const p_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},g_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},b_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},y_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},nu="Toastify--animate Toastify__none-enter";function ou(t,n=!1){var o;let r=p_;if(!t||typeof t=="string")switch(t){case"flip":r=y_;break;case"zoom":r=b_;break;case"slide":r=g_;break}else r=t;if(n)r.enter=nu;else if(r.enter===nu){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function x_(t){return t.containerId||String(t.position)}const da="will-unmount";function k_(t=nr.TOP_RIGHT){return!!document.querySelector(`.${Le.CSS_NAMESPACE}__toast-container--${t}`)}function w_(t=nr.TOP_RIGHT){return`${Le.CSS_NAMESPACE}__toast-container--${t}`}function C_(t,n,o=!1){const r=[`${Le.CSS_NAMESPACE}__toast-container`,`${Le.CSS_NAMESPACE}__toast-container--${t}`,o?`${Le.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return yo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function E_(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Le.CSS_NAMESPACE,l=w_(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(da)),f=c||document.createElement("div"),m=document.createElement("div");m.className=C_(o,r,a),m.dataset.testid=`${Le.CSS_NAMESPACE}__toast-container--${o}`,m.id=x_(t);for(const h in s)if(Object.prototype.hasOwnProperty.call(s,h)){const p=s[h];m.style[h]=p}return c||(f.className=Le.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(m),m}function oi(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",oi,!1);try{or[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete or[a],delete ht[a]}catch{}}const or=e.reactive({});function B_(t,n){const o=document.getElementById(String(n));o&&(or[o.id]=t)}function ri(t,n=!0){const o=String(t);if(!or[o])return;const r=document.getElementById(o);r&&r.classList.add(da),n?(S_(t),r&&r.addEventListener("animationend",oi,!1)):oi(o),It.items=It.items.filter(a=>a.containerId!==t)}function __(t){for(const n in or)ri(n,t);It.items=[]}function ru(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...ou(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function S_(t){for(const n in ht)if(n===t)for(const o of ht[n]||[])ru(o)}function V_(t){const n=bo().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function ai(t){return document.getElementById(t)}function A_(t){const n=ai(t.containerId);return n&&n.classList.contains(da)}function au(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 D_(t){return t?It.items.filter(n=>n.containerId===t).length>0:It.items.length>0}function N_(){if(It.items.length>0){const t=It.items.shift();ua(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const ht=e.reactive({}),It=e.reactive({items:[]});function bo(){const t=e.toRaw(ht);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function M_(t){return bo().find(n=>n.toastId===t)}function ua(t,n={}){if(A_(n)){const o=ai(n.containerId);o&&o.addEventListener("animationend",si.bind(null,t,n),!1)}else si(t,n)}function si(t,n={}){const o=ai(n.containerId);o&&o.removeEventListener("animationend",si.bind(null,t,n),!1);const r=ht[n.containerId]||[],a=r.length>0;if(!a&&!k_(n.position)){const s=E_(n),i=e.createApp(tS,n);n.useHandler&&n.useHandler(i),i.mount(s),B_(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?Mt.update(n):Mt.add(t,n)})}const Mt={add(t,n){const{containerId:o=""}=n;o&&(ht[o]=ht[o]||[],ht[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=ht[o])==null||r.unshift(n):(a=ht[o])==null||a.push(n),n.onOpen&&n.onOpen(au(n))},n.delay||0))},remove(t){if(t){const n=V_(t);if(n){const o=ht[n];let r=o.find(a=>a.toastId===t);ht[n]=o.filter(a=>a.toastId!==t),!ht[n].length&&!D_(n)&&ri(n,!1),N_(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(au(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){ht[n]=ht[n]||[];const o=ht[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};Mt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{We(a.content,a)},t.delay||0)}},clear(t,n=!0){t?ri(t,n):__(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",Mt.dismissCallback,!1),setTimeout(()=>{Mt.remove(o)}))},dismiss(t){if(t){const n=bo();for(const o of n)if(o.toastId===t){ru(o,r=>{r.addEventListener("animationend",Mt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=bo();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",Mt.dismissCallback,!1),Mt.remove(t));break}}}},T_=e.reactive({useHandler:void 0}),su=e.reactive({}),fa=e.reactive({});function iu(){return Math.random().toString(36).substring(2,9)}function P_(t){return typeof t=="number"&&!isNaN(t)}function ii(t){return typeof t=="string"}function yo(t){return typeof t=="function"}function ma(...t){return e.mergeProps(...t)}function ha(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function v_(t={}){su[`${Le.CSS_NAMESPACE}-default-options`]=t}function lu(){return su[`${Le.CSS_NAMESPACE}-default-options`]||tu}function O_(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var pa=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(pa||{});const cu={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:nr.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:go.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:Et.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}},F_={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:Et.DEFAULT},theme:{type:String,required:!1,default:go.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}},z_=e.defineComponent({name:"ProgressBar",props:F_,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(()=>[`${Le.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Le.CSS_NAMESPACE}__progress-bar--controlled`:`${Le.CSS_NAMESPACE}__progress-bar--animated`,`${Le.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Le.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Le.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)}}),R_=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:go.AUTO},type:{type:String,required:!1,default:go.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Le.CSS_NAMESPACE}__close-button ${Le.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)])])}}),ga=({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 I_(t){return e.createVNode(ga,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 L_(t){return e.createVNode(ga,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 $_(t){return e.createVNode(ga,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 j_(t){return e.createVNode(ga,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 U_(){return e.createVNode("div",{class:`${Le.CSS_NAMESPACE}__spinner`},null)}const ba={info:L_,warning:I_,success:$_,error:j_,spinner:U_},W_=t=>t in ba;function H_({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 ba.spinner();if(r!==!1){if(ha(r))a=e.toRaw(r);else if(yo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?ba.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):ii(r)||P_(r)?a=r:W_(n)&&(a=ba[n](i));return a}}const q_=()=>{};function G_(t,n,o=Le.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 X_(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(pa.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Le.COLLAPSE_DURATION}),i=s.done||q_,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:k}:{});function u(){const S=l.value.split(" ");m().addEventListener(ni.ENTRANCE_ANIMATION_END,k,{once:!0});const E=B=>{const w=m();B.target===w&&(w.dispatchEvent(new Event(ni.ENTRANCE_ANIMATION_END)),w.removeEventListener("animationend",E),w.removeEventListener("animationcancel",E),a.value===pa.Enter&&B.type!=="animationcancel"&&w.classList.remove(...S))},C=()=>{const B=m();B.classList.add(...S),B.addEventListener("animationend",E),B.addEventListener("animationcancel",E)};t.pauseOnFocusLoss&&h(),C()}function f(){if(!m())return;const S=()=>{const C=m();C.removeEventListener("animationend",S),s.collapse?G_(C,i,s.collapseDuration):i()},E=()=>{const C=m();a.value=pa.Exit,C&&(C.className+=` ${c.value}`,C.addEventListener("animationend",S))};o.value||(r.value?S():setTimeout(E))}function m(){return t.toastRef.value}function h(){document.hasFocus()||x(),window.addEventListener("focus",k),window.addEventListener("blur",x)}function p(){window.removeEventListener("focus",k),window.removeEventListener("blur",x)}function k(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function x(){n.value=!1}function g(S){S&&(S.stopPropagation(),S.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const S=bo();o.value=S.findIndex(E=>E.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?x():k())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:n,hideToast:g,eventHandlers:d}}function K_(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 Y_=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:cu,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>H_(t)),s=e.computed(()=>[`${Le.CSS_NAMESPACE}__toast`,`${Le.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Le.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Le.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=X_({toastRef:n,loading:o,done:()=>{Mt.remove(t.toastId)},...ou(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(K_(f)){const m=[];return f.title!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Le.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Le.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Le.CSS_NAMESPACE}__toast-text`},[m])}return ha(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):yo(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:`${Le.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Le.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Le.CSS_NAMESPACE}--animate-icon ${Le.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ha(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):yo(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(R_,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),ha(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):yo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(z_,{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)])}}),ya="vue3-toastify:url-change";let xa=0,rr;function J_(){if(!(typeof window>"u")&&fa.lastUrl!==window.location.href){fa.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:lu().clearOnUrlChange!==!1,n=Object.values(ht).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&Mt.dismiss(o.toastId);It.items=It.items.filter(o=>!t(o.toastProps))}}function Q_(){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(ya)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ya)),a},()=>{t.pushState=n,t.replaceState=o}}function Z_(){if(typeof window>"u"||rr)return;const t=Q_(),n=()=>J_();window.addEventListener(ya,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),rr=()=>{t(),window.removeEventListener(ya,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),rr=void 0}}function eS(){rr&&(rr(),fa.lastUrl="")}const tS=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:cu,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>ht[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(xa+=1,Z_())}),e.onUnmounted(()=>{typeof window<"u"&&xa>0&&(xa-=1,xa===0&&eS())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(Y_,e.mergeProps({key:s},a),null)})])}});let li=!1;const du={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function uu(){const t=[];return bo().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(da)&&t.push(n)}),t}function nS(t){const n=uu().length,o=t??0;return o>0&&n+It.items.length>=o}function oS(t){nS(t.limit)&&!t.updateId&&It.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function Tn(t,n,o={}){if(li)return;o=ma(lu(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=iu()),o={...o,...o.type==="loading"?du:{},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=O_()),oS(o),fa.lastUrl=window.location.href,o.multiple?It.items.length?o.updateId&&ua(t,o):ua(t,o):(li=!0,We.clearAll(void 0,!1),setTimeout(()=>{ua(t,o)},0),setTimeout(()=>{li=!1},390)),o.toastId}const We=(t,n)=>Tn(t,Et.DEFAULT,n);We.info=(t,n)=>Tn(t,Et.DEFAULT,{...n,type:Et.INFO}),We.error=(t,n)=>Tn(t,Et.DEFAULT,{...n,type:Et.ERROR}),We.warning=(t,n)=>Tn(t,Et.DEFAULT,{...n,type:Et.WARNING}),We.warn=We.warning,We.success=(t,n)=>Tn(t,Et.DEFAULT,{...n,type:Et.SUCCESS}),We.loading=(t,n)=>Tn(t,Et.DEFAULT,ma(n,du)),We.dark=(t,n)=>Tn(t,Et.DEFAULT,ma(n,{theme:go.DARK})),We.remove=t=>{t?Mt.dismiss(t):Mt.clear()},We.clearAll=(t,n)=>{e.nextTick(()=>{Mt.clear(t,n)})},We.isActive=t=>{let n=!1;return n=uu().findIndex(o=>o.toastId===t)>-1,n},We.update=(t,n={})=>{setTimeout(()=>{const o=M_(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:iu()},i=s.render||a;delete s.render,Tn(i,s.type,s)}},0)},We.done=t=>{We.update(t,{isLoading:!1,progress:1})},We.promise=rS;function rS(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=ii(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=(h,p,k)=>{if(p==null){We.remove(c);return}const x={type:h,...u,...a,data:k},g=ii(p)?{render:p}:p;return c?We.update(c,{...x,...g,isLoading:!1}):We(g.render,{...x,...g,isLoading:!1}),k},m=yo(t)?t():t;return m.then(h=>{f("success",r,h)}).catch(h=>{f("error",o,h)}),m}We.POSITION=nr,We.THEME=go,We.TYPE=Et,We.TRANSITIONS=f_;const aS={install(t,n={}){T_.useHandler=n.useHandler||(()=>{}),sS(n)}};typeof window<"u"&&(window.Vue3Toastify=aS);function sS(t={}){const n=ma(tu,t);v_(n)}const iS={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:[]},lS={key:0,class:"inline-block"},ci=Dt(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?$t[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 Oe(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>Oe("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,m)=>r.value?(e.openBlock(),e.createElementBlock("div",lS,[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 ka={exports:{}},cS=ka.exports,fu;function dS(){return fu||(fu=1,(function(t,n){(function(o,r){t.exports=r()})(cS,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,m,h;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 m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.filter(function(x){return r.truthy(r.apply(f,x))}):[];if(l==="map")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.map(function(x){return r.apply(f,x)}):[];if(l==="reduce")return m=r.apply(c[0],i),f=c[1],h=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(m)?m.reduce(function(x,g){return r.apply(f,{current:g,accumulator:x})},h):h;if(l==="all"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="none"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="some"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[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 p=String(l).split("."),k=a;for(d=0;d<p.length;d++){if(!k.hasOwnProperty(p[d]))throw new Error("Unrecognized operation "+l+" (failed at "+p.slice(0,d+1).join(".")+")");k=k[p[d]]}return k.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})})(ka)),ka.exports}var uS=dS();const tn=sl(uS),fS={class:"dcode-card animate-slide-up"},mS={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"},hS={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},pS={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]"},gS={class:"relative w-full sm:w-64"},bS={key:0,class:"relative"},yS={class:"flex flex-col h-full"},xS={key:0,class:"flex-1 overflow-y-auto py-4"},kS={class:"grid grid-cols-1 gap-4 px-1"},wS={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"},CS={class:"flex justify-end gap-2 w-full"},ES={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},BS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},_S={class:"dcode-table w-full"},SS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},VS=["onClick"],AS={key:0,class:"flex items-center justify-center w-full"},DS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},NS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},MS={key:0,class:"px-3 py-0.5"},TS={key:1},PS=["colspan"],vS={class:"flex flex-col items-center gap-2"},OS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},FS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},zS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},RS={key:0,class:"flex items-center justify-center"},IS={key:0,class:"px-3 py-0.5 !text-center"},LS={key:0,class:"flex items-center justify-center gap-1.5"},$S={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},jS=["colspan"],US={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"},WS={class:"flex items-center gap-4"},HS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},qS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},GS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},XS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},KS={class:"flex-shrink-0"},YS={class:"space-y-4"},JS={class:"text-gray-600 dark:text-gray-400"},QS={class:"grid grid-cols-1 gap-4 py-4 px-1"},ZS={key:0,class:"mb-2 p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-900/30 rounded-lg flex items-center gap-3"},eV={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},tV={class:"flex flex-col gap-0.5"},nV={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},oV={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},rV={class:"flex items-end gap-2"},xo=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},baseUrl:{default:void 0}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var tt,bt,Ct,bn,_o,Pn;tn.add_operation("length",A=>A==null?0:typeof A=="string"||Array.isArray(A)?A.length:typeof A=="number"?String(A).length:typeof A=="object"?Object.keys(A).length:0),tn.add_operation("==",(A,z)=>A!==null&&typeof A=="object"&&"_isLogicValue"in A?A.id==z||A.code==z:z!==null&&typeof z=="object"&&"_isLogicValue"in z?z.id==A||z.code==A:A==z),tn.add_operation("!=",(A,z)=>A!==null&&typeof A=="object"&&"_isLogicValue"in A?!(A.id==z||A.code==z):z!==null&&typeof z=="object"&&"_isLogicValue"in z?!(z.id==A||z.code==A):A!=z);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=ct(),{locale:l}=Ot.useI18n();let c={query:{},params:{},path:""};try{const A=vn.useRoute();A?c=A:(Ct=(bt=(tt=s==null?void 0:s.appContext)==null?void 0:tt.config)==null?void 0:bt.globalProperties)!=null&&Ct.$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:A=>{console.warn("Router push() logic called from fallback:",A),typeof A=="string"&&A.startsWith("/")&&(window.location.href=A)}};try{const A=vn.useRouter();A?d=A:(Pn=(_o=(bn=s==null?void 0:s.appContext)==null?void 0:bn.config)==null?void 0:_o.globalProperties)!=null&&Pn.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),m=e.ref(r.perPage),h=e.ref({key:"",direction:"asc"}),p=e.ref([]),k=e.ref(!1),x=e.ref(0),g=e.ref({}),S=e.ref([]),E=e.ref(null),C=e.ref(!0),B=e.ref([]),w=e.ref([]),y=e.ref([]),b=e.ref(!1),_=e.ref(!1),V=e.ref({}),D=e.ref(null),N=e.ref(null),T=e.ref(null),v=e.ref([]),X=e.computed(()=>{if(G.value.length===0)return!1;const A=G.value.map(z=>{const Z=J.value.find(U=>U.type==="CHECKBOX"),R=(Z==null?void 0:Z.keyCheckbox)||"id";return z[R]}).filter(z=>z!=null);return A.length===0?!1:A.every(z=>v.value.includes(z))}),O=e.computed(()=>{if(G.value.length===0)return!1;const A=J.value.find(U=>U.type==="CHECKBOX"),z=(A==null?void 0:A.keyCheckbox)||"id",Z=G.value.map(U=>U[z]).filter(U=>U!=null),R=Z.filter(U=>v.value.includes(U)).length;return R>0&&R<Z.length}),H=A=>{const z=J.value.find(U=>U.type==="CHECKBOX"),Z=(z==null?void 0:z.keyCheckbox)||"id",R=A[Z];return R!==void 0&&v.value.includes(R)},Y=A=>{const z=J.value.find(U=>U.type==="CHECKBOX"),Z=(z==null?void 0:z.keyCheckbox)||"id",R=G.value.map(U=>U[Z]).filter(U=>U!=null);if(A){const U=new Set([...v.value,...R]);v.value=Array.from(U)}else v.value=v.value.filter(U=>!R.includes(U))},oe=(A,z)=>{const Z=J.value.find(ne=>ne.type==="CHECKBOX"),R=(Z==null?void 0:Z.keyCheckbox)||"id",U=A[R];U!=null&&(z?v.value.includes(U)||v.value.push(U):v.value=v.value.filter(ne=>ne!==U))};e.watch(v,A=>{var Z;a("update:selection",A);const z=X.value||A.length>1;(Z=w.value)!=null&&Z.length&&w.value.forEach(R=>{var U;(U=R.fieldActionGlobal)!=null&&U.length&&R.fieldActionGlobal.forEach(ne=>{var De,qe;const ge=R.endpoint||((De=R.propsActionGlobal)==null?void 0:De.endpointPropAction)||R.propsActionGlobal,Ve=(qe=ge==null?void 0:ge.keyParam)==null?void 0:qe[0];(Ve&&ne.model===Ve||!Ve&&/^(id|ids|idAuditTrail)/i.test(ne.model))&&z&&ne.model&&(V.value[ne.model]=A)})})},{deep:!0});const M=A=>Array.from({length:A}).map((z,Z)=>{const R={id:Z+1,no:Z+1};return J.value.forEach(U=>{U.key!=="no"&&U.key!=="action"&&U.type!=="ACTION"&&U.type!=="action"&&(U.type==="CHECKBOX"?R[U.keyCheckbox||"id"]=Z+1:U.type==="BADGE"||U.type==="badge"||U.condition?R[U.key]=U.condition&&U.condition.length>0?U.condition[0].value:"Active":R[U.key]=`Data ${U.label} ${Z+1}`)}),R}),L=A=>A&&typeof A=="string"&&A.trim()?A:void 0,ee=e.computed(()=>{var A,z,Z,R;return L((z=(A=E.value)==null?void 0:A.endpoint)==null?void 0:z.apiModule)||L((R=(Z=E.value)==null?void 0:Z.endpointGlobal)==null?void 0:R.apiModule)||r.apiModule}),Q=e.computed(()=>{var A,z,Z,R;return L((z=(A=E.value)==null?void 0:A.endpoint)==null?void 0:z.apiAction)||L((R=(Z=E.value)==null?void 0:Z.endpointGlobal)==null?void 0:R.apiAction)||r.apiAction}),W=e.computed(()=>{var A,z,Z,R;return L((z=(A=E.value)==null?void 0:A.endpoint)==null?void 0:z.apiMethod)||L((R=(Z=E.value)==null?void 0:Z.endpointGlobal)==null?void 0:R.apiMethod)||r.apiMethod||"POST"}),ie=e.computed(()=>{var A,z,Z,R;return L((z=(A=E.value)==null?void 0:A.endpoint)==null?void 0:z.apiUrl)||L((R=(Z=E.value)==null?void 0:Z.endpointGlobal)==null?void 0:R.apiUrl)||r.apiUrl}),de=e.computed(()=>r.permissionBase||""),Ce=e.computed(()=>!y.value||y.value.length===0?[]:[...y.value].sort((A,z)=>(A.seq||0)-(z.seq||0))),Ne=A=>{var ne,ge,Ve;const z=(A==null?void 0:A.column)||((ne=A==null?void 0:A.props)==null?void 0:ne.column)||((ge=A==null?void 0:A.propsFieldGlobal)==null?void 0:ge.column)||((Ve=A==null?void 0:A.propsFieldCustom)==null?void 0:Ve.column);if(!z)return"col-span-1";const Z=z.toLowerCase(),U={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"}[Z]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${A==null?void 0:A.model}: type=${z}, returned=${U}`),U},be=()=>{let A=null;if(r.tableConfig&&(A=r.tableConfig),A){E.value=A,A.headers&&(S.value=A.headers.map(R=>{var ge,Ve,Ae,De,qe,ve,je,Pt,nn,_a;if(R.key==="action"||((ge=R.custom)==null?void 0:ge.type)==="ACTION"||((Ve=R.custom)==null?void 0:Ve.type)==="action"){const vt=((Ae=R.custom)==null?void 0:Ae.actionCustom)||((De=R.custom)==null?void 0:De.action);return vt&&(B.value=vt.map(Lt=>{const it=Lt.propsActionCustom||Lt.props||{},Sa=Lt.propCustomMessage||{};return{permission:Lt.permission,label:l.value==="id"?it.labelID:it.labelEN,tooltip:l.value==="id"?it.tooltipID||it.labelID:it.tooltipEN||it.labelEN,icon:it.icon,variant:it.variant||"ghost",bgColor:it.bgColor,action:it.actionType||it.key,route:it.route,path:it.path,endpoint:it.endpointPropAction,requiredCondition:Lt.requiredCondition||!1,propCustomCondition:Lt.propCustomCondition||[],fieldMapping:Lt.fieldMapping||it.fieldMapping||null,openDialog:Lt.openDialog||!1,fieldActionCustom:(Lt.fieldActionCustom||[]).map(Va=>{const mi=Va.propsFieldCustom||Va.propsFieldGlobal||Va.props||{};return{...Va,props:{...mi,endpoint:mi.endpointComponent||mi.endpoint}}}),condition:Lt.visibleRule||Lt.propCustomCondition||it.visibleRule||it.propCustomCondition||null,requireConfirm:Lt.requireConfirm||it.requireConfirm||!1,confirmTitle:l.value==="id"?Sa.titleID||it.confirmTitleID||"Konfirmasi":Sa.titleEN||it.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Sa.messageID||it.confirmMessageID||"Apakah Anda yakin?":Sa.messageEN||it.confirmMessageEN||"Are you sure?"}})),null}let U;const ne=((qe=R.custom)==null?void 0:qe.conditionBadge)||((ve=R.custom)==null?void 0:ve.condition);return(((je=R.custom)==null?void 0:je.type)==="BADGE"||((Pt=R.custom)==null?void 0:Pt.type)==="badge")&&ne&&(U=ne.map(vt=>({value:vt.value,label:l.value==="id"?vt.labelID:vt.labelEN,labelID:vt.labelID,labelEN:vt.labelEN,color:vt.color||vt.bgColor,variant:vt.variant,logic:vt.logic||vt.conditionRule||null}))),{key:R.key,label:l.value==="id"?R.labelID:R.labelEN,width:R.width,align:R.align,sortable:!0,type:(nn=R.custom)==null?void 0:nn.type,condition:U,keyCheckbox:(_a=R.custom)==null?void 0:_a.keyCheckbox}}).filter(R=>R!==null));const z=A.filters||A.filter;z&&Array.isArray(z)&&(y.value=z.map(R=>({...R,props:R.propsFilters||R.props||{}})),y.value.forEach(R=>{g.value[R.model]=""}));const Z=A.actionTableGlobal||A.actionGlobal||A.action;console.log("[DEBUG] loadConfig rawActions:",Z),Z&&Array.isArray(Z)?(w.value=Z.map(R=>{const U=R.propsActionGlobal||R.props||{};return{key:U.key,permission:R.permission,label:l.value==="id"?U.labelID||"Action":U.labelEN||"Action",tooltip:l.value==="id"?U.tooltipID||U.labelID:U.tooltipEN||U.labelEN,icon:U.icon,variant:U.variant||"default",bgColor:U.bgColor,textColor:U.textColor,route:U.route,path:U.path,endpoint:U.endpointPropAction||R.endpoint,fieldMapping:R.fieldMapping||U.fieldMapping||null,visibleRule:R.visibleRule||U.visibleRule||R.propCustomCondition||U.propCustomCondition||null,openDialog:R.openDialog||!1,fieldActionGlobal:(R.fieldActionGlobal||R.field||[]).map(ne=>{const ge=ne.propsFieldGlobal||ne.props||{};return{...ne,props:{...ge,endpoint:ge.endpointComponent||ge.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",w.value)):console.log("[DEBUG] loadConfig no rawActions found"),A.pagination!==void 0&&(C.value=A.pagination)}};e.watch(()=>r.tableConfig,()=>{be()},{deep:!0,immediate:!0});const J=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?S.value:r.columns||[]),F=e.computed(()=>r.hasActions||B.value.length>0),K=e.computed(()=>r.dummyMode?!1:ee.value||ie.value?k.value:r.loading),ae=e.computed(()=>!!ee.value||!!ie.value),_e=e.computed(()=>[]),Re=A=>{if(console.log("[DEBUG] hasAction called:",{actionCode:A,permissionChecker:!!r.permissionChecker,effectivePath:de.value}),r.menuPermissions&&r.menuPermissions.length>0){const z=c.path,Z=r.menuPermissions.find(R=>z.startsWith(R.path));if(Z&&Z.actions){const R=Z.actions.find(U=>U.code===A.toUpperCase());return R?R.checked:!1}return!1}if(r.permissionChecker){const z=r.permissionChecker(de.value,A);return console.log("[DEBUG] permissionChecker result:",z),z}return _e.value.some(z=>z.code===A)},ze=(A,z)=>{if(A.condition)try{return tn.apply(A.condition,z)}catch(ge){return console.warn("Row action jsonLogic error:",ge),!1}if(!A.visibilityCondition)return!0;const{field:Z,operator:R,value:U}=A.visibilityCondition,ne=Me(z,Z);switch(R){case"equals":return ne===U;case"notEquals":return ne!==U;case"in":return Array.isArray(U)&&U.includes(ne);case"notIn":return Array.isArray(U)&&!U.includes(ne);case"greaterThan":return ne>U;case"lessThan":return ne<U;case"contains":return String(ne).includes(String(U));default:return!0}},He=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:w.value,ignorePermissions:r.ignorePermissions}),w.value.length===0)return w.value;const A=w.value.filter(z=>{if(z.visibleRule)try{const R=G.value[0]||{};if(!tn.apply(z.visibleRule,R))return!1}catch(R){console.warn("Header action visibility logic error:",R)}if(r.ignorePermissions)return!0;if(!z.permission)return console.log("[DEBUG] Action no permission, showing:",z.label),!0;if(r.checkPermission){const R=r.checkPermission(z.permission);return console.log("[DEBUG] Parent checkPermission result:",R),R}if(r.permissions){const R=r.permissions.includes(z.permission);return console.log("[DEBUG] Parent permissions check result:",R),R}const Z=Re(z.permission);return console.log("[DEBUG] Internal permission check:",{label:z.label,permission:z.permission,hasPerm:Z}),Z});return console.log("[DEBUG] Filtered header actions:",A.length),A}),Xe=e.computed(()=>B.value.length===0?B.value:B.value.filter(A=>r.ignorePermissions||!A.permission?!0:r.checkPermission?r.checkPermission(A.permission):r.permissions?r.permissions.includes(A.permission):Re(A.permission))),ot=A=>Xe.value.filter(z=>ze(z,A)),Ie=(A,z)=>{var U,ne;if(A.requiredCondition&&((U=A.propCustomCondition)==null?void 0:U.length)>0){const ge=Me(z,"status"),Ve=A.propCustomCondition.find(Ae=>Ae.value===ge);if(Ve)return Ve.bgColor||A.bgColor||"primary"}if(!A.dynamicColor||!A.colorCondition)return A.bgColor||"primary";const Z=Me(z,A.colorCondition.field),R=(ne=A.colorCondition.conditions)==null?void 0:ne.find(ge=>ge.value===Z);return(R==null?void 0:R.bgColor)||A.bgColor||"primary"},mt=A=>{const z=(A||"left").toLowerCase();return z==="center"?"justify-center":z==="right"?"justify-end":"justify-start"},pt={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},Tt=A=>A?$t[A]?$t[A]:pt[A]||null:null,G=e.computed(()=>r.dummyMode?J.value.length>0?M(10):[]:ae.value?p.value.map((A,z)=>({...A,no:(f.value-1)*m.value+z+1})):he.value),ue=e.computed(()=>r.dummyMode?10:ae.value?x.value:te.value.length),Ee=e.computed(()=>ue.value===0?0:(f.value-1)*m.value+1),Ue=e.computed(()=>{const A=f.value*m.value;return A>ue.value?ue.value:A}),Me=(A,z)=>{if(!(!A||!z))return z in A?A[z]:z.split(".").reduce((Z,R)=>Z&&Z[R],A)},te=e.computed(()=>{if(ae.value)return[];if(!u.value)return r.data;const A=u.value.toLowerCase();return r.data.filter(z=>J.value.some(Z=>{const R=Me(z,Z.key);return R==null?!1:String(R).toLowerCase().includes(A)}))}),ce=e.computed(()=>ae.value?[]:h.value.key?[...te.value].sort((z,Z)=>{const R=Me(z,h.value.key),U=Me(Z,h.value.key);if(R===U)return 0;let ne=0;return typeof R=="number"&&typeof U=="number"?ne=R-U:ne=String(R).localeCompare(String(U)),h.value.direction==="asc"?ne:-ne}):te.value),he=e.computed(()=>{if(ae.value)return[];const A=(f.value-1)*m.value,z=A+m.value;return ce.value.slice(A,z).map((Z,R)=>({...Z,no:A+R+1}))}),Se=e.computed(()=>ae.value?Object.values(g.value).some(A=>!!A):!!u.value),et=[10,25,50,100],St=()=>{ae.value&&(g.value={...g.value,keyword:u.value},f.value=1,gt())};let gn;const ko=()=>{r.enableQuickSearch&&(clearTimeout(gn),gn=setTimeout(()=>{St()},500))};let wo;const Ca=()=>{clearTimeout(wo),wo=setTimeout(()=>{ae.value&&gt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&ae.value&&ko()});const gt=async()=>{if(!r.dummyMode&&ae.value&&!(!ee.value&&!ie.value))try{k.value=!0;const A={page:f.value,perPage:m.value,...g.value,...r.apiParams};u.value&&(A.keyword=u.value),Object.keys(A).forEach(Z=>{(A[Z]===""||A[Z]===null||A[Z]===void 0)&&delete A[Z]});let z;if(ee.value)z=await i(ee.value,Q.value,A);else if(ie.value){let Z=ie.value;if(r.baseUrl&&typeof Z=="string"&&!Z.startsWith("http")){const R=r.baseUrl.replace(/\/$/,""),U=Z.startsWith("/")?Z:`/${Z}`;Z=`${R}${U}`}z=await i(Z,W.value,A)}sr(z)}catch(A){console.error("DataTable fetch error",A),k.value=!1}},sr=A=>{console.log("DataTable handleResponseData:",A),A&&(r.dynamicColumns&&A.columns&&Array.isArray(A.columns)&&(S.value=A.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}))),A.data&&Array.isArray(A.data)?(p.value=A.data,A.totalData?x.value=A.totalData:A.maxPage?x.value=A.maxPage*m.value:x.value=A.data.length*(A.maxPage||1)):Array.isArray(A)?(p.value=A,x.value=A.length):A.users?(p.value=A.users,x.value=A.users.length):A.items&&Array.isArray(A.items)?(p.value=A.items,x.value=A.total||A.totalItems||A.items.length):A.list&&Array.isArray(A.list)?(p.value=A.list,x.value=A.total||A.list.length):A.rows&&Array.isArray(A.rows)?(p.value=A.rows,x.value=A.count||A.total||A.rows.length):A.result&&Array.isArray(A.result)?(p.value=A.result,x.value=A.total||A.count||A.result.length):(console.warn("DataTable: Unknown response format",A),p.value=[],x.value=0)),k.value=!1};e.onUnmounted(()=>{clearTimeout(gn),clearTimeout(wo)});const Co=()=>{Object.keys(g.value).forEach(A=>{g.value[A]=""}),u.value="",f.value=1,gt()},Ea=()=>{f.value=1,gt()},Eo=(A,z)=>{const Z=Me(A,z.key);let R={variant:"secondary",class:"",label:Z};if(z.condition){const U=z.condition.find(ne=>{if(ne.logic||typeof ne.value=="object"&&ne.value!==null)try{const Ve=ne.logic||ne.value;return tn.apply(Ve,A)}catch(Ve){return console.warn("Badge logic error:",Ve),!1}const ge=(Ve,Ae)=>Ve==null||Ae===void 0||Ae===null?!1:typeof Ve=="string"&&typeof Ae=="string"?Ve.toLowerCase().trim()===Ae.toLowerCase().trim():Ve==Ae;if(ge(ne.value,Z)||typeof Z=="object"&&Z!==null&&(ge(ne.value,Z.code)||ge(ne.value,Z.id)))return!0;if(z.key.includes(".")){const Ae=z.key.split(".").slice(0,-1).join("."),De=Me(A,Ae);if(De&&typeof De=="object"&&(ge(ne.value,De.code)||ge(ne.value,De.id)))return!0}return!1});if(U){U.variant&&(R.variant=U.variant);const ge=(l.value||"en")==="id"?U.labelID:U.labelEN;if(R.label=ge||U.label||(typeof Z=="object"?Z.name||Z.code:Z),U.color||U.bgColor){const Ve=(U.color||U.bgColor||"").toLowerCase(),Ae=R.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"},qe={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"},ve={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Ae?qe[Ve]&&(R.class=qe[Ve]):ve[Ve]?R.variant=ve[Ve]:De[Ve]&&(R.class=De[Ve])}}else R.label=typeof Z=="object"?(Z==null?void 0:Z.name)||(Z==null?void 0:Z.code)||"-":Z}else R.label=typeof Z=="object"?(Z==null?void 0:Z.name)||(Z==null?void 0:Z.code)||"-":Z;return R},Ba=A=>{h.value.key===A?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=A,h.value.direction="asc"),a("update:sort",h.value)},Bo=A=>{A!==f.value&&(f.value=A,ae.value&&gt(),a("update:page",A))},ir=A=>{m.value=A,f.value=1,ae.value&&gt()},P=A=>{const z=Math.random()*15+75;if(A.width){const Z=parseInt(String(A.width));return Z<100?`${Math.floor(Z*(Math.random()*.2+.7))}px`:`${z}%`}return`${z}%`},j=()=>{u.value="",g.value={},f.value=1,gt()},$=A=>{var z;if(console.log("[DEBUG] handleHeaderAction called:",A),A.route&&!r.dummyMode){if(A.path){const Z=A.route.startsWith("/")?A.route:"/"+A.route;sessionStorage.setItem(`layout_${Z}`,A.path)}d==null||d.push(A.route)}else if(A.openDialog||r.dummyMode&&A.route){N.value=A,T.value=null,V.value={};const Z=A.fieldActionGlobal||A.field||[];Z.length&&Z.forEach(R=>{var ge;const U=A.endpoint||((ge=A.propsActionGlobal)==null?void 0:ge.endpointPropAction)||A.propsActionGlobal,ne=U!=null&&U.keyParam&&U.keyParam.length>0?U.keyParam[0]:null;ne&&R.model===ne||!ne&&/^(id|ids|idAuditTrail)/i.test(R.model)?V.value[R.model]=v.value:V.value[R.model]||(V.value[R.model]="")}),_.value=!0}else a("action",{action:((z=A.propsActionCustom)==null?void 0:z.key)||A.key||"create",row:null,selection:v.value})},I=async(A,z)=>{var Z,R,U,ne;if(A.requireConfirm){D.value={button:A,row:z},b.value=!0;return}if(A.openDialog){N.value=A,T.value=z,V.value={};const ge=J.value.find(De=>De.type==="CHECKBOX"),Ve=(ge==null?void 0:ge.keyCheckbox)||"id";A.fieldActionCustom&&A.fieldActionCustom.forEach(De=>{/^(id|ids|idAuditTrail)/i.test(De.model)?V.value[De.model]=[z[Ve]]:A.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 Ae=A.endpoint||((Z=A.propsActionGlobal)==null?void 0:Z.endpointPropAction)||((R=A.propsActionCustom)==null?void 0:R.endpointPropAction)||((U=A.props)==null?void 0:U.endpointPropAction);if(((ne=Ae==null?void 0:Ae.apiMethod)==null?void 0:ne.toUpperCase())==="GET"&&Ae.apiUrl){k.value=!0;const{apiUrl:De}=ct(),qe={};Ae.keyParam&&Array.isArray(Ae.keyParam)&&Ae.keyParam.forEach((ve,je)=>{const Pt=Ae.model&&je===0?Ae.model:ve;z[ve]!==void 0&&(qe[Pt]=z[ve])}),Object.keys(qe).length===0&&z.id&&(qe.id=z.id),De(Ae.apiUrl,"GET",qe).then(ve=>{let je=ve;if(ve&&ve.data!==void 0?je=ve.data:ve&&ve.result!==void 0&&(je=ve.result),je!=null){if(typeof je=="string")V.value.hasOwnProperty("token")&&(V.value.token=je);else if(typeof je=="object"&&(je.item&&(je=je.item),Array.isArray(je)&&(je=je[0]||{}),Object.keys(je).forEach(Pt=>{V.value[Pt]=je[Pt]}),!V.value.token)){const Pt=Object.keys(je).find(nn=>nn.toLowerCase().includes("token"));if(Pt)V.value.token=je[Pt];else{const nn=Object.values(je).filter(_a=>typeof _a=="string");nn.length===1&&(V.value.token=nn[0])}}}_.value=!0}).catch(ve=>{console.error("Fetch Data Failed",ve)}).finally(()=>{k.value=!1});return}_.value=!0;return}q(A,z)},q=(A,z)=>{if(A.route){if(A.path){const U=A.route.startsWith("/")?A.route:"/"+A.route;sessionStorage.setItem(`layout_${U}`,A.path)}let Z=A.route;Z.includes(":")?Z=Z.replaceAll(/:([a-zA-Z0-9_]+)/g,(U,ne)=>z[ne]||z.id||ne):z.id&&(Z=`${Z.replace(/\/$/,"")}/${z.id}`);const R={};A.path&&(R.code=A.path),d==null||d.push({path:Z,query:R})}else if(A.endpoint&&A.endpoint.apiUrl){k.value=!0;const{apiUrl:Z}=ct(),R=A.endpoint.apiUrl,U=A.endpoint.apiMethod||"POST",ne={},ge=A.fieldMapping;if(ge&&typeof ge=="object"){const{locale:Ve}=Ot.useI18n(),Ae=Ve.value||"en",De=[];if(Object.entries(ge).forEach(([qe,ve])=>{if(typeof ve=="string"){const je=Me(z,qe);je!==void 0?ne[ve]=je:(console.warn(`[MAPPING-DEBUG] No matching source found for '${qe}'`),De.push(qe))}}),De.length>0){const qe=Ae==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",ve=Ae==="id"?`Terdapat ketidaksesuaian skema pada field: ${De.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${De.join(", ")}. Please contact the development team.`;We.warning(`${qe}: ${ve}`,{autoClose:5e3,position:"top-right"})}}if(Object.keys(ne).length===0){const Ve=A.endpoint;Ve.model&&Ve.keyParam&&Array.isArray(Ve.keyParam)?Ve.keyParam.forEach(Ae=>{const De=Me(z,Ae);De!==void 0&&(ne[Ve.model]=De)}):z.id&&(ne.id=z.id)}Z(R,U,ne).then(()=>{gt(),a("action",{action:A.action||"success",row:z})}).catch(Ve=>{console.error("Action Failed",Ve)}).finally(()=>{k.value=!1})}else a("action",{action:A.action,row:z})},se=()=>{D.value&&(q(D.value.button,D.value.row),re())},me=()=>{var A,z,Z;if(N.value){const R=N.value,U=R.endpoint||((A=R.propsActionGlobal)==null?void 0:A.endpointPropAction)||R.propsActionGlobal;let ne=(U==null?void 0:U.model)||(U!=null&&U.keyParam&&U.keyParam.length>0?U.keyParam[0]:null);if(!ne){const De=(R.fieldActionGlobal||R.fieldActionCustom||R.field||[]).find(qe=>/^(id|ids|idAuditTrail)/i.test(qe.model));ne=De?De.model:"ids"}let ge=null,Ve=!1;if(T.value){const Ae=J.value.find(ve=>ve.type==="CHECKBOX"),De=(Ae==null?void 0:Ae.keyCheckbox)||"id",qe=T.value[De];if(U!=null&&U.apiUrl){ge={...V.value};const ve=R.fieldMapping;ve&&typeof ve=="object"&&Object.entries(ve).forEach(([je,Pt])=>{if(typeof Pt=="string"){const nn=Me(T.value,je);nn!==void 0&&(ge[Pt]=nn)}}),ge[ne]||(ge[ne]=U!=null&&U.model?qe:[qe]),Ve=!0}}else U!=null&&U.apiUrl&&(ge={...V.value},ge[ne]||(ge[ne]=v.value||[]),Ve=!0);if(Ve&&ge&&(U!=null&&U.apiUrl)){if(((z=U==null?void 0:U.apiMethod)==null?void 0:z.toUpperCase())==="GET"){_.value=!1,T.value||(v.value=[]);return}const{apiUrl:Ae}=ct(),De=U.apiUrl,qe=U.apiMethod||"POST";Ae(De,qe,ge).then(()=>{_.value=!1,T.value||(v.value=[]),gt(),a("action",{action:"success",row:null})}).catch(ve=>{console.error("Action Failed",ve)})}else if(T.value){const Ae=J.value.find(je=>je.type==="CHECKBOX"),De=(Ae==null?void 0:Ae.keyCheckbox)||"id",qe=T.value[De],ve={...V.value};ve[ne]||(ve[ne]=[qe]),a("action",{action:N.value.action,row:ve}),_.value=!1}else{const Ae={...V.value};Ae[ne]||(Ae[ne]=v.value);const De={action:((Z=N.value.propsActionGlobal)==null?void 0:Z.key)||N.value.key,row:Ae,selection:v.value};a("action",De),_.value=!1}}},fe=A=>{const z=V.value[A];z&&R2(String(z)).then(()=>{We.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Z=>{console.error("Failed to copy",Z)})},re=()=>{b.value=!1,D.value=null},ke=e.computed(()=>D.value?D.value.button.confirmTitle||"Confirm":""),$e=e.computed(()=>D.value?D.value.button.confirmMessage||"Confirm":"");n({fetchData:gt,filters:g,resetFilters:Co,handleRefresh:j});const Ze=e.ref(""),at=A=>{if(!A)return"";const z=A.endpoint||A.endpointGlobal||{};return JSON.stringify({url:z.apiUrl||A.apiUrl,module:z.apiModule||A.apiModule,action:z.apiAction||A.apiAction,method:z.apiMethod||A.apiMethod,params:A.apiParams,socket:z.socket||A.socketEndpoint,socketParams:A.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){be();const A=at(r.tableConfig);A!==Ze.value&&(!Ze.value&&ae.value?(Ze.value=A,gt()):(Ze.value=A,ae.value&&Ca()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{ae.value&&gt()}),e.watch(()=>r.apiParams,()=>{ae.value&&gt()},{deep:!0}),e.watch(()=>w.value,A=>{console.log("[DEBUG] headerActions changed:",A.length,"items");const z=He.value;console.log("[DEBUG] visibleHeaderActions evaluated:",z.length,"items")},{deep:!0}),e.onMounted(()=>{be(),ae.value&&(r.tableConfig||(k.value=!0,gt()))}),(A,z)=>{var Z;return e.openBlock(),e.createElementBlock("div",fS,[e.createElementVNode("div",mS,[e.createElementVNode("div",hS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",pS,[e.createElementVNode("div",gS,[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(K2),{modelValue:u.value,"onUpdate:modelValue":z[0]||(z[0]=R=>u.value=R),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(St,["enter"])},null,8,["modelValue"])]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",bS,[e.createVNode(q2,null,{trigger:e.withCtx(()=>[e.createVNode(Ke,{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",CS,[e.renderSlot(A.$slots,"filter-footer",{fetch:gt,reset:Co})])]),default:e.withCtx(()=>[z[9]||(z[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",yS,[e.renderSlot(A.$slots,"filter-form",{filters:g.value},()=>[y.value.length>0?(e.openBlock(),e.createElementBlock("div",xS,[e.createElementVNode("div",kS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(R,U)=>(e.openBlock(),e.createElementBlock("div",{key:U,class:e.normalizeClass(Ne(R))},[e.createVNode(eu,{field:R,modelValue:g.value[R.model],"onUpdate:modelValue":ne=>g.value[R.model]=ne},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",wS,[e.createVNode(Ke,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Co,disabled:K.value},null,8,["disabled"]),e.createVNode(Ke,{onClick:Ea,disabled:K.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",ES)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ke,{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:j,disabled:K.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(le.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":K.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(R,U)=>(e.openBlock(),e.createBlock(Ke,{key:U,icon:R.icon,text:R.label,tooltip:R.tooltip,variant:R.variant,"bg-color":R.bgColor,"text-color":R.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:ne=>$(R)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(A.$slots,"header-actions")],2)])]),e.createElementVNode("div",BS,[e.createElementVNode("table",_S,[e.createElementVNode("thead",SS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,R=>(e.openBlock(),e.createElementBlock("th",{key:R.key,class:e.normalizeClass([R.align?`text-${R.align.toLowerCase()}`:"text-left",R.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(R.width?{width:R.width}:{}),onClick:U=>R.sortable&&Ba(R.key)},[R.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",AS,[e.createVNode(pn,{"model-value":X.value,indeterminate:O.value,"onUpdate:modelValue":z[1]||(z[1]=U=>Y(!!U)),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",mt(R.align)])},[e.createElementVNode("span",null,e.toDisplayString(R.label),1)],2))],14,VS))),128)),F.value?(e.openBlock(),e.createElementBlock("th",DS,[...z[10]||(z[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",NS,[K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,R=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${R}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,U=>{var ne,ge;return e.openBlock(),e.createElementBlock("td",{key:U.key,class:e.normalizeClass([U.align?`text-${U.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(U.type??"")||U.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((ne=U.align)==null?void 0:ne.toLowerCase())==="center"?"mx-auto":"",((ge=U.align)==null?void 0:ge.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(U.type??"")||U.condition?void 0:P(U),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",MS,[...z[11]||(z[11]=[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)):G.value.length===0?(e.openBlock(),e.createElementBlock("tr",TS,[e.createElementVNode("td",{colspan:J.value.length+(F.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",vS,[e.createVNode(e.unref(wu.Vue3Lottie),{animationData:e.unref(iS),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",OS,e.toDisplayString(Se.value?"No search results":"No data"),1),e.createElementVNode("p",FS,e.toDisplayString(Se.value?"Try changing keywords":"No data added"),1)])])],8,PS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(G.value,(R,U)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U},[e.createElementVNode("tr",zS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.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(A.$slots,`cell-${ne.key}`,{row:R,value:Me(R,ne.key)},()=>[ne.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",RS,[e.createVNode(pn,{"model-value":H(R),"onUpdate:modelValue":ge=>oe(R,!!ge),onClick:z[3]||(z[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(ci,{variant:Eo(R,ne).variant,class:e.normalizeClass([Eo(R,ne).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Eo(R,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)*m.value+U+1),1)],64)):ne.type==="date"||ne.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Me(R,ne.key)?e.unref(F2)(Me(R,ne.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(ne.format?ne.format(Me(R,ne.key)):Me(R,ne.key)),1)],64))])],2))),128)),F.value?(e.openBlock(),e.createElementBlock("td",IS,[e.renderSlot(A.$slots,"actions",{row:R,buttons:ot(R),getButtonColor:Ie,getIconComponent:Tt},()=>[ot(R).length>0?(e.openBlock(),e.createElementBlock("div",LS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot(R),(ne,ge)=>(e.openBlock(),e.createElementBlock("div",{key:ge,class:"group relative"},[e.createVNode(Ke,{tooltip:ne.tooltip||ne.label,icon:ne.icon,size:"icon",rounded:ne.rounded||"sm",borderStyle:ne.borderStyle||"none",variant:ne.variant||"ghost","bg-color":Ie(ne,R),onClick:Ve=>I(ne,R)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),A.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",$S,[e.createElementVNode("td",{colspan:J.value.length+(F.value?1:0),class:"px-0 py-0"},[e.renderSlot(A.$slots,"expanded-row",{row:R,index:U})],8,jS)])):e.createCommentVNode("",!0)],64))),128))])])]),!K.value&&G.value.length>0&&t.showPagination&&C.value?(e.openBlock(),e.createElementBlock("div",US,[e.createElementVNode("div",WS,[e.createVNode(e.unref(r_),{"model-value":String(m.value),"onUpdate:modelValue":z[4]||(z[4]=R=>ir(Number(R)))},{default:e.withCtx(()=>[e.createVNode(e.unref(d_),{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(u_),{placeholder:String(m.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(a_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(et,R=>e.createVNode(e.unref(i_),{key:R,value:String(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(R),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),z[16]||(z[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",HS,[z[12]||(z[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",qS,e.toDisplayString(Ee.value),1),z[13]||(z[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",GS,e.toDisplayString(Ue.value),1),z[14]||(z[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",XS,e.toDisplayString(ue.value),1),z[15]||(z[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",KS,[e.createVNode(e.unref(Y2),{total:ue.value,"items-per-page":m.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":Bo,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(J2),{class:"flex items-center gap-1"},{default:e.withCtx(({items:R})=>[e.createVNode(e.unref(Z2),{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(o_),{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(R,(U,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[U.type==="page"?(e.openBlock(),e.createBlock(e.unref(e_),{key:ne,value:U.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ht),{class:"w-8 h-8 p-0 text-sm",variant:U.value===f.value?"default":"outline",disabled:U.value===f.value,onClick:ge=>Bo(U.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(Q2),{key:U.type,index:ne},null,8,["index"]))],64))),256)),e.createVNode(e.unref(n_),{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(t_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled: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(Mn,{modelValue:b.value,"onUpdate:modelValue":z[5]||(z[5]=R=>b.value=R),title:ke.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",onClick:re,text:"Cancel"}),e.createVNode(Ke,{variant:"default",onClick:se,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",YS,[e.createElementVNode("p",JS,e.toDisplayString($e.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Mn,{modelValue:_.value,"onUpdate:modelValue":z[8]||(z[8]=R=>_.value=R),title:((Z=N.value)==null?void 0:Z.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var R;return[e.createVNode(Ke,{variant:"outline",onClick:z[6]||(z[6]=U=>_.value=!1),text:"Cancel"}),t.dummyMode&&((R=N.value)!=null&&R.route)?(e.openBlock(),e.createBlock(Ke,{key:1,variant:"default",onClick:z[7]||(z[7]=U=>_.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Ke,{key:0,variant:"default",onClick:me,text:"Save"}))]}),default:e.withCtx(()=>{var R,U,ne;return[e.createElementVNode("div",QS,[t.dummyMode&&((R=N.value)!=null&&R.route)?(e.openBlock(),e.createElementBlock("div",ZS,[e.createElementVNode("div",eV,[e.createVNode(e.unref(le.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",tV,[e.createElementVNode("span",nV,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",oV,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${N.value.route}`:`This action will navigate to: ${N.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((U=N.value)==null?void 0:U.fieldActionCustom)||((ne=N.value)==null?void 0:ne.fieldActionGlobal)||[],(ge,Ve)=>{var Ae,De,qe,ve;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ve},[!ge.isHidden&&!(t.dummyMode&&((Ae=N.value)!=null&&Ae.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Ne(ge))},[e.createElementVNode("div",rV,[e.createVNode(eu,{class:"flex-1 w-full",field:ge,modelValue:V.value[ge.model],"onUpdate:modelValue":je=>V.value[ge.model]=je},null,8,["field","modelValue","onUpdate:modelValue"]),ge.isCopyable||(De=ge.props)!=null&&De.isCopyable||((qe=N.value)==null?void 0:qe.action)==="showToken"||((ve=N.value)==null?void 0:ve.action)==="copyToken"?(e.openBlock(),e.createBlock(Ke,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:je=>fe(ge.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});tn.add_operation("length",t=>t==null?0:typeof t=="string"||Array.isArray(t)?t.length:typeof t=="number"?String(t).length:typeof t=="object"?Object.keys(t).length:0),tn.add_operation("==",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null?n==null:n==null?t==null:o(t)&&o(n)?String(t.id)===String(n.id)||String(t.code)===String(n.code):o(t)?String(t.code)===String(n)||String(t.id)===String(n):o(n)?String(n.code)===String(t)||String(n.id)===String(t):typeof t=="boolean"&&typeof n=="string"?String(t)===n:typeof n=="boolean"&&typeof t=="string"?String(n)===t:String(t)===String(n)}),tn.add_operation("!=",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null&&n==null?!1:t==null||n===null||n===void 0?!0:o(t)&&o(n)?!(String(t.id)===String(n.id)||String(t.code)===String(n.code)):o(t)?!(String(t.code)===String(n)||String(t.id)===String(n)):o(n)?!(String(n.code)===String(t)||String(n.id)===String(t)):String(t)!==String(n)});function aV(t,n){const{t:o,locale:r}=Ot.useI18n(),a=e.computed(()=>r.value),{apiUrl:s}=ct(),i=vn.useRouter();let l="";const c=e.ref(!1),d=e.ref(null),u=e.computed(()=>t.schema||d.value),f=e.computed(()=>{var P;if((P=t.selectedTokenCore)!=null&&P.address)return t.selectedTokenCore.address;if(t.baseUrl)return t.baseUrl}),m=P=>{if(!P||typeof P!="string"||P.startsWith("http"))return P;const j=f.value;if(!j)return P;const $=j.replace(/\/$/,""),I=P.startsWith("/")?P:`/${P}`;return`${$}${I}`},h=e.computed(()=>{const P={},j=u.value;return j!=null&&j.sections&&j.sections.forEach($=>{var q,se,me;(((q=$.propsForm)==null?void 0:q.fields)||((se=$.propsTable)==null?void 0:se.fields)||((me=$.props)==null?void 0:me.fields)||[]).forEach(fe=>{var re,ke,$e,Ze,at,tt,bt,Ct,bn,_o,Pn;if(fe.component==="DCodeRadioCustom"){const A=((re=fe.props)==null?void 0:re.name)||"default-group";P[A]||(P[A]=[]);let z=(($e=(ke=fe.props)==null?void 0:ke.endpoint)==null?void 0:$e.apiUrl)||((Ze=fe.props)==null?void 0:Ze.apiUrl);z=m(z),P[A].push({key:fe.key,value:(at=fe.props)==null?void 0:at.value,label:((tt=fe.props)==null?void 0:tt.labelID)||((bt=fe.props)==null?void 0:bt.labelEN)||fe.key,model:fe.model||fe.key,apiUrl:z,apiMethod:((bn=(Ct=fe.props)==null?void 0:Ct.endpoint)==null?void 0:bn.apiMethod)||((_o=fe.props)==null?void 0:_o.apiMethod),icon:(Pn=fe.props)==null?void 0:Pn.icon,name:A})}})}),P}),p=e.reactive({}),k=e.reactive({}),x=e.reactive({}),g=e.reactive({}),S=e.reactive({}),E=e.reactive({visible:!1,title:"",message:"",action:null}),C=P=>{var j,$,I;return((j=P.propsForm)==null?void 0:j.key)||(($=P.propsTable)==null?void 0:$.key)||((I=P.propsWizard)==null?void 0:I.key)||P.id||"unknown-section"},B=P=>{var $;return((($=P.propsWizard)==null?void 0:$.propsSteps)||[]).filter(I=>W(I)).map((I,q)=>{var fe;let se=[];if(Array.isArray(I.sectionsWizard))se=I.sectionsWizard;else if(I.sectionsWizard&&typeof I.sectionsWizard=="object"){const re=I.sectionsWizard;se=[{type:re.type||(re.fields?"FORM":re.isDataTable?"TABLE":"UNKNOWN"),...re}]}const me=Q(I);return{key:I.key||`step-${q}`,title:me.title,description:me.description,icon:I.icon||void 0,sections:se,actions:((fe=I.propsComponent)==null?void 0:fe.actionComponent)||I.actionComponent||[]}})},w=P=>P?[...P].sort((j,$)=>(j.seq||0)-($.seq||0)):[],y=(P,j)=>{var q;const $=j?N(j):T.value;return v((q=P.logic)==null?void 0:q.labelingRule,$,`LABEL-${P.model}`)||null},b=(P,j)=>{var q;const $=j?N(j):T.value;return v((q=P.logic)==null?void 0:q.lengthRule,$,`LENGTH-${P.model}`)||null},_=(P,j,$)=>{const I=P.props||P.propsFieldGlobal;if(!I)return null;const q=j==null?"":String(j);if(q==="")return null;const se=b(P,$),me=(se==null?void 0:se.minLength)??I.minLength,fe=(se==null?void 0:se.maxLength)??I.maxLength;if(me&&q.length<me)return a.value==="id"?`Minimal ${me} karakter`:`Minimum ${me} characters`;if(fe&&q.length>fe)return a.value==="id"?`Maksimal ${fe} karakter`:`Maximum ${fe} characters`;if(I.regex)try{if(!new RegExp(I.regex).test(q))return I.regexMessage||(a.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${P.model}:`,I.regex)}return null},V=e.computed(()=>{var j;const P=new Map;return(j=u.value)!=null&&j.sections&&u.value.sections.forEach($=>{var me,fe;const I=$.propsForm||$.propsTable||$.props||{},q=C($);(I.fields||$.fields||[]).forEach(re=>{if(re.model){const ke=q?`${q}.${re.model}`:re.model;P.set(re.model,{field:re,path:ke})}}),((me=$.type)==null?void 0:me.toUpperCase())==="WIZARD"&&((fe=$.propsWizard)!=null&&fe.propsSteps)&&$.propsWizard.propsSteps.forEach(re=>{const ke=re.key||re.id;(Array.isArray(re.sectionsWizard)?re.sectionsWizard:[re.sectionsWizard].filter(Boolean)).forEach(Ze=>{Ze.fields&&Ze.fields.forEach(at=>{if(at.model){const tt=ke?`${ke}.${at.model}`:at.model;P.set(at.model,{field:at,path:tt})}})})})}),P}),D=(P,j)=>{if(j==null||typeof j=="object"&&j._isLogicValue)return j;const $=V.value.get(P);if(!$)return j;const I=$.field,q=O[I.key];if(!q||!Array.isArray(q))return j;const me=(I.props||{}).itemValue||"id",fe=q.find(re=>String(re[me])===String(j)||String(re.id)===String(j)||String(re.code)===String(j));return fe&&fe.code?{id:j,code:fe.code,_isLogicValue:!0}:j},N=P=>{const j=($,I)=>{if($==null||typeof $=="object"&&$._isLogicValue||typeof $=="boolean")return $;if(typeof $=="number"||typeof $=="string")return I?D(I,$):$;if(typeof $=="object"&&!Array.isArray($)){const q=($==null?void 0:$.id)??($==null?void 0:$.code)??($==null?void 0:$.value)??($==null?void 0:$.key)??$;return I&&(typeof q=="string"||typeof q=="number")?D(I,q):q}return $};return new Proxy(P,{get($,I){if(typeof I!="string")return $[I];const q=V.value.get(I);if(q){const se=Ce($,q.path);if(se!=null)return j(se,I)}return j($[I],I)},has($,I){return typeof I!="string"?I in $:V.value.has(I)||I in $},ownKeys($){return Array.from(new Set([...Object.keys($),...V.value.keys()]))},getOwnPropertyDescriptor($,I){return{enumerable:!0,configurable:!0}}})},T=e.computed(()=>N(p)),v=(P,j,$)=>P==null?null:Array.isArray(P)?P.find(I=>!I.condition||X(I.condition,j,$))||null:P,X=(P,j,$="LOGIC")=>{if(P==null||typeof P=="object"&&Object.keys(P).length===0)return!0;if(typeof P=="boolean")return P;if(typeof P=="object")try{const I=tn.apply(P,j);if(["VISIBLE","SEC","FILTER","LENGTH","CALC"].some(se=>$.includes(se))){const se=JSON.stringify(P),me=Object.keys(j).filter(fe=>se.includes(`"${fe}"`));console.log(`[DynamicForm][${$}] Rule: ${se} | Data: {${me.map(fe=>`${fe}: ${JSON.stringify(j[fe])}`).join(", ")}} | Result: ${I}`)}return I}catch(I){return console.error(`[${$}] JsonLogic error:`,I),!1}try{return!!new Function("formData",`return ${P};`)(j)}catch{return!1}},O=e.reactive({}),H=async P=>{const j=P.props||{},$=j.endpointReference||j.endpoint;if(!(!($!=null&&$.apiUrl)||O[P.key])&&!(Array.isArray($.keyParam)&&$.keyParam.some(I=>p[I]===null||p[I]===void 0||p[I]==="")))try{const I=m($.apiUrl),q=await s(I,$.apiMethod||"GET",{page:1,perPage:100});let se=(q==null?void 0:q.data)||q;O[P.key]=Array.isArray(se)?se:se?[se]:[]}catch{O[P.key]=[]}},Y=(P,j)=>{var re;const $=P.props||{},I=O[P.key]||$.items||$.options||[];if(!((re=P.logic)!=null&&re.optionsFilterRule))return I;const q=j?N(j):T.value,se=v(P.logic.optionsFilterRule,q,`FILTER-${P.model}`);if(!se||!se.values)return I;const me=(se.values||[]).map(ke=>String(ke)),fe=$.itemValue||"id";return I.filter(ke=>ke==null?!1:typeof ke!="object"?me.includes(String(ke)):[fe,"code","id","value","key"].some($e=>{const Ze=ke[$e];return Ze!=null&&me.includes(String(Ze))}))},oe=P=>{if(!P||typeof P!="object")return[];if("var"in P)return[P.var];let j=[];return Object.values(P).forEach($=>{Array.isArray($)?$.forEach(I=>{j=j.concat(oe(I))}):typeof $=="object"&&(j=j.concat(oe($)))}),j};e.watch(()=>u.value,P=>{if(!(P!=null&&P.sections))return;const j=new Set,$=I=>{I&&["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"].forEach(q=>{const se=I[q];Array.isArray(se)?se.forEach(me=>me.condition&&oe(me.condition).forEach(fe=>j.add(fe))):se&&oe(se).forEach(me=>j.add(me))})};P.sections.forEach(I=>{var q,se,me,fe,re;$(I.logic||((q=I.propsForm)==null?void 0:q.logic)),I.type==="WIZARD"&&((me=(se=I.propsWizard)==null?void 0:se.propsSteps)==null||me.forEach(ke=>$(ke.logic))),(((fe=I.propsForm)==null?void 0:fe.fields)||I.fields||[]).forEach(ke=>{var $e;$(ke.logic),($e=ke.logic)!=null&&$e.optionsFilterRule&&H(ke)}),I.type==="TABLE"&&((re=I.propsTable)!=null&&re.modelDatatable)&&(p[I.propsTable.modelDatatable]=p[I.propsTable.modelDatatable]||[])})},{immediate:!0});const M=(P,j)=>{var se;if(P.isHidden)return!0;const $=j?N(j):T.value,I=(se=P.logic)==null?void 0:se.visibleRule;if(I==null)return!0;const q=v(I,$,`VISIBLE-${P.model}`);return!!(typeof q=="object"?X(q,$,`VISIBLE-${P.model}`):q)},L=(P,j)=>{var se,me;const $=j?N(j):T.value,I=(se=P.logic)==null?void 0:se.requiredRule;if(I==null)return((me=P.props)==null?void 0:me.required)||!1;const q=v(I,$,`REQUIRED-${P.model}`);return!!(typeof q=="object"?"required"in q?q.required:X(q,$):q)},ee=(P,j)=>{var se,me;const $=j?N(j):T.value,I=(se=P.logic)==null?void 0:se.disabledRule;if(I==null)return((me=P.props)==null?void 0:me.disabled)||!1;const q=v(I,$,`DISABLED-${P.model}`);return!!(typeof q=="object"?"disabled"in q?q.disabled:X(q,$):q)},Q=P=>{var se;const j=P.propsForm||P.propsTable||P.propsWizard||P.props||{};let $=a.value==="id"?j.titleID||P.titleID||P.labelID:j.titleEN||P.titleEN||P.labelEN,I=a.value==="id"?j.descriptionID||P.descriptionID:j.descriptionEN||P.descriptionEN;const q=v((se=P.logic||j.logic)==null?void 0:se.labelingRule,T.value,"LABEL-SEC");return q&&($=a.value==="id"?q.labelID||q.titleID||q.title:q.labelEN||q.titleEN||q.title,I=a.value==="id"?q.descriptionID:q.descriptionEN),{title:$,description:I}},W=(P,j)=>{var me,fe;if(!P)return!0;const $=P.propsForm||P.propsTable||P.propsWizard||P.props||{},I=(me=P.logic||$.logic)==null?void 0:me.visibleRule,q=j?N(j):T.value;if(I!=null){const re=v(I,q,"VISIBLE-SEC");return!!(typeof re=="object"?X(re,q,"VISIBLE-SEC"):re)}if(P.type==="TABLE"&&((fe=$.headers)!=null&&fe.length))return!0;const se=$.fields||P.fields||[];return se.length===0||se.some(re=>M(re,j))},ie=()=>{var P;if((P=u.value)!=null&&P.sections)for(let j=0;j<3;j++){let $=!1;if(u.value.sections.forEach(I=>{var q;(((q=I.propsForm)==null?void 0:q.fields)||I.fields||[]).forEach(se=>{var fe;const me=(fe=se.logic)==null?void 0:fe.calculateRule;if(me&&typeof me=="object"){const re=Object.keys(me)[0],ke=X(me[re],T.value,`CALC-${re}`);ke!==void 0&&p[re]!==ke&&(p[re]=ke,$=!0)}})}),!$)break}},de=e.computed(()=>{var j;if(!((j=u.value)!=null&&j.sections))return!1;if(Object.keys(k).length>0)return!0;const P=$=>$.some(I=>M(I)&&L(I)&&(Array.isArray(p[I.model])?p[I.model].length===0:p[I.model]==null||p[I.model]===""));return u.value.sections.some($=>{var I;return P(((I=$.propsForm)==null?void 0:I.fields)||$.fields||[])?!0:$.type==="WIZARD"?B($).some(q=>P(q.sections.flatMap(se=>se.fields||[]))):!1})}),Ce=(P,j)=>j?j.split(".").reduce(($,I)=>$==null?void 0:$[I],P):void 0,Ne=(P,j,$)=>{const I=j.split(".");let q=P;for(let se=0;se<I.length-1;se++)q=q[I[se]]=q[I[se]]||{};q[I[I.length-1]]=$},be=P=>{const j=e.toRaw(P);if(Array.isArray(j))return j.map($=>be($));if(j&&typeof j=="object"){const $={};return Object.keys(j).forEach(I=>$[I]=be(j[I])),$}return j},J=()=>{var $;if(!(($=u.value)!=null&&$.sections))return{...p};const P={},j=new Set;return u.value.sections.forEach(I=>{var me,fe;if(!W(I))return;const q=C(I),se=(re,ke)=>{if(M(re)&&re.model){const $e=Ce(p,ke?`${ke}.${re.model}`:re.model)??p[re.model];P[re.model]=be($e)??null,j.add(re.model)}};if((((me=I.propsForm)==null?void 0:me.fields)||I.fields||[]).forEach(re=>{var ke;return se(re,q||((ke=I.propsForm)==null?void 0:ke.key))}),I.type==="WIZARD"&&B(I).forEach(re=>re.sections.forEach(ke=>(ke.fields||[]).forEach($e=>se($e,re.key)))),(fe=I.propsTable)!=null&&fe.modelDatatable){const re=I.propsTable.modelDatatable;P[re]=be(Ce(p,q?`${q}.${re}`:re)??p[re]),j.add(re)}}),["id","_id"].forEach(I=>{p[I]!==void 0&&!j.has(I)&&(P[I]=be(p[I]))}),P},F=(P,j)=>{const $=(P==null?void 0:P.data)!==void 0?P.data:P,I=Array.isArray($)?$[0]:$;I&&Object.entries(j).forEach(([q,se])=>{const me=I[se]??I[q];me!==void 0&&Ne(p,q,me)})},K=()=>{var $;const P=[],j=I=>{I==null||I.forEach(q=>{var me;if(q.type==="TABLE"||q.propsTable){const fe=q.propsTable||q;fe.modelDatatable&&P.push({key:fe.modelDatatable,subFields:(fe.headers||[]).map(re=>re.key)})}(((me=q.propsForm)==null?void 0:me.fields)||q.fields||[]).forEach(fe=>{var ke,$e;const re=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(fe.component);if(fe.model&&((ke=fe.props)!=null&&ke.multiple||(($e=fe.props)==null?void 0:$e.valueType)==="array"||re)){const Ze=fe.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];P.push({key:fe.model,subFields:Ze})}}),q.type==="WIZARD"&&B(q).forEach(fe=>j(fe.sections))})};return j(($=u.value)==null?void 0:$.sections),P},ae=(P,j)=>{const $={},I=q=>q&&typeof q=="object"?q._isLogicValue?q.id:q.id??q.code??q.value??q:q;return Object.entries(j).forEach(([q,se])=>{if(typeof se=="string"){const me=P[q]??Ce(p,q)??p[q];me!==void 0&&($[se]=I(me))}else if(Array.isArray(se)&&se[0]){const me=se[0],fe=Object.keys(me);let re=P[q]??Ce(p,q)??p[q];if(!Array.isArray(re)||re.length===0){const ke=K().find($e=>fe.some(Ze=>$e.subFields.includes(Ze)));if(ke){const $e=P[ke.key]??Ce(p,ke.key)??p[ke.key];Array.isArray($e)&&$e.length>0&&(re=$e)}}Array.isArray(re)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${q}:`,be(re)),$[q]=re.map((ke,$e)=>{const Ze={},at=be(ke);return Object.entries(me).forEach(([tt,bt])=>{const Ct=at[tt]??at[bt]??ke[tt]??ke[bt]??null;Ze[bt]=I(Ct)}),Ze}))}}),console.log("[DynamicForm][MAPPING-RESULT]",$),$},_e=P=>{var j,$,I,q;P.requireConfirm?(E.title=a.value==="id"?((j=P.propCustomMessage)==null?void 0:j.titleID)||"Konfirmasi":(($=P.propCustomMessage)==null?void 0:$.titleEN)||"Confirm",E.message=a.value==="id"?((I=P.propCustomMessage)==null?void 0:I.messageID)||"Lanjutkan?":((q=P.propCustomMessage)==null?void 0:q.messageEN)||"Continue?",E.action=P,E.visible=!0):ze(P)},Re=()=>{E.visible=!1,E.action&&ze(E.action)},ze=async P=>{var q,se;const j=P.propsActionGlobal||P.props||{},$=ae(J(),j.fieldMapping||P.fieldMapping||{});n("action",P,$);const I=j.endpointPropAction||P.endpointPropAction||j.endpoint||P.endpoint;if((j.type==="SUBMIT"||j.type==="ACTION")&&(I!=null&&I.apiUrl)){const me=We.loading(a.value==="id"?"Memproses...":"Processing..."),fe=m(I.apiUrl);try{const re=await s(fe,I.apiMethod||"POST",$),ke=(re==null?void 0:re.status)===!0||(re==null?void 0:re.success)===!0,$e=(re==null?void 0:re.message)||(ke?a.value==="id"?"Sukses":"Success":a.value==="id"?"Gagal":"Failed");We.update(me,{render:$e,type:ke?"success":"error",isLoading:!1,autoClose:ke?3e3:5e3}),ke?((j.fieldMapping||P.fieldMapping)&&F(re,j.fieldMapping||P.fieldMapping),n("success",re)):n("error",re)}catch(re){const ke=((se=(q=re.response)==null?void 0:q.data)==null?void 0:se.message)||re.message||(a.value==="id"?"Terjadi kesalahan":"An error occurred");We.update(me,{render:`Gagal: ${ke}`,type:"error",isLoading:!1,autoClose:5e3}),n("error",re)}}else j.type==="SUBMIT"&&n("submit",$);j.keyRedirect&&j.route&&i&&i.push(j.route)},He=()=>{var j,$;let P=!0;return($=(j=u.value)==null?void 0:j.sections)==null||$.forEach(I=>{var q;W(I)&&(((q=I.propsForm)==null?void 0:q.fields)||I.fields||[]).forEach(se=>{if(M(se)){const me=_(se,p[se.model]);me&&(k[se.model]=me,P=!1)}})}),P},Xe=async()=>{var P,j;if(He()){c.value=!0;try{const $=J(),I=(((P=u.value)==null?void 0:P.actions)||[]).find(se=>{var me;return se.type==="SUBMIT"||se.key==="SUBMIT"||((me=se.propsActionGlobal)==null?void 0:me.type)==="SUBMIT"}),q=(I==null?void 0:I.fieldMapping)||((j=I==null?void 0:I.propsActionGlobal)==null?void 0:j.fieldMapping);n("submit",q?ae($,q):$)}finally{c.value=!1}}},ot=()=>n("cancel"),Ie=(P,j,$)=>{var se;const I=$?`${$}.${P}`:P;Ne(p,I,j);const q=(se=V.value.get(P))==null?void 0:se.field;if(q){const me=_(q,j);me?k[P]=me:delete k[P]}n("update:model",J())},mt=P=>!P.permission||(t.isEditMode?P.permission!=="CREATE":P.permission!=="UPDATE"),pt=P=>{var $,I;if(($=P.fields)!=null&&$.length)return P.fields;const j=(P.actionTableGlobal||[]).find(q=>q.permission==="CREATE"||(q.key||"").toLowerCase().includes("add"));return(I=j==null?void 0:j.fieldActionGlobal)!=null&&I.length?j.fieldActionGlobal:(P.headers||[]).filter(q=>q.key&&q.key!=="no").map(q=>({key:q.key,model:q.key,component:"DCodeTextField"}))},Tt=P=>{var j;return!(P!=null&&P.apiUrl)&&!((j=P==null?void 0:P.endpointTable)!=null&&j.apiUrl)},G=P=>{if(!P)return!1;const j=(P.key||"").toLowerCase(),$=(P.permission||"").toUpperCase();return j==="detail"||j.includes("view")||$==="VIEW"},ue=P=>Array.isArray(p[P.modelDatatable])?p[P.modelDatatable]:[],Ee=e.ref(!1),Ue=e.ref(""),Me=e.ref("Plus"),te=e.ref([]),ce=e.reactive({}),he=e.reactive({}),Se=e.ref(""),et=e.ref(null),St=e.ref(!1),gn=e.ref(null),ko=e.ref(!1),wo=(P,j)=>{gn.value={propsTable:P,row:j},ko.value=!0},Ca=()=>{if(!gn.value)return;const{propsTable:P,row:j}=gn.value;ko.value=!1;const $=p[P.modelDatatable];if(Array.isArray($)){const I=$.indexOf(j);if(I!==-1)$.splice(I,1);else{const q=JSON.stringify(j,(me,fe)=>["no","_index"].includes(me)?void 0:fe),se=$.findIndex(me=>JSON.stringify(me,(fe,re)=>["no","_index"].includes(fe)?void 0:re)===q);se!==-1&&$.splice(se,1)}n("update:model",J())}},gt=(P,j)=>{ce[P]=j;const $=te.value.find(I=>I.model===P);if($){const I=_($,j);I?he[P]=I:delete he[P]}},sr=(P,j,$)=>{Se.value=P.modelDatatable||"",St.value=G(j),et.value=null,Ue.value=a.value==="id"?j.labelID||"Tambah Data":j.labelEN||"Add Data",Me.value=j.icon||"Plus";const I=pt(P);te.value=I,Object.keys(ce).forEach(q=>delete ce[q]),Object.keys(he).forEach(q=>delete he[q]),I.forEach(q=>ce[q.model]=$?$[q.model]??null:null),Ee.value=!0},Co=(P,j)=>{const{action:$,row:I}=j;if(/delete|trash/i.test($)){const re=p[P.modelDatatable];if(Array.isArray(re)){const ke=re.indexOf(I);if(ke!==-1)re.splice(ke,1);else{const $e=JSON.stringify(I,(at,tt)=>["no","_index"].includes(at)?void 0:tt),Ze=re.findIndex(at=>JSON.stringify(at,(tt,bt)=>["no","_index"].includes(tt)?void 0:bt)===$e);Ze!==-1&&re.splice(Ze,1)}}return}if(/detail|view/i.test($)){sr(P,{key:"detail",permission:"VIEW"},I);return}const q=P.modelDatatable||"";Se.value=q,St.value=!1,Ue.value=a.value==="id"?"Ubah Data":"Edit Data",Me.value="SquarePen";const se=p[q];let me=Array.isArray(se)?se.indexOf(I):-1;if(me===-1&&Array.isArray(se)){const re=JSON.stringify(I,(ke,$e)=>["no","_index"].includes(ke)?void 0:$e);me=se.findIndex(ke=>JSON.stringify(ke,($e,Ze)=>["no","_index"].includes($e)?void 0:Ze)===re)}et.value=me!==-1?me:null;const fe=pt(P);te.value=fe,Object.keys(ce).forEach(re=>delete ce[re]),fe.forEach(re=>ce[re.model]=I[re.model]??null),Ee.value=!0},Ea=()=>{let P=!0;if(te.value.forEach($=>{const I=_($,ce[$.model]);I&&(he[$.model]=I,P=!1)}),!P)return;const j=Se.value;j&&(p[j]=p[j]||[],et.value!==null?p[j].splice(et.value,1,{...ce}):p[j].push({...ce}),Ee.value=!1,n("update:model",J()))},Eo=(P=1)=>P<=1?"grid-cols-1":P===2?"grid-cols-1 md:grid-cols-2":P===3?"grid-cols-1 md:grid-cols-3":P===4?"grid-cols-1 md:grid-cols-4":P===6?"grid-cols-1 md:grid-cols-6":P===12?"grid-cols-1 md:grid-cols-12":"grid-cols-1 md:grid-cols-2",Ba=(P,j=1)=>{if(j<=1)return"col-span-1";const $=String(P.column||"HALF").toUpperCase();return $==="FULL"?`md:col-span-${j}`:$==="HALF"?`md:col-span-${Math.max(1,Math.floor(j/2))}`:$==="THIRD"?`md:col-span-${Math.max(1,Math.floor(j/3))}`:$==="QUARTER"?`md:col-span-${Math.max(1,Math.floor(j/4))}`:"col-span-1"},Bo=new Map,ir=new Map;return e.watch(()=>({...p}),P=>{var se;if(!((se=u.value)!=null&&se.sections))return;ie();const j=N(P),$=me=>{me.forEach(fe=>{var Ze;const re=C(fe),ke=W(fe,P);(((Ze=fe.propsForm)==null?void 0:Ze.fields)||fe.fields||[]).forEach(at=>{const tt=at.model;if(!tt)return;const bt=re?`${re}.${tt}`:tt,Ct=Ce(p,bt),bn=M(at,P)&&ke;Bo.get(tt)===!0&&bn===!1&&Ct!==null&&Ct!==void 0&&(console.log(`[DynamicForm][RESET-VISIBLE] ${tt} BEFORE:`,be(Ct)),Ne(p,bt,Array.isArray(Ct)?[]:null),console.log(`[DynamicForm][RESET-VISIBLE] ${tt} AFTER:`,be(Ce(p,bt)))),Bo.set(tt,bn);const Pn=at.logic;if(Pn&&bn){const A={};let z=!1;["lengthRule","optionsFilterRule","visibleRule"].forEach(Z=>{const R=Pn[Z];if(!R)return;const U=v(R,j,`${Z}-${tt}`),ne=JSON.stringify(U);A[Z]=ne;const ge=ir.get(tt);ge&&ge[Z]!==void 0&&ge[Z]!==ne&&(z=!0)}),z&&Ct!==null&&Ct!==void 0&&(console.log(`[DynamicForm][RESET-LOGIC] ${tt} due to rule change | BEFORE:`,be(Ct)),Ne(p,bt,Array.isArray(Ct)?[]:null),console.log(`[DynamicForm][RESET-LOGIC] ${tt} AFTER:`,be(Ce(p,bt)))),ir.set(tt,A)}}),fe.type==="WIZARD"&&B(fe).forEach(at=>$(at.sections))})};$(u.value.sections);const I=J()||{},q=JSON.stringify(I);q!==l&&(l=q,console.log("[DynamicForm] Emitting update:model:",I),n("update:model",I))},{deep:!0,immediate:!0}),e.watch(()=>t.model,P=>{P&&Object.keys(P).length>0?JSON.stringify(P)!==l&&(console.log("[DynamicForm] Received new model data:",P),Object.keys(P).forEach($=>{p[$]=P[$]}),console.log("[DynamicForm] Updated formData:",{...p})):console.log("[DynamicForm] Received empty or null model data")},{immediate:!0,deep:!0}),{t:o,locale:a,i18nLocale:r,apiUrl:s,router:i,isSubmitting:c,internalSchema:d,activeSchema:u,resolvedBaseUrl:f,resolveEndpointUrl:m,radioGroups:h,formData:p,errors:k,wizardState:x,inlineState:g,fieldErrors:S,confirmDialog:E,getSectionKey:C,getWizardTabs:B,sortedFields:w,resolveFieldLabels:y,resolveFieldLength:b,validateField:_,fieldMap:V,resolveValueIdentifier:D,getNormalizedData:N,normalizedData:T,resolveActiveRule:v,evaluateLogic:X,rawItemsCache:O,prefetchFieldItems:H,getFilteredItems:Y,extractVars:oe,isFieldVisible:M,isFieldRequired:L,isFieldDisabled:ee,resolveSectionLabels:Q,isSectionVisible:W,applyCalculations:ie,isSubmitDisabled:de,getDeepValue:Ce,setDeepValue:Ne,deepRaw:be,getCleanPayload:J,handleResponseMapping:F,getFormArrayModels:K,applyFieldMapping:ae,handleGlobalButtonClick:_e,confirmAction:Re,performAction:ze,validateAll:He,handleSubmit:Xe,handleCancel:ot,handleFieldUpdate:Ie,isActionVisible:mt,resolveTableFields:pt,isTemporaryTable:Tt,isActionViewOnly:G,tableRows:ue,tableDialogOpen:Ee,tableDialogTitle:Ue,tableDialogIcon:Me,tableDialogFields:te,tableRowFormData:ce,tableRowErrors:he,activeTableKey:Se,editingRowIndex:et,tableDialogViewOnly:St,confirmDeletePending:gn,confirmDeleteOpen:ko,confirmTableDelete:wo,executeTableDelete:Ca,handleTableRowUpdate:gt,openTableRowDialog:sr,handleDataTableAction:Co,saveTableRow:Ea,resolveSectionGridClass:Eo,resolveFieldColumnClass:Ba}}const sV={key:0},iV=["value","name"],lV={key:1,class:"flex flex-col gap-1"},cV={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},dV=["src"],uV={key:1,class:"text-sm text-neutral-400 italic"},fV={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},mV={key:3,class:"text-xs text-neutral-400 italic"},ar=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},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=Ot.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,x=>{s.value=x});const i={DCodeTextField:no,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:po,DCodeTextArea:po,DCodeCheckbox:pn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia,DCodeRadio:Js,DCodeRadioCustom:Qs,DCodeDynamicUploadList:Ls,DCodeMultiSelect:Ys,DCodeCurrencyField:Is,DCodePermissionMenu:ei,DCodeTreePermissions:ti,DCodeCardCheckboxList:Rs,DCodeBeforeAfter:Ka,DCodeListLabels:Ya},l=e.computed(()=>{const x=r.field.component;return i[x]||null}),c=e.computed(()=>{var g;const x=((g=r.field.component)==null?void 0:g.toLowerCase())||"";return x.includes("image")||x.includes("upload")}),d=e.computed(()=>{var g;const x=((g=r.field.component)==null?void 0:g.toLowerCase())||"";return x.includes("switch")||x.includes("checkbox")}),u=e.computed(()=>{var E,C;const x=r.field.props||r.field.propsFieldGlobal||{},g=((E=r.dynamicLabels)==null?void 0:E.labelID)||x.labelID,S=((C=r.dynamicLabels)==null?void 0:C.labelEN)||x.labelEN;return o.value==="id"?g||S||r.field.model:S||g||r.field.model}),f=e.computed(()=>{const x=r.modelValue;return x==null||x===""?null:Array.isArray(x)?x.map(g=>typeof g=="object"&&g!==null?g.label||g.name||g.code||g.value||JSON.stringify(g):String(g)).join(", "):typeof x=="object"?x.label||x.name||x.code||x.value||x.id||JSON.stringify(x):String(x)}),m=(x,g)=>{const S={label:"",placeholder:""},E=(g==null?void 0:g.labelID)||x.labelID,C=(g==null?void 0:g.labelEN)||x.labelEN;(E||C)&&(S.label=o.value==="id"?E:C);const B=(g==null?void 0:g.placeholderID)||x.placeholderID,w=(g==null?void 0:g.placeholderEN)||x.placeholderEN;return(B||w)&&(S.placeholder=o.value==="id"?B:w),S},h=(x,g)=>{const S=x.endpoint||{};if(!S.apiUrl)return{};const E={};let C=!0;if(Array.isArray(S.keyParam)&&S.keyParam.length>0&&S.keyParam.forEach(w=>{const y=g?g[w]:null;y!=null&&y!==""?E[w]=y:C=!1}),!C)return{};let B=S.apiUrl;if(r.baseUrl&&typeof B=="string"&&!B.startsWith("http")){const w=r.baseUrl.replace(/\/$/,""),y=B.startsWith("/")?B:`/${B}`;B=`${w}${y}`}return{endpoint:{apiUrl:B,apiMethod:S.apiMethod||"GET"},...Object.keys(E).length?{apiParams:E}:{}}},p=e.computed(()=>{var C,B,w;const x=r.field.props||r.field.propsFieldGlobal||{},g={},S=m(x,r.dynamicLabels);if(S.label&&(g.label=S.label),S.placeholder&&(g.placeholder=S.placeholder),g.required=r.required!==void 0?r.required:x.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(y=>{x[y]!==void 0&&x[y]!==null&&(g[y]=x[y])}),g.minLength=((C=r.dynamicLength)==null?void 0:C.minLength)??x.minLength,g.maxLength=((B=r.dynamicLength)==null?void 0:B.maxLength)??x.maxLength,x.valueType&&(g.type=x.valueType),r.error&&(g.error=r.error),Object.assign(g,h(x,r.formData)),(w=x.endpointReference)!=null&&w.apiUrl){let y=x.endpointReference.apiUrl;if(r.baseUrl&&typeof y=="string"&&!y.startsWith("http")){const b=r.baseUrl.replace(/\/$/,""),_=y.startsWith("/")?y:`/${y}`;y=`${b}${_}`}g.endpointReference={...x.endpointReference,apiUrl:y}}return r.options&&r.options.length>0&&(g.items=r.options,g.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete g.endpoint,delete g.apiParams,delete g.apiUrl)),r.baseUrl&&(g.baseUrl=r.baseUrl),g}),k=x=>{s.value=x,a("update:modelValue",x)};return(x,g)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",sV,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,iV)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",lV,[e.createElementVNode("span",cV,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,dV)):(e.openBlock(),e.createElementBlock("span",uV,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",fV,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},p.value,{modelValue:s.value,"onUpdate:modelValue":[g[0]||(g[0]=S=>s.value=S),k]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",mV," Unknown field: "+e.toDisplayString(t.field.component),1))}}),hV={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},pV={key:0,class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},gV={key:0,class:"px-4 py-3"},bV={class:"text-sm font-semibold text-white"},yV={class:"px-4 py-3 flex items-center gap-2"},xV=e.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{resolveSectionLabels:o,isActionVisible:r,handleGlobalButtonClick:a,locale:s,t:i,handleCancel:l,sortedFields:c,isFieldVisible:d,getDeepValue:u,formData:f,getSectionKey:m,isFieldRequired:h,isFieldDisabled:p,getFilteredItems:k,errors:x,resolveFieldLabels:g,resolveFieldLength:S,resolvedBaseUrl:E,handleFieldUpdate:C,resolveSectionGridClass:B,resolveFieldColumnClass:w}=n;return(y,b)=>{var _,V;return e.openBlock(),e.createElementBlock("div",hV,[((_=t.section.type)==null?void 0:_.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",pV,[e.unref(o)(t.section).title?(e.openBlock(),e.createElementBlock("div",gV,[e.createElementVNode("h3",bV,e.toDisplayString(e.unref(o)(t.section).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",yV,[(V=t.section.propsForm.actionSection)!=null&&V.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsForm.actionSection,(D,N)=>{var T,v,X,O,H,Y,oe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:N},[e.unref(r)(D)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:D.icon||((T=D.propsActionGlobal)==null?void 0:T.icon),text:e.unref(s)==="id"?D.labelID||((v=D.propsActionGlobal)==null?void 0:v.labelID):D.labelEN||((X=D.propsActionGlobal)==null?void 0:X.labelEN),"bg-color":((H=D.bgColor||((O=D.propsActionGlobal)==null?void 0:O.bgColor))==null?void 0:H.toLowerCase())||"primary",variant:((oe=D.variant||((Y=D.propsActionGlobal)==null?void 0:Y.variant))==null?void 0:oe.toLowerCase())||"outline",size:"sm",onClick:M=>e.unref(a)(D)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),t.sIdx===0?(e.openBlock(),e.createBlock(Ke,{key:1,size:"sm",icon:"List",text:e.unref(i)("common.back"),variant:"outline",onClick:e.unref(l)},null,8,["text","onClick"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",e.unref(B)(t.section.propsForm.layoutColumns)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c)(t.section.propsForm.fields),D=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D.key},[e.unref(d)(D)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(w)(D,t.section.propsForm.layoutColumns))},[e.createVNode(ar,{field:D,"model-value":e.unref(u)(e.unref(f),e.unref(m)(t.section)?`${e.unref(m)(t.section)}.${D.model}`:D.model)??e.unref(f)[D.model],"form-data":e.unref(f),required:e.unref(h)(D),disabled:e.unref(p)(D),options:e.unref(k)(D),error:e.unref(x)[D.model],"dynamic-labels":e.unref(g)(D),"dynamic-length":e.unref(S)(D),"base-url":e.unref(E),"onUpdate:modelValue":N=>e.unref(C)(D.model,N,e.unref(m)(t.section))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])}}}),kV={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},wV={class:"flex items-center justify-center gap-1"},CV=["onClick"],EV=["onClick"],BV=["onClick"],_V=e.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{tableRows:o,isTemporaryTable:r,handleDataTableAction:a,locale:s,openTableRowDialog:i,resolveTableFields:l,confirmTableDelete:c,resolvedBaseUrl:d}=n;return(u,f)=>(e.openBlock(),e.createElementBlock("div",kV,[e.createVNode(xo,{"table-config":t.section.propsTable,data:e.unref(o)(t.section.propsTable),nested:!0,"show-pagination":t.section.propsTable.pagination??!0,"has-actions":e.unref(r)(t.section.propsTable),"base-url":e.unref(d),"dummy-mode":t.dummyMode,onAction:f[1]||(f[1]=m=>e.unref(a)(t.section.propsTable,m))},e.createSlots({"header-actions":e.withCtx(()=>{var m;return[(m=t.section.propsTable.actionTableGlobal)!=null&&m.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsTable.actionTableGlobal,(h,p)=>{var k,x;return e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[h.propsActionGlobal?(e.openBlock(),e.createBlock(Ke,{key:0,icon:h.propsActionGlobal.icon,text:e.unref(s)==="id"?h.propsActionGlobal.labelID||h.labelID:h.propsActionGlobal.labelEN||h.labelEN,"bg-color":((k=h.propsActionGlobal.bgColor)==null?void 0:k.toLowerCase())||"primary",variant:((x=h.propsActionGlobal.variant)==null?void 0:x.toLowerCase())||"default",size:"sm",class:"h-8 shadow-none",onClick:g=>e.unref(i)(t.section.propsTable,h)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.unref(r)(t.section.propsTable)?(e.openBlock(),e.createBlock(Ke,{key:1,icon:"Plus",text:e.unref(s)==="id"?"Tambah Data":"Add Data","bg-color":"primary",variant:"default",size:"sm",class:"h-8 shadow-none",onClick:f[0]||(f[0]=h=>e.unref(i)(t.section.propsTable,{key:"add_data_auto",permission:"CREATE",labelID:"Tambah Data",labelEN:"Add Data",fieldActionGlobal:e.unref(l)(t.section.propsTable)}))},null,8,["text"])):e.createCommentVNode("",!0)]}),_:2},[e.unref(r)(t.section.propsTable)?{name:"actions",fn:e.withCtx(({row:m})=>[e.createElementVNode("div",wV,[e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-primary-600 hover:bg-primary-50 dark:hover:bg-primary-900/30",onClick:e.withModifiers(h=>e.unref(i)(t.section.propsTable,{key:"detail",permission:"VIEW",labelID:"Detail",labelEN:"Detail",fieldActionGlobal:e.unref(l)(t.section.propsTable)},m),["stop"]),title:"Detail"},[...f[2]||(f[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],8,CV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-warning-600 hover:bg-warning-50 dark:hover:bg-warning-900/30",onClick:e.withModifiers(h=>e.unref(a)(t.section.propsTable,{action:"edit",row:m}),["stop"]),title:"Edit"},[...f[3]||(f[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.createElementVNode("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,EV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-danger-500 hover:bg-danger-50 dark:hover:bg-danger-900/30",onClick:e.withModifiers(h=>e.unref(c)(t.section.propsTable,m),["stop"]),title:"Hapus"},[...f[4]||(f[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),e.createElementVNode("path",{d:"M10 11v6"}),e.createElementVNode("path",{d:"M14 11v6"}),e.createElementVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})],-1)])],8,BV)])]),key:"0"}:void 0]),1032,["table-config","data","show-pagination","has-actions","base-url","dummy-mode"])]))}}),SV={class:"w-full"},VV={class:"space-y-6 mt-4"},AV={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},DV={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},NV={key:1,class:"text-xs text-neutral-500"},MV={key:0,class:"flex items-center gap-2"},TV={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},PV={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},vV=e.defineComponent({__name:"DynamicWizardSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{getWizardTabs:o,wizardState:r,getSectionKey:a,isSubmitting:s,isActionVisible:i,locale:l,handleGlobalButtonClick:c,isSectionVisible:d,sortedFields:u,isFieldVisible:f,getDeepValue:m,formData:h,isFieldRequired:p,isFieldDisabled:k,getFilteredItems:x,errors:g,resolveFieldLabels:S,resolveFieldLength:E,resolvedBaseUrl:C,handleFieldUpdate:B,tableRows:w,handleDataTableAction:y,resolveSectionGridClass:b,resolveFieldColumnClass:_}=n;return(V,D)=>{var N;return e.openBlock(),e.createElementBlock("div",SV,[e.createVNode(Zs,{tabs:e.unref(o)(t.section),modelValue:e.unref(r)[e.unref(a)(t.section)],"onUpdate:modelValue":D[0]||(D[0]=T=>e.unref(r)[e.unref(a)(t.section)]=T),"is-vertical":t.section.propsWizard.isVertical,"is-wizard":t.section.propsWizard.isWizard,"type-wizard":((N=t.section.propsWizard.typeWizard)==null?void 0:N.toLowerCase())||"icon",loading:e.unref(s)},e.createSlots({_:2},[e.renderList(e.unref(o)(t.section),T=>({name:`tab-${T.key}`,fn:e.withCtx(()=>{var v,X;return[e.createElementVNode("div",VV,[T.title||(v=T.actions)!=null&&v.length?(e.openBlock(),e.createElementBlock("div",AV,[e.createElementVNode("div",null,[T.title?(e.openBlock(),e.createElementBlock("h4",DV,e.toDisplayString(T.title),1)):e.createCommentVNode("",!0),T.description?(e.openBlock(),e.createElementBlock("p",NV,e.toDisplayString(T.description),1)):e.createCommentVNode("",!0)]),(X=T.actions)!=null&&X.length?(e.openBlock(),e.createElementBlock("div",MV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.actions,(O,H)=>{var Y,oe,M,L,ee,Q,W;return e.openBlock(),e.createElementBlock(e.Fragment,{key:H},[e.unref(i)(O)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:O.icon||((Y=O.propsActionGlobal)==null?void 0:Y.icon),text:e.unref(l)==="id"?O.labelID||((oe=O.propsActionGlobal)==null?void 0:oe.labelID):O.labelEN||((M=O.propsActionGlobal)==null?void 0:M.labelEN),"bg-color":((ee=O.bgColor||((L=O.propsActionGlobal)==null?void 0:L.bgColor))==null?void 0:ee.toLowerCase())||"primary",variant:((W=O.variant||((Q=O.propsActionGlobal)==null?void 0:Q.variant))==null?void 0:W.toLowerCase())||"tonal",size:"sm",onClick:ie=>e.unref(c)(O)},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(T.sections,(O,H)=>{var Y,oe,M;return e.openBlock(),e.createElementBlock(e.Fragment,{key:H},[e.unref(d)(O)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((Y=O.type)==null?void 0:Y.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",e.unref(b)(O.layoutColumns)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u)(O.fields),L=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:L.key},[e.unref(f)(L)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(_)(L,O.layoutColumns))},[e.createVNode(ar,{field:L,"model-value":e.unref(m)(e.unref(h),e.unref(a)(O)?`${e.unref(a)(O)}.${L.model}`:L.model)??e.unref(h)[L.model],"form-data":e.unref(h),required:e.unref(p)(L),disabled:e.unref(k)(L),options:e.unref(x)(L),error:e.unref(g)[L.model],"dynamic-labels":e.unref(S)(L),"dynamic-length":e.unref(E)(L),"base-url":e.unref(C),"onUpdate:modelValue":ee=>e.unref(B)(L.model,ee,e.unref(a)(O))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((oe=O.type)==null?void 0:oe.toUpperCase())==="TABLE"||O.isDataTable?(e.openBlock(),e.createElementBlock("div",TV,[e.createVNode(xo,{"dummy-mode":t.dummyMode,"table-config":O.propsDataTableWizard||O.propsTable,data:e.unref(w)(O.propsDataTableWizard||O.propsTable),nested:!0,"show-pagination":((M=O.propsDataTableWizard||O.propsTable)==null?void 0:M.pagination)??!0,onAction:L=>e.unref(y)(O.propsDataTableWizard||O.propsTable,L)},null,8,["dummy-mode","table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",PV," Unknown section type: "+e.toDisplayString(O.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","is-vertical","is-wizard","type-wizard","loading"])])}}}),OV={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},FV={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},zV={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},RV=e.defineComponent({__name:"DynamicFormDialogs",setup(t){const n=e.inject("dynamicFormContext"),{confirmDialog:o,t:r,confirmAction:a,tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,tableRowFormData:u,tableDialogViewOnly:f,isFieldRequired:m,isFieldDisabled:h,getFilteredItems:p,tableRowErrors:k,resolveFieldLabels:x,resolveFieldLength:g,resolvedBaseUrl:S,handleTableRowUpdate:E,locale:C,saveTableRow:B,confirmDeleteOpen:w,executeTableDelete:y}=n;return(b,_)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(Mn,{modelValue:e.unref(o).visible,"onUpdate:modelValue":_[1]||(_[1]=V=>e.unref(o).visible=V),title:e.unref(o).title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(r)("common.cancel"),onClick:_[0]||(_[0]=V=>e.unref(o).visible=!1)},null,8,["text"]),e.createVNode(Ke,{text:e.unref(r)("common.confirm"),onClick:e.unref(a)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",OV,e.toDisplayString(e.unref(o).message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Mn,{modelValue:e.unref(s),"onUpdate:modelValue":_[3]||(_[3]=V=>e.isRef(s)?s.value=V:null),title:e.unref(i),icon:e.unref(l),"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(f)?e.unref(C)==="id"?"Tutup":"Close":e.unref(C)==="id"?"Batal":"Cancel",onClick:_[2]||(_[2]=V=>s.value=!1)},null,8,["text"]),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ke,{key:0,text:"Save",onClick:e.unref(B)},null,8,["onClick"]))]),default:e.withCtx(()=>[e.unref(c).length?(e.openBlock(),e.createElementBlock("div",FV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:e.normalizeClass(V.column==="FULL"?"md:col-span-2":"col-span-1")},[e.unref(d)(V,e.unref(u))?(e.openBlock(),e.createBlock(ar,{key:0,field:V,"model-value":e.unref(u)[V.model],"form-data":e.unref(u),required:e.unref(f)?!1:e.unref(m)(V,e.unref(u)),disabled:e.unref(f)||e.unref(h)(V,e.unref(u)),"view-only":e.unref(f),options:e.unref(p)(V,e.unref(u)),error:e.unref(f)?void 0:e.unref(k)[V.model],"dynamic-labels":e.unref(x)(V,e.unref(u)),"dynamic-length":e.unref(g)(V,e.unref(u)),"base-url":e.unref(S),"onUpdate:modelValue":D=>e.unref(E)(V.model,D)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Mn,{modelValue:e.unref(w),"onUpdate:modelValue":_[5]||(_[5]=V=>e.isRef(w)?w.value=V:null),title:e.unref(C)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(C)==="id"?"Batal":"Cancel",onClick:_[4]||(_[4]=V=>w.value=!1)},null,8,["text"]),e.createVNode(Ke,{variant:"default","bg-color":"danger",icon:"Trash2",text:e.unref(C)==="id"?"Hapus":"Delete",onClick:e.unref(y)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",zV,e.toDisplayString(e.unref(C)==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])]))}}),IV={class:"w-full space-y-6"},di=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},dummyMode:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){const o=t,a=aV(o,n);e.provide("dynamicFormContext",a);const{activeSchema:s,isSectionVisible:i,inlineState:l,isActionVisible:c,locale:d,isSubmitting:u,isSubmitDisabled:f,handleGlobalButtonClick:m,handleSubmit:h}=a;return(p,k)=>{var x,g,S,E,C,B;return e.openBlock(),e.createElementBlock("div",IV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((x=e.unref(s))==null?void 0:x.sections,(w,y)=>{var b,_,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[((b=w.type)==null?void 0:b.toUpperCase())==="FORM"&&w.propsForm&&e.unref(i)(w)?(e.openBlock(),e.createBlock(xV,{key:0,"dummy-mode":o.dummyMode,section:w,sIdx:Number(y)},null,8,["dummy-mode","section","sIdx"])):((_=w.type)==null?void 0:_.toUpperCase())==="TABLE"&&w.propsTable&&e.unref(i)(w)?(e.openBlock(),e.createBlock(_V,{key:1,"dummy-mode":o.dummyMode,section:w},null,8,["dummy-mode","section"])):((V=w.type)==null?void 0:V.toUpperCase())==="WIZARD"&&w.propsWizard&&e.unref(i)(w)?(e.openBlock(),e.createBlock(vV,{key:2,"dummy-mode":o.dummyMode,section:w},null,8,["dummy-mode","section"])):e.createCommentVNode("",!0)],64)}),128)),(g=e.unref(l))!=null&&g.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((E=(S=e.unref(s))==null?void 0:S.ui)==null?void 0:E.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(B=(C=e.unref(s))==null?void 0:C.actionGlobal)!=null&&B.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).actionGlobal,(w,y)=>{var b,_,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[w.propsActionGlobal&&e.unref(c)(w)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:w.propsActionGlobal.icon,text:e.unref(d)==="id"?w.propsActionGlobal.labelID:w.propsActionGlobal.labelEN,"bg-color":((b=w.propsActionGlobal.bgColor)==null?void 0:b.toLowerCase())||"primary",variant:((_=w.propsActionGlobal.variant)==null?void 0:_.toLowerCase())||"default",loading:e.unref(u),disabled:e.unref(f)&&(w.permission==="CREATE"||w.permission==="UPDATE"||((V=w.propsActionGlobal)==null?void 0:V.key)==="submit"),onClick:D=>e.unref(m)(w)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(Ke,{key:1,text:"Submit","bg-color":"primary",loading:e.unref(u),disabled:e.unref(f),onClick:e.unref(h)},null,8,["loading","disabled","onClick"]))],2)),e.createVNode(RV)])}}}),LV={"aria-label":"Breadcrumb"},$V={class:"flex flex-wrap items-center text-sm md:text-base"},jV={class:"truncate max-w-[100px] sm:max-w-[150px] md:max-w-none"},mu=e.defineComponent({__name:"Breadcrumb",props:{items:{},showHomeIcon:{type:Boolean,default:!0},iconSize:{default:18},separatorSize:{default:16},separatorType:{default:"chevron"},strokeWidth:{default:2}},setup(t){const n=t,o=le.Home,r=n.separatorType==="slash"?le.Slash:le.ChevronRight;return(a,s)=>(e.openBlock(),e.createElementBlock("nav",LV,[e.createElementVNode("ol",$V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.to?"router-link":"span"),{to:i.to,class:e.normalizeClass(["inline-flex items-center gap-1.5 transition-all duration-200 rounded-lg font-medium",i.to?"text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 cursor-pointer":"dark:text-gray-100 bg-primary-50 dark:bg-primary-900/30 text-primary-700"])},{default:e.withCtx(()=>[i.icon||l===0&&t.showHomeIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon||e.unref(o)),{key:0,size:t.iconSize,class:e.normalizeClass(["flex-shrink-0",i.to?"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-400":"text-primary-600 dark:text-primary-400",i.iconClass||""]),"stroke-width":t.strokeWidth},null,8,["size","class","stroke-width"])):e.createCommentVNode("",!0),e.createElementVNode("span",jV,e.toDisplayString(i.label),1)]),_:2},1032,["to","class"])),l<t.items.length-1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{key:0,size:t.separatorSize,class:"mx-1.5 text-gray-300 dark:text-gray-700 flex-shrink-0"},null,8,["size"])):e.createCommentVNode("",!0)]))),128))])]))}});function hu(){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 UV={class:"w-full space-y-6 animate-pulse"},WV={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},HV=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",UV,[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",WV,[(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))]))}}),qV={class:"w-full"},GV={class:"relative mx-auto min-h-[37.5rem]"},XV={key:"content",class:"w-full"},KV={class:"mb-6"},YV={class:"text-neutral-500 dark:text-neutral-400"},JV={key:"skeleton",class:"w-full"},QV={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},ui=Dt(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var N,T,v,X,O,H,Y,oe;const o=t,r=n,a=(T=(N=e.getCurrentInstance())==null?void 0:N.appContext)==null?void 0:T.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 M=vn.useRoute();if(M&&Object.keys(M).length>0)s=M;else{const L=e.getCurrentInstance();(O=(X=(v=L==null?void 0:L.appContext)==null?void 0:v.config)==null?void 0:X.globalProperties)!=null&&O.$route&&(s=L.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:M=>{typeof window<"u"&&(typeof M=="string"?window.location.href=M:M&&M.path&&(window.location.href=M.path))},__isFallback:!0};try{const M=vn.useRouter();if(M)i=M;else{const L=e.getCurrentInstance();(oe=(Y=(H=L==null?void 0:L.appContext)==null?void 0:H.config)==null?void 0:Y.globalProperties)!=null&&oe.$router&&(i=L.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=ct();let d;try{d=Ot.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=hu(),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 m=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const M=s.path.match(/\/edit\/([^\/]+)$/);return M?M[1]:null}),h=e.ref({}),p=e.ref(null),k=e.ref(!0),x=e.ref(!1),g="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",S="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",E=e.ref(o.layoutCode),C=e.computed(()=>{var ee;if(!p.value)return"";const M=((ee=d==null?void 0:d.value)==null?void 0:ee.toLowerCase())||"en";return(M==="en"||M.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});e.watch(C,M=>{M&&u(M)},{immediate:!0});const B=(M,L="")=>{const ee={};return!M||typeof M!="object"||Object.keys(M).forEach(Q=>{const W=M[Q],ie=L?`${L}.${Q}`:Q;W&&typeof W=="object"&&!Array.isArray(W)&&!(W instanceof Date)&&Object.assign(ee,B(W,ie)),ee[ie]=W}),ee},w=M=>{var W;if(!M||typeof M!="string"||M.startsWith("http"))return M;const L=(W=o.selectedTokenCore)==null?void 0:W.address;if(!L)return M;const ee=L.replace(/\/$/,""),Q=M.startsWith("/")?M:`/${M}`;return`${ee}${Q}`},y=async()=>{var M,L,ee,Q,W,ie;k.value=!0;try{let de=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(de=s.query.code||o.layoutCode);const Ce="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Ne=Ce?{Authorization:`Bearer ${Ce}`}:{},be=w(`${g}${de}`);let J=await l(be,"GET",null,Ne);if(!J.status||!J.data||Array.isArray(J.data)&&J.data.length===0)try{const F=w(`${S}${de}`),K=await l(F,"GET",null,Ne);if(K.status){const ae=Array.isArray(K.data)?K.data[0]:K.data;ae&&ae.code&&(de=ae.code,E.value=de,J=await l(w(`${g}${de}`),"GET",null,Ne))}}catch(F){console.warn("Failed to resolve layout code via datatable",F)}if(J.status){p.value=Array.isArray(J.data)?J.data[0]:J.data;const F={};if((M=p.value)!=null&&M.sections&&p.value.sections.forEach(K=>{((K.propsForm||K.props||{}).fields||K.fields||[]).forEach(Re=>{var He;const ze=Re.model||((He=Re.props)==null?void 0:He.model)||Re.key;ze&&(F[ze]=null)})}),h.value=F,k.value=!1,f.value&&m.value){x.value=!0;try{const K=(Q=(ee=(L=p.value.sections)==null?void 0:L[0])==null?void 0:ee.propsForm)==null?void 0:Q.endpointForm,ae=p.value.endpointForm,_e=K||ae;if(_e!=null&&_e.apiUrl){const Re=_e.apiUrl,ze=_e.apiMethod||"GET",He=_e.keyParam||[],Xe={};He.length>0?He.forEach(Ie=>{Xe[Ie]=m.value}):Xe.id=m.value;const ot=await c(w(Re),ze,Xe);if(console.log(`[AutoLayoutForm] API Result for ${Re}:`,ot),ot.status){let Ie=Array.isArray(ot.data)?ot.data[0]:ot.data;ot.payload&&(Ie={...Ie,...ot.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Ie);const mt=B(Ie);h.value={...h.value,...Ie,...mt},console.log("[AutoLayoutForm] Updated initialData:",h.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",ot)}else if((W=p.value.endpointGlobal)!=null&&W.apiUrl){const Re=p.value.endpointGlobal.apiUrl,ze=p.value.endpointGlobal.apiMethod||"GET",He={id:m.value},Xe=await c(w(Re),ze,He);if(Xe.status){const ot=Array.isArray(Xe.data)?Xe.data[0]:Xe.data,Ie=B(ot);h.value={...h.value,...ot,...Ie}}}else{const Re=((ie=p.value.endpoint)==null?void 0:ie.detailUrl)||`/api/${E.value}/detail/${m.value}`,ze=await l(w(Re),"GET");if(ze.status){let He=Array.isArray(ze.data)?ze.data[0]:ze.data;if(ze.payload){const Ie={...ze.payload};if(Object.keys(Ie).forEach(mt=>{He[mt]!==void 0&&He[mt]!==null&&(Ie[mt]=He[mt])}),!("id"in Ie)&&He.id){const mt=Object.keys(Ie).find(pt=>pt.startsWith("id")&&pt.length>2&&!Ie[pt]);mt&&(Ie[mt]=He.id)}He=Ie}const Xe={...He};Object.keys(h.value).forEach(Ie=>{if(Xe[Ie]===void 0||Xe[Ie]===null){if(Ie.toLowerCase().startsWith("id")&&Ie.length>2){const pt=Ie.substring(2).toLowerCase(),Tt=Array.isArray(ze.data)?ze.data[0]:ze.data,G=Object.keys(Tt).find(ue=>ue.toLowerCase()===pt);G&&Tt[G]&&typeof Tt[G]=="object"&&"id"in Tt[G]&&(Xe[Ie]=Tt[G].id)}if(Ie==="idSupervisor"){const pt=Array.isArray(ze.data)?ze.data[0]:ze.data;pt.supervisorId&&(Xe[Ie]=pt.supervisorId)}}});const ot=B(Xe);h.value={...h.value,...Xe,...ot}}}}catch(K){console.error("Failed to fetch record data:",K)}finally{x.value=!1}}}}catch(de){console.error("Failed to load form layout:",de),k.value=!1}},b=M=>{const L=Object.keys(h.value||{}).filter(Q=>h.value[Q]!==null&&h.value[Q]!==void 0),ee=Object.keys(M||{}).filter(Q=>M[Q]!==null&&M[Q]!==void 0);if(L.length>3&&ee.length<L.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:L.length,incomingCount:ee.length,data:M});return}console.log("[AutoLayoutForm] Allowing model update:",M),h.value=M,r("update:model",M)},_=async M=>{var L,ee,Q;try{const W=(Q=(ee=(L=p.value.sections)==null?void 0:L[0])==null?void 0:ee.propsForm)==null?void 0:Q.endpointForm,ie=p.value.endpointGlobal||p.value.endpoint,de=(W==null?void 0:W.submitUrl)||(ie==null?void 0:ie.submitUrl)||`/api/generic/${o.layoutCode}`,Ce=(W==null?void 0:W.submitMethod)||(ie==null?void 0:ie.submitMethod)||(f.value?"PUT":"POST"),Ne=Object.values(M).some(J=>J instanceof File||J instanceof Blob);let be;Ne?(be=new FormData,Object.keys(M).forEach(J=>{const F=M[J];F!=null&&(Array.isArray(F)?F.forEach(K=>be.append(`${J}[]`,K)):be.append(J,F))})):(be={...M},f.value&&m.value&&!be.id&&(be.id=m.value)),await l(w(de),Ce,be),r("submit-success",be),i.back()}catch(W){console.error("Submit failed:",W)}},V=async(M,L,ee)=>{if(M==="cancel"){D();return}const Q=L.endpointPropAction||L.propsActionGlobal&&L.propsActionGlobal.endpointPropAction;if(Q)try{k.value=!0;const W=ee?{...ee}:{...h.value};f.value&&L.model&&m.value&&(W[L.model]=m.value);const ie=Q.apiUrl,de=Q.apiMethod||"POST";(await c(w(ie),de,W)).status&&(r("action-success",M,L,W),i.back())}catch(W){console.error("Action failed:",W)}finally{k.value=!1}},D=()=>{r("cancel"),i.back()};return e.onMounted(()=>{y()}),e.watch(()=>o.model,M=>{M&&Object.keys(M).length>0&&(h.value={...h.value,...M})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(M,L)=>(e.openBlock(),e.createElementBlock("div",qV,[e.createElementVNode("div",GV,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!k.value&&p.value?(e.openBlock(),e.createElementBlock("div",XV,[e.createElementVNode("div",KV,[e.createElementVNode("p",YV,e.toDisplayString(p.value.description),1)]),e.createVNode(di,{schema:p.value,model:h.value,"is-edit-mode":f.value,loading:x.value,"selected-token-core":o.selectedTokenCore,"onUpdate:model":L[0]||(L[0]=ee=>b(ee)),onSubmit:_,onCancel:D,onAction:V,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core"])])):k.value?(e.openBlock(),e.createElementBlock("div",JV,[e.createVNode(HV)])):(e.openBlock(),e.createElementBlock("div",QV," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-3c619a9c"]]),ZV={class:"h-full flex flex-col"},eA={key:1,class:"flex-1 flex items-center justify-center"},tA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},fi=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var B,w,y,b,_,V;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=ct();let i={query:{},params:{},path:""};try{const D=vn.useRoute();D?i=D:(y=(w=(B=a==null?void 0:a.appContext)==null?void 0:B.config)==null?void 0:w.globalProperties)!=null&&y.$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:D=>{typeof window<"u"&&(typeof D=="string"?window.location.href=D:D&&D.path&&(window.location.href=D.path))}};try{const D=vn.useRouter();D?l=D:(V=(_=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:_.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),m=e.ref(null),h="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",p=e.computed(()=>`${h}${o.layoutCode}`),{setPageTitle:k}=hu();let x;try{x=Ot.useI18n().locale}catch{x=e.ref("en")}const g=()=>{if(u.value){const N=(x.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";k(N)}};e.watch(x,()=>{g()});const S=async()=>{f.value=!0;try{const D="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",N=D?{Authorization:`Bearer ${D}`}:{},T=await s(p.value,"GET",null,N);T.status&&(u.value=Array.isArray(T.data)?T.data[0]:T.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),g())}catch(D){console.error("Gagal Menampilkan Datatable:",D)}finally{f.value=!1}},E=D=>{D.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",D.action,D)},C=D=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",D);let N=D.route;const T=D.path;if(!N&&T){const X=((i==null?void 0:i.path)||"").split("/");X.length>=2&&(N=`/${X[1]}/create`)}if(N||T){const v={...D.query||{},code:T||void 0};Object.keys(v).forEach(X=>v[X]===void 0&&delete v[X]),console.log("[DEBUG] Emitting navigate to parent:",{route:N,query:v}),r("navigate",{route:N||"/form",query:v}),l&&!l.__isFallback&&l.push({path:N||"/form",query:v})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{S()}),(D,N)=>(e.openBlock(),e.createElementBlock("div",ZV,[!f.value&&u.value?(e.openBlock(),e.createBlock(xo,{key:0,ref_key:"dtRef",ref:m,"api-url":p.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:E,onNavigate:C},{"header-actions":e.withCtx(()=>[...N[0]||(N[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",eA,[...N[1]||(N[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",tA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),pu=e.defineCustomElement(ui),gu=e.defineCustomElement(fi);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",pu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",gu));const nA=[gr,zi,Ke,bl,Ka,Ya,Vd,pn,Rs,Is,oa,Mn,Wd,ra,Hd,qs,Ls,qd,Xs,aa,Ks,ho,Ys,sa,Gd,Xd,Js,Qs,ia,la,no,po,Qd,Zd,Zs,ei,ti,ci,xo,ui,fi,di,mu,ar],bu={install(t,n={}){n&&Object.keys(n).length>0&&pi(n),nA.forEach(o=>{o.name&&t.component(o.name,o)})}};pe.AutoLayoutDatatable=fi,pe.AutoLayoutForm=ui,pe.Breadcrumb=mu,pe.DCodeAutoComplete=gr,pe.DCodeBadge=ci,pe.DCodeBeforeAfter=Ka,pe.DCodeButton=Ke,pe.DCodeCard=bl,pe.DCodeCardCheckboxList=Rs,pe.DCodeChart=Vd,pe.DCodeCheckbox=pn,pe.DCodeCurrencyField=Is,pe.DCodeDatePicker=oa,pe.DCodeDialog=Mn,pe.DCodeDialogCloseBtn=Wd,pe.DCodeDropzone=ra,pe.DCodeDynamicUploadList=Ls,pe.DCodeFileField=Hd,pe.DCodeFileResult=qs,pe.DCodeIconDropdown=qd,pe.DCodeImageCropperDialog=Xs,pe.DCodeImageField=aa,pe.DCodeImageResult=Ks,pe.DCodeInfiniteAutoComplete=zi,pe.DCodeLabel=ho,pe.DCodeListLabels=Ya,pe.DCodeMultiSelect=Ys,pe.DCodeOtpInput=sa,pe.DCodePermissionMenu=ei,pe.DCodeProgress=Gd,pe.DCodeProgressBar=Xd,pe.DCodeRadio=Js,pe.DCodeRadioCustom=Qs,pe.DCodeSlider=ia,pe.DCodeSwitch=la,pe.DCodeTextField=no,pe.DCodeTextarea=po,pe.DCodeTimelineWithIcons=Qd,pe.DCodeTreePermissions=ti,pe.DCodeUploadFile=Zd,pe.DCodeWizard=Zs,pe.DataTable=xo,pe.DataTableComponent=xo,pe.DynamicForm=di,pe.DynamicFormField=ar,pe.DynamicUI=bu,pe.MicroDynamicDatatable=gu,pe.MicroDynamicForm=pu,pe.cn=Oe,pe.default=bu,pe.setApiConfig=pi,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
95
+ `});return(V,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(So),{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",R1,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",I1,[t.showValue?(e.openBlock(),e.createElementBlock("div",L1,[e.createElementVNode("span",$1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",j1,e.toDisplayString(h.value),1),e.createElementVNode("span",U1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[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:`${k.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:C,onChange:w,onMousedown:p,onMouseup:A,onTouchstart:p,onTouchend:A},null,42,H1)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,g=>(e.openBlock(),e.createElementBlock("div",{key:g.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${D(g.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",G1,e.toDisplayString(g.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",K1,[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),S.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),Y1={class:"grid gap-3"},J1={key:0,class:"ml-1 text-destructive"},Q1={class:"inline-flex items-center gap-3"},Z1=["id","name","aria-checked","aria-label","disabled"],eC={key:0,class:"absolute inset-0 flex items-center justify-center"},tC={class:"relative z-10 flex items-center gap-2"},nC=["id","name","aria-checked","aria-label","disabled"],oC={key:0,class:"absolute inset-0 flex items-center justify-center"},rC={name:"DCodeSwitch"},Nr=e.defineComponent({...rC,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,m)=>(e.openBlock(),e.createElementBlock("div",Y1,[t.title?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",J1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Q1,[e.createVNode(e.unref(Wi),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ji),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"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",eC,[...m[0]||(m[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(te.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(te.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,Z1)]),_:1}),e.createVNode(e.unref(Ui),{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",tC,[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",oC,[...m[1]||(m[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(te.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(te.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})])]))}}),aC=["aria-busy"],sC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},iC=["for"],lC={key:0,class:"ml-1 text-destructive"},cC={class:"relative w-full group"},dC=["id","value"],uC={key:0,class:"absolute top-1 right-2"},fC={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"},mC={key:1,class:"text-xs text-destructive"},qn=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 X=o.required,O=o["aria-required"];return X===""||X===!0||X==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:X,class:O,id:K,required:ee,"aria-required":he,...Ve}=o;return Ve}),f=e.computed(()=>{const X=o.maxlength;let O=Number.NaN;return typeof X=="number"?O=X:typeof X=="string"&&(O=Number.parseInt(X,10)),Number.isFinite(O)&&O>0?O:-1}),m=X=>f.value>0?X.slice(0,f.value):X,h=e.computed(()=>{const X=a.modelValue;return X==null||String(X).length===0}),k=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!h.value:!0:!1),C=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,X=>{const O=String(X??"");O!==C.value&&(C.value=O)});const w=e.ref(!1),p=e.ref(!1),A=X=>X.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const K=O.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),D=X=>{const O=X.toLowerCase(),K=O.search(new RegExp("\\p{L}","u"));return K<0?O:O.slice(0,K)+O.charAt(K).toUpperCase()+O.slice(K+1)},S=X=>{switch(a.textCase){case"uppercase":return X.toUpperCase();case"lowercase":return X.toLowerCase();case"titlecase":return A(X);case"sentencecase":return D(X);case"none":default:return X}},V=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=X=>{if(!X)return null;const O=Array.isArray(X)?X.join(""):X;return O?new Set(O):null},g=e.computed(()=>B(a.allowChars)),b=(X,O)=>(X.lastIndex=0,X.test(O)),_=X=>{if(X===`
96
+ `)return a.valueType!=="number";if(a.valueType==="free")return!0;const O=X===" ",K=/\d/.test(X),ee=new RegExp("\\p{L}","u").test(X),he=new RegExp("\\p{N}","u").test(X);return a.valueType==="number"?K:a.valueType==="letter"?ee||a.allowSpaces&&O:a.valueType==="letternumber"?ee||he||a.allowSpaces&&O:!0},y=X=>{let O="";for(const K of X){const ee=!!g.value&&g.value.has(K);a.pattern&&!ee&&!b(a.pattern,K)||!ee&&!_(K)||(O+=K)}return O},x=X=>{const O=y(X),K=a.applyTextCaseToValue?S(O):O;return m(K)};let E=null;const M=X=>{if(X==="")return null;if(a.valueType==="number"&&a.returnNumber){const O=X.replaceAll(`
97
+ `,""),K=Number(O);return Number.isFinite(K)?K:null}return X},T=X=>{C.value=X,r("update:modelValue",M(X))},$=(X,O)=>{const K=m(O);p.value=!0,X.value=K,T(K),queueMicrotask(()=>p.value=!1)},v=(X,O)=>{const K=X.selectionStart??X.value.length,ee=X.selectionEnd??X.value.length;if(f.value>0){const he=X.value.length-(ee-K),Ve=f.value-he;if(Ve<=0)return;O=O.slice(0,Ve)}X.setRangeText(O,K,ee,"end"),$(X,x(X.value))},I=X=>{var ee;if(!E||w.value||p.value||!((ee=X.inputType)!=null&&ee.startsWith("insert")))return;const O=X.data;if(O==null)return;const K=x(O);K!==O&&(X.preventDefault(),K.length>0&&v(E,K))},j=X=>{var ee;if(!E||w.value||p.value)return;const O=((ee=X.clipboardData)==null?void 0:ee.getData("text"))??"",K=x(O);K!==O&&(X.preventDefault(),K.length>0&&v(E,K))},U=async X=>{if(!E||w.value||p.value)return;const O=X.target,K=O.value??"",ee=x(K);if(ee===K){const he=O.selectionStart??ee.length,Ve=O.selectionEnd??ee.length;$(O,ee),await e.nextTick();try{O.setSelectionRange(he,Ve)}catch{}T(ee)}else{const he=O.selectionStart??ee.length,Ve=O.selectionEnd??ee.length;$(O,ee),await e.nextTick();try{O.setSelectionRange(he,Ve)}catch{}}},P=()=>w.value=!0,R=()=>{if(w.value=!1,!E)return;const X=E.value??"",O=x(X);O===X?T(O):$(E,O)};e.onMounted(()=>{if(E=document.getElementById(c.value),!E)return;E.addEventListener("beforeinput",I),E.addEventListener("paste",j),E.addEventListener("input",U),E.addEventListener("compositionstart",P),E.addEventListener("compositionend",R);const X=E.value??"",O=x(X);O===X?T(O):$(E,O)}),e.onBeforeUnmount(()=>{E&&(E.removeEventListener("beforeinput",I),E.removeEventListener("paste",j),E.removeEventListener("input",U),E.removeEventListener("compositionstart",P),E.removeEventListener("compositionend",R),E=null)});const G=()=>{C.value="",E&&(E.value=""),r("update:modelValue",null),r("clear")},q=e.computed(()=>C.value.length),W=e.computed(()=>a.showCharCount?f.value>0:!1),Z=e.computed(()=>W.value&&q.value>0),ne=e.computed(()=>`${q.value} / ${f.value}`),ue=e.computed(()=>!!a.error),ke=e.computed(()=>{const X=o.rows,O=typeof X=="number"?X:Number.parseInt(String(X??""),10);return Number.isFinite(O)&&O>0?O:3}),me=e.computed(()=>({height:`${ke.value*24+16}px`}));return(X,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",sC)):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",lC,"*")):e.createCommentVNode("",!0)],8,iC)):e.createCommentVNode("",!0),e.createElementVNode("div",cC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:C.value},u.value,{style:`text-transform: ${V.value}; padding-right: ${k.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",ue.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,dC),k.value?(e.openBlock(),e.createElementBlock("div",uC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:G}," ✕ ")])):e.createCommentVNode("",!0),Z.value&&!ue.value?(e.openBlock(),e.createElementBlock("p",fC,e.toDisplayString(ne.value),1)):e.createCommentVNode("",!0)]),ue.value?(e.openBlock(),e.createElementBlock("p",mC,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,aC)),[[e.vShow,i.value]])}}),ud=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(fe.AvatarRoot),{class:e.normalizeClass(e.unref(_e)(e.unref(hC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),fd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),md=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(fe.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),hC=Ho("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"}}}),Mr=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=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.Separator),e.mergeProps(e.unref(o),{class:e.unref(_e)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),pC={class:"bg-card text-card-foreground"},gC={class:"pb-6 px-3"},bC={key:0,class:"flex justify-center p-8"},yC={key:1,class:"p-8 text-center text-red-500"},xC={key:2,class:"relative"},kC={class:"space-y-6"},wC={class:"rounded-xl border bg-card text-card-foreground shadow"},CC={class:"p-4"},BC={class:"flex items-center justify-between gap-3"},EC={class:"font-medium"},_C={class:"text-xs text-muted-foreground"},SC={class:"mt-1 text-sm text-muted-foreground"},AC={class:"text-foreground"},VC={class:"text-foreground"},DC={class:"mt-1 text-xs text-muted-foreground"},NC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},MC={class:"flex items-center justify-between gap-3"},PC={class:"font-medium"},TC={class:"text-xs text-muted-foreground"},vC={class:"mt-2 text-sm text-muted-foreground"},OC={class:"flex flex-wrap items-center justify-between gap-3"},FC={class:"flex items-center gap-3"},zC={class:"leading-tight"},RC={class:"text-sm font-medium"},IC={class:"text-xs text-muted-foreground"},LC={class:"flex items-center gap-2"},$C={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},jC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},UC=["src"],WC={class:"flex-1"},HC={class:"flex items-center justify-between gap-3"},qC={class:"font-medium"},GC={class:"text-xs text-muted-foreground"},KC={class:"mt-1 text-sm text-muted-foreground"},XC={class:"text-left sm:text-center"},YC={class:"text-xs text-muted-foreground"},JC={class:"text-left sm:text-center"},QC={class:"text-xs text-muted-foreground"},ZC={class:"text-left sm:text-center"},eB={class:"text-xs text-muted-foreground"},tB={class:"flex items-center justify-between gap-3"},nB={class:"font-medium"},oB={class:"text-xs text-muted-foreground"},rB={class:"mt-2 text-sm text-muted-foreground"},aB={class:"mt-3 flex items-center gap-3"},sB={class:"text-sm font-medium"},iB={class:"flex items-start justify-between gap-3"},lB={class:"font-medium"},cB={class:"mt-3 grid gap-2 text-sm"},dB={class:"flex items-center justify-between gap-3"},uB={class:"flex items-center gap-2 text-muted-foreground"},fB={class:"font-medium"},mB={class:"flex items-center justify-between gap-3"},hB={class:"flex items-center gap-2 text-muted-foreground"},pB={class:"font-medium"},gB={class:"flex items-center justify-between gap-3"},bB={class:"flex items-center gap-2 text-muted-foreground"},yB={class:"font-medium"},xB={class:"flex items-center justify-between"},kB={class:"flex items-center gap-2"},wB={class:"flex items-start justify-between gap-3"},CB={class:"flex items-center gap-2"},BB={class:"font-medium"},EB={class:"mt-2 text-sm text-muted-foreground"},_B={key:0,class:"mt-1 text-sm text-muted-foreground"},SB={class:"flex flex-wrap items-center justify-between gap-3"},AB={class:"flex items-center gap-2"},VB={class:"text-xs text-muted-foreground"},hd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=We.useBreakpoints(We.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 m=await f.json();Array.isArray(m)?i.value=m:m.data&&Array.isArray(m.data)?i.value=m.data:m.items&&Array.isArray(m.items)?i.value=m.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:te.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:te.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:te.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:te.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:te.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:te.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:te.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(m=>{var h;return(h=m[0])==null?void 0:h.toUpperCase()}).join("");return(f,m)=>{const h=e.resolveComponent("ShoppingCart"),k=e.resolveComponent("DCodeBadge"),C=e.resolveComponent("RefreshCcw"),w=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",pC,[m[8]||(m[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",bC,[...m[0]||(m[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",yC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",xC,[m[7]||(m[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",kC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,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",wC,[e.createElementVNode("div",CC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",BC,[e.createElementVNode("p",EC,e.toDisplayString(p.title),1),e.createElementVNode("p",_C,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",SC,[e.createElementVNode("span",AC,e.toDisplayString(p.from),1),e.createVNode(e.unref(te.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",VC,e.toDisplayString(p.to),1)]),e.createElementVNode("p",DC,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",NC,[e.createVNode(e.unref(te.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",MC,[e.createElementVNode("p",PC,e.toDisplayString(p.title),1),e.createElementVNode("p",TC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",vC,e.toDisplayString(p.desc),1),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",OC,[e.createElementVNode("div",FC,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",zC,[e.createElementVNode("p",RC,e.toDisplayString(p.personName),1),e.createElementVNode("p",IC,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",LC,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",$C,[e.createElementVNode("div",jC,[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,UC)):(e.openBlock(),e.createBlock(h,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",WC,[e.createElementVNode("div",HC,[e.createElementVNode("p",qC,e.toDisplayString(p.title),1),e.createElementVNode("p",GC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",KC,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",XC,[m[1]||(m[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",YC,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",JC,[m[2]||(m[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",QC,e.toDisplayString(p.price),1)]),e.createElementVNode("div",ZC,[m[3]||(m[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",eB,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",tB,[e.createElementVNode("p",nB,e.toDisplayString(p.title),1),e.createElementVNode("p",oB,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",rB,e.toDisplayString(p.desc),1),e.createElementVNode("div",aB,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",sB,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",iB,[e.createElementVNode("p",lB,e.toDisplayString(p.title),1),e.createVNode(k,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",cB,[e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createVNode(e.unref(te.Globe),{class:"h-4 w-4"}),m[4]||(m[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",fB,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",mB,[e.createElementVNode("div",hB,[e.createVNode(e.unref(te.Cpu),{class:"h-4 w-4"}),m[5]||(m[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",pB,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",gB,[e.createElementVNode("div",bB,[e.createVNode(e.unref(te.CpuIcon),{class:"h-4 w-4"}),m[6]||(m[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",yB,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",xB,[e.createElementVNode("div",kB,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(C,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",wB,[e.createElementVNode("div",CB,[e.createVNode(w,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",BB,e.toDisplayString(p.title),1)]),e.createVNode(k,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",EB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",_B,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",SB,[e.createElementVNode("div",AB,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",VB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),DB={class:"dcode-upload-file"},NB={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"},MB={key:0,class:"text-xs text-gray-500 mt-1"},PB=["accept"],TB={key:1,class:"text-xs text-red-600 mt-1"},pd=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",DB,[t.label?(e.openBlock(),e.createBlock(Dn,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",NB,[e.createVNode(e.unref(te.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",MB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,PB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",TB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),vB=["onClick"],OB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},FB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},zB={key:1},RB={key:0,class:"text-white"},IB={key:1},LB={key:2},$B=["disabled","onClick"],jB={key:1,class:"mr-2 text-sm font-bold opacity-70"},UB={class:"whitespace-normal text-sm text-center leading-tight"},WB={class:"flex flex-col flex-1 min-w-0"},HB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},qB={class:"text-sm text-muted-foreground"},GB={class:"px-1"},KB=["disabled"],XB=["type"],YB=["disabled"],Ss=at(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=Ke(),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 g;if(typeof o.modelValue=="string"){const b=(g=o.tabs)==null?void 0:g.findIndex(_=>_.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(g){var b;if(i.value=g,typeof o.modelValue=="string"){const _=(b=o.tabs)==null?void 0:b[g];_?r("update:modelValue",_.key):r("update:modelValue",g)}else r("update:modelValue",g)}}),c=e.computed(()=>{var g;return((g=o.tabs)==null?void 0:g.length)??0}),d=e.computed(()=>{var g;return(g=o.tabs)==null?void 0:g[l.value]});function u(g){return c.value<=0?0:Math.min(Math.max(g,0),c.value-1)}function f(g){return g?typeof g=="string"?bn(g,At):g:null}const m=e.reactive({});function h(g){return m[g.key]||(m[g.key]={loaded:!1,loading:!1,data:null,error:null}),m[g.key]}function k(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function C(g){const b=g.endpoint||{};return{apiModule:g.apiModule||b.apiModule,apiAction:g.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:g.apiParams}}function w(g){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[g];return!(!b||b.disabled)}async function p(g){if(typeof g.tab.fetchData=="function"){const T=await g.tab.fetchData(),$=(T==null?void 0:T.data)??T;return($==null?void 0:$.data)??$}const b=C(g.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const y=k();let x;if(b.apiUrl)x=await s("","",y,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const T={...y,...b.apiParams};x=await s(b.apiModule,b.apiAction,T)}const E=(x==null?void 0:x.data)??x;return(E==null?void 0:E.data)??E}async function A(g,{force:b=!1}={}){const _=u(g),y=o.tabs[_];if(!y)return;const x=h(y);if(!(o.cache&&x.loaded&&!b)&&!x.loading){x.loading=!0,x.error=null;try{const E=await p({tabIndex:_,tab:y});x.data=E,x.loaded=!0,r("loaded",{tabIndex:_,tab:y,data:E})}catch(E){const M=typeof(E==null?void 0:E.message)=="string"&&E.message||typeof E=="string"&&E||"Failed to load tab data.";x.error=M,r("error",{tabIndex:_,tab:y,message:M})}finally{x.loading=!1}}}function D(g){const b=u(g);w(b)&&b!==l.value&&(l.value=b)}function S(g=l.value){return A(g,{force:!0})}function V(){const g=u(l.value-1);g!==l.value&&(l.value=g)}function B(){const g=u(l.value+1);g!==l.value&&(l.value=g)}return e.watch(()=>o.tabs,g=>{for(const b of g??[])h(b)},{immediate:!0}),e.watch(()=>l.value,async g=>{var _;const b=(_=o.tabs)==null?void 0:_[g];b&&r("change",{tabIndex:g,tab:b}),await A(g)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async g=>{g&&await A(l.value)},{immediate:!0}),(g,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,(_,y)=>(e.openBlock(),e.createElementBlock("div",{key:_.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",[y<l.value?"border-[#2563eb] bg-[#2563eb] text-white dark:border-[#1e3a8a] dark:bg-[#1e3a8a]":y===l.value?"border-[#2563eb] text-[#2563eb] shadow-[0_0_0_2px_rgba(37,99,235,0.2)] dark:border-[#1e3a8a] dark:text-[#3b82f6] dark:shadow-[0_0_0_2px_rgba(30,58,138,0.2)]":"border-[#e2e8f0] text-[#94a3b8] dark:border-[#3f3f46] dark:text-[#71717a]"]])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!_.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",zB,[y<l.value?(e.openBlock(),e.createElementBlock("span",RB,"✓")):(e.openBlock(),e.createElementBlock("span",IB,e.toDisplayString(y+1),1))])):(e.openBlock(),e.createElementBlock("span",LB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",y===l.value?"text-[#2563eb] dark:text-[#3b82f6]":"text-[#64748b] dark:text-[#a1a1aa]"])},e.toDisplayString(_.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(_,y)=>(e.openBlock(),e.createElementBlock("div",{key:_.key,onClick:x=>D(y),style:e.normalizeStyle({zIndex:t.tabs.length-y}),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",[y>0?"pl-8":"",y===l.value?"bg-[#2563eb] text-white dark:bg-[#1e3a8a]":y<l.value?"bg-[#eff6ff] text-[#2563eb] hover:bg-[#dbeafe] dark:bg-[#191d2c] dark:text-[#3b82f6] dark:hover:bg-[#1e263d]":"bg-[#f8fafc] text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:bg-[#18181b] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#d4d4d8]"]])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",OB,e.toDisplayString(y+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",FB,e.toDisplayString(_.title),1)],2),y<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",[y===l.value?"fill-[#2563eb] text-[#2563eb] dark:fill-[#1e3a8a] dark:text-[#1e3a8a]":y<l.value?"fill-[#eff6ff] text-[#eff6ff] group-hover:fill-[#dbeafe] group-hover:text-[#dbeafe] dark:fill-[#191d2c] dark:text-[#191d2c] dark:group-hover:fill-[#1e263d] dark:group-hover:text-[#1e263d]":"fill-[#f8fafc] text-[#f8fafc] group-hover:fill-[#f1f5f9] group-hover:text-[#f1f5f9] dark:fill-[#18181b] dark:text-[#18181b] dark:group-hover:fill-[#27272a] dark:group-hover:text-[#27272a]"]]),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,vB))),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,(_,y)=>(e.openBlock(),e.createElementBlock("button",{key:_.key,type:"button",disabled:!w(y),onClick:x=>D(y),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 border-[#e2e8f0] dark:border-[#3f3f46]",e.unref(_e)("border-b border-r",!t.isVertical&&y===t.tabs.length-1&&"border-r-0",y===l.value?"bg-[#2563eb]/[0.08] text-[#2563eb] font-semibold dark:bg-[#191d2c] dark:text-[#3b82f6]":"bg-transparent text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#f4f4f5]",!w(y)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",jB,e.toDisplayString(y+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",UB,e.toDisplayString(_.title),1)],10,$B))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Mr),{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 _,y,x,E;return[(e.openBlock(),e.createElementBlock("div",{key:((_=d.value)==null?void 0:_.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(y=m[d.value.key])!=null&&y.loading?e.renderSlot(g.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",HB,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(g.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(x=m[d.value.key])==null?void 0:x.data,loaded:(E=m[d.value.key])==null?void 0:E.loaded,reload:S},()=>[e.createElementVNode("div",qB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",GB,"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:V,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,KB),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,XB)):(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-[#1e3a8a] dark:hover:bg-[#1e40af] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,YB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-3330e7b3"]]),JB={class:"permission-menu w-full space-y-4"},QB={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"},ZB={class:"flex items-center justify-between"},eE={class:"flex items-center gap-3 flex-1"},tE=["onClick"],nE={key:1,class:"w-7"},oE={key:2,class:"flex-shrink-0"},rE={class:"text-lg font-semibold flex-1"},aE={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},sE={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},iE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},lE=["checked","disabled","onChange"],cE={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},dE={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},uE={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},fE={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"},mE={class:"flex items-center justify-between"},hE={class:"flex items-center gap-3 flex-1"},pE={key:0,class:"flex-shrink-0"},gE={class:"text-base font-semibold flex-1"},bE={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},yE={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},xE=["checked","onChange"],kE={class:"text-xs font-medium"},wE={key:0,class:"p-3"},CE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},BE=["checked","disabled","onChange"],EE={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},As=at(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}=gt.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=(y=!0)=>{(E=>{E.forEach(M=>{M.permission.forEach(T=>{const $=`${M.id}-${T.id}-parent`,v=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,v||(y?M.checked??!1:!1))}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.permission.forEach($=>{const v=`${T.id}-${$.id}-child`,I=$.code==="VIEW"||$.name.toUpperCase()==="VIEW";l.value.has(v)||l.value.set(v,I||(y?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(y=>{const x=y.menuId,E=y.actionsIds;i.value.forEach(M=>{M.id===x&&E.forEach(T=>{const $=`${x}-${T}-parent`;l.value.set($,!0)}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.id===x&&E.forEach($=>{const v=`${x}-${$}-child`;l.value.set(v,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(y,x)=>{x===0&&y>0&&u()});const f=y=>y.detail&&y.detail.length>0,m=y=>{c.value.has(y)?c.value.delete(y):c.value.add(y)},h=y=>c.value.has(y),k=(y,x,E=!1)=>{const M=`${y}-${x}-${E?"child":"parent"}`;return l.value.get(M)??!1},C=()=>{const y=B();s("update:modelValue",y.permissions)},w=(y,x,E,M=!1)=>{const T=E.target.checked,$=`${y}-${x}-${M?"child":"parent"}`;l.value.set($,T),s("permission-change",y,x,T,!M),C()},p=y=>y.permission.filter(A),A=y=>y.code==="VIEW"||y.name.toUpperCase()==="VIEW",D=(y,x,E)=>{const M=E.target.checked;x.permission.forEach(T=>{if(A(T)){const v=`${x.id}-${T.id}-child`;l.value.set(v,!0);return}const $=`${x.id}-${T.id}-child`;l.value.set($,M)}),l.value=new Map(l.value),s("menu-check",x.id,M),C()},S=(y,x=!1)=>{const E=x?y.permission:p(y);return!E||E.length===0?!1:E.every(M=>{const T=`${y.id}-${M.id}-${x?"child":"parent"}`;return l.value.get(T)??!1})},V=()=>{const y={};return i.value.forEach(x=>{var E;y[x.id]={name:x.name,parentPermissions:x.permission.map(M=>({id:M.id,name:M.name,checked:k(x.id,M.id,!1)})),children:((E=x.detail)==null?void 0:E.map(M=>({id:M.id,name:M.name,permissions:M.permission.map(T=>({id:T.id,name:T.name,checked:k(M.id,T.id,!0)}))})))||[]}}),y},B=()=>{const y=[],x=(E,M=!1)=>{const T=[];E.permission.forEach($=>{const v=`${E.id}-${$.id}-${M?"child":"parent"}`;(l.value.get(v)??!1)&&T.push($.id)}),T.length>0&&y.push({menuId:E.id,actionsIds:T})};return i.value.forEach(E=>{x(E,!1),E.detail&&E.detail.length>0&&E.detail.forEach(M=>{x(M,!0)})}),{permissions:y}};return n({getCurrentStates:V,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const y=[],x=(E,M=!1)=>{const T=E.permission.map(v=>{const I=`${E.id}-${v.id}-${M?"child":"parent"}`,j=l.value.get(I)??!1;return{id:v.id,name:v.name,checked:j}}),$=T.filter(v=>v.checked).map(v=>v.id);y.push({menuId:E.id,menuName:E.name,actionsIds:$,actions:T})};return i.value.forEach(E=>{x(E,!1),E.detail&&E.detail.length>0&&E.detail.forEach(M=>{x(M,!0)})}),{permissions:y}},permissionStates:l,expandAll:()=>{i.value.forEach(y=>{f(y)&&c.value.add(y.id)})},collapseAll:()=>{c.value.clear()}}),(y,x)=>(e.openBlock(),e.createElementBlock("div",JB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(E)}])},[e.createElementVNode("div",QB,[e.createElementVNode("div",ZB,[e.createElementVNode("div",eE,[f(E)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:M=>m(E.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[h(E.id)?(e.openBlock(),e.createBlock(e.unref(te.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(te.ChevronRight),{key:1,class:"w-5 h-5"}))],8,tE)):(e.openBlock(),e.createElementBlock("div",nE)),t.showIcons&&E.icon?(e.openBlock(),e.createElementBlock("span",oE,[e.createElementVNode("i",{class:e.normalizeClass([E.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",rE,e.toDisplayString(E.name),1)])])]),E.permission&&E.permission.length>0&&!f(E)?(e.openBlock(),e.createElementBlock("div",aE,[e.createElementVNode("h4",sE,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",iE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(E),M=>(e.openBlock(),e.createElementBlock("label",{key:M.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:A(M)||k(E.id,M.id,!1),disabled:A(M),onChange:T=>w(E.id,M.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",A(M)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,lE),e.createElementVNode("span",cE,e.toDisplayString(M.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(E)&&h(E.id)?(e.openBlock(),e.createElementBlock("div",dE,[e.createElementVNode("h4",uE,[x[0]||(x[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(E.detail,M=>(e.openBlock(),e.createElementBlock("div",{key:M.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",fE,[e.createElementVNode("div",mE,[e.createElementVNode("div",hE,[t.showIcons&&M.icon?(e.openBlock(),e.createElementBlock("span",pE,[e.createElementVNode("i",{class:e.normalizeClass([M.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",gE,e.toDisplayString(M.name),1),M.path?(e.openBlock(),e.createElementBlock("span",bE,e.toDisplayString(M.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",yE,[e.createElementVNode("input",{type:"checkbox",checked:S(M,!0),onChange:T=>D(E,M,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,xE),e.createElementVNode("span",kE,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),M.permission&&M.permission.length>0?(e.openBlock(),e.createElementBlock("div",wE,[e.createElementVNode("div",CE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.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:A(T)||k(M.id,T.id,!0),disabled:A(T),onChange:$=>w(M.id,T.id,$,!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",A(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,BE),e.createElementVNode("span",EE,e.toDisplayString(T.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),_E={class:"space-y-4"},SE={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},AE={key:0,class:"text-danger-500"},VE={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},DE={class:"text-neutral-600 dark:text-neutral-400"},NE={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},ME={class:"text-neutral-500 dark:text-neutral-400"},PE={key:3,class:"space-y-3"},TE={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},vE={class:"flex items-center gap-3"},OE={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},FE={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},zE={class:"flex items-center gap-2 text-sm font-medium"},RE={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},IE={class:"p-4"},LE={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},$E={class:"ml-2 flex-1 min-w-0"},jE=["for"],UE={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},WE={key:4,class:"mt-1 text-xs text-danger-600"},Vs=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}=gt.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(A=>({menuId:A.menuId,module:A.module,label:A.label||A.module,permissions:A.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const A={};return p.forEach(D=>{const S=D.key,V=S&&S.includes(".")?S.split(".")[0]:"other";A[V]||(A[V]={menuId:0,module:V,label:V,permissions:[]}),A[V].permissions.push({id:D.id,key:D.key,label:D.label,description:D.description})}),Object.values(A)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const A=[],D=(S,V="")=>{const B=V?`${V}.${S.name}`:S.name,g=B.toLowerCase().replace(/\s+/g,"_"),b=[];if(S.detail&&Array.isArray(S.detail)&&S.detail.forEach(_=>{b.push(_.id)}),S.permission&&S.permission.length>0){const _=S.permission.map(y=>({id:y.id,key:`${g}.${y.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${y.name} ${S.name}`,description:`Permission to ${y.name.toLowerCase()} ${S.name.toLowerCase()}`}));A.push({menuId:S.id,module:g,label:S.name,permissions:_,subMenuIds:b.length>0?b:void 0})}S.detail&&Array.isArray(S.detail)&&S.detail.forEach(_=>{D(_,B)})};return p.forEach(S=>D(S)),A}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 A=u(p);i.value=A;const D={},S=[],V={};A.forEach(g=>{g.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;V[_]=g.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(g=>{S.push(g.menuId),g.actionsIds&&Array.isArray(g.actionsIds)&&g.actionsIds.forEach(b=>B.add(b))}),A.forEach(g=>g.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;D[_]=B.has(_)})),l.value=D,c.value=S,d.value=V}catch{i.value=[]}finally{s.value=!1}},m=p=>p.permissions.filter(A=>{const D=typeof A.id=="string"?parseInt(A.id):A.id;return l.value[D]}).length,h=p=>p.permissions.every(A=>{const D=typeof A.id=="string"?parseInt(A.id):A.id;return l.value[D]}),k=p=>{const A=m(p);return A>0&&A<p.permissions.length},C=e.ref(!1),w=(p,A)=>{C.value=!0,p.permissions.map(V=>typeof V.id=="string"?parseInt(V.id):V.id),p.permissions.forEach(V=>{const B=typeof V.id=="string"?parseInt(V.id):V.id;l.value[B]=A});let D=o.modelValue?[...o.modelValue]:[],S=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(S=[...S,...p.subMenuIds],p.subMenuIds.forEach(V=>{const B=i.value.find(g=>g.menuId===V);B&&B.permissions.forEach(g=>{const b=typeof g.id=="string"?parseInt(g.id):g.id;l.value[b]=A})})),A?S.forEach(V=>{const B=i.value.find(g=>g.menuId===V);if(B){const g=B.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),b=D.findIndex(_=>_.menuId===V);b!==-1?D[b]={menuId:V,actionsIds:g}:D.push({menuId:V,actionsIds:g})}}):D=D.filter(V=>!S.includes(V.menuId)),c.value=D.map(V=>V.menuId),console.log("Full Result:",JSON.stringify(D,null,2)),r("update:modelValue",D),setTimeout(()=>{C.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const A=new Set,D=[];p.forEach(S=>{D.push(S.menuId),S.actionsIds&&Array.isArray(S.actionsIds)&&S.actionsIds.forEach(V=>A.add(V))}),Object.keys(l.value).forEach(S=>{const V=parseInt(S);l.value[V]=A.has(V)}),c.value=D}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,A)=>{if(C.value)return;if(Object.keys(p).map(S=>parseInt(S)).filter(S=>p[S]!==(A==null?void 0:A[S])).length>0){let S=o.modelValue?[...o.modelValue]:[];const V={};Object.keys(p).forEach(B=>{const g=parseInt(B);if(p[g]){const b=d.value[g];console.log(`Permission ${g} belongs to Menu ${b}`),b!==void 0&&(V[b]||(V[b]=[]),V[b].push(g))}}),Object.keys(V).forEach(B=>{const g=parseInt(B),b=V[g],_=S.findIndex(y=>y.menuId===g);_!==-1?S[_]={menuId:g,actionsIds:b}:S.push({menuId:g,actionsIds:b})}),S=S.filter(B=>V[B.menuId]&&V[B.menuId].length>0),c.value=S.map(B=>B.menuId),console.log("Result:",JSON.stringify(S,null,2)),r("update:modelValue",S)}},{deep:!0}),e.onMounted(f),(p,A)=>(e.openBlock(),e.createElementBlock("div",_E,[t.label?(e.openBlock(),e.createElementBlock("label",SE,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",AE,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",VE,[e.createVNode(e.unref(te.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",DE,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",NE,[e.createElementVNode("p",ME,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",PE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.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",TE,[e.createElementVNode("div",vE,[e.createVNode(Yt,{modelValue:h(D),indeterminate:k(D),"onUpdate:modelValue":S=>w(D,!!S),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",OE,e.toDisplayString(D.label||D.module),1),e.createElementVNode("div",FE,e.toDisplayString(m(D))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(D.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",zE,[e.createElementVNode("div",RE,e.toDisplayString(m(D))+"/"+e.toDisplayString(D.permissions.length),1)])]),e.createElementVNode("div",IE,[e.createElementVNode("div",LE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.permissions,S=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Yt,{modelValue:l.value[typeof S.id=="string"?parseInt(S.id):S.id],"onUpdate:modelValue":V=>l.value[typeof S.id=="string"?parseInt(S.id):S.id]=V,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",$E,[e.createElementVNode("label",{for:`perm-${S.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(S.label||S.key),9,jE),S.description?(e.openBlock(),e.createElementBlock("p",UE,e.toDisplayString(S.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",WE,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),HE={key:0,class:"fixed inset-0 z-[100] flex justify-end"},qE={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"},GE={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},KE={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},XE={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},YE={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},JE={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},QE=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(Le,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",HE,[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",qE,[e.createElementVNode("div",GE,[e.createElementVNode("div",null,[e.createElementVNode("h3",KE,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",XE,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Le,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",YE,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",JE,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),ZE={key:0},e_=["value","name"],gd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=gt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Fn,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr},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(m=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(m)&&!f.hasOwnProperty(m)&&(f[m]=u[m])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",ZE,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,e_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),t_=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=We.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(_e)("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)]])}}),n_=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=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.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"]))}}),o_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(_e)("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"]))}}),r_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(_e)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(te.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),a_=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=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(_e)(e.unref(On)({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(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),s_=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=We.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(_e)(e.unref(On)({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"]))}}),i_=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=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(_e)(e.unref(On)({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(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),l_=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=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(_e)(e.unref(On)({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(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),c_=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=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(_e)(e.unref(On)({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(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),d_=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=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),u_=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=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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(p_)),e.createVNode(e.unref(fe.SelectViewport),{class:e.normalizeClass(e.unref(_e)("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(h_))]),_:3},16,["class"])]),_:3}))}}),f_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},m_=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=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(_e)("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",f_,[e.createVNode(e.unref(fe.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(te.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(fe.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),h_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronDown))])]),_:3},16,["class"]))}}),p_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronUp))])]),_:3},16,["class"]))}}),g_=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=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(_e)("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(fe.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),b_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Ao={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Gn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},st={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},y_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},x_={dangerouslyHTMLString:!1,multiple:!0,position:Ao.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},k_={rtl:!1,newestOnTop:!1,toastClassName:""},bd={...x_,...k_};st.DEFAULT;var Ae=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Ae||{}),Ds=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Ds||{});const w_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},C_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},B_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},E_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},yd="Toastify--animate Toastify__none-enter";function xd(t,n=!1){var o;let r=w_;if(!t||typeof t=="string")switch(t){case"flip":r=E_;break;case"zoom":r=B_;break;case"slide":r=C_;break}else r=t;if(n)r.enter=yd;else if(r.enter===yd){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function __(t){return t.containerId||String(t.position)}const Pr="will-unmount";function S_(t=Ao.TOP_RIGHT){return!!document.querySelector(`.${Ae.CSS_NAMESPACE}__toast-container--${t}`)}function A_(t=Ao.TOP_RIGHT){return`${Ae.CSS_NAMESPACE}__toast-container--${t}`}function V_(t,n,o=!1){const r=[`${Ae.CSS_NAMESPACE}__toast-container`,`${Ae.CSS_NAMESPACE}__toast-container--${t}`,o?`${Ae.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Xn(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function D_(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Ae.CSS_NAMESPACE,l=A_(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Pr)),f=c||document.createElement("div"),m=document.createElement("div");m.className=V_(o,r,a),m.dataset.testid=`${Ae.CSS_NAMESPACE}__toast-container--${o}`,m.id=__(t);for(const h in s)if(Object.prototype.hasOwnProperty.call(s,h)){const k=s[h];m.style[h]=k}return c||(f.className=Ae.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(m),m}function Ns(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",Ns,!1);try{Vo[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Vo[a],delete Qe[a]}catch{}}const Vo=e.reactive({});function N_(t,n){const o=document.getElementById(String(n));o&&(Vo[o.id]=t)}function Ms(t,n=!0){const o=String(t);if(!Vo[o])return;const r=document.getElementById(o);r&&r.classList.add(Pr),n?(P_(t),r&&r.addEventListener("animationend",Ns,!1)):Ns(o),kt.items=kt.items.filter(a=>a.containerId!==t)}function M_(t){for(const n in Vo)Ms(n,t);kt.items=[]}function kd(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...xd(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function P_(t){for(const n in Qe)if(n===t)for(const o of Qe[n]||[])kd(o)}function T_(t){const n=Kn().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function Ps(t){return document.getElementById(t)}function v_(t){const n=Ps(t.containerId);return n&&n.classList.contains(Pr)}function wd(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 O_(t){return t?kt.items.filter(n=>n.containerId===t).length>0:kt.items.length>0}function F_(){if(kt.items.length>0){const t=kt.items.shift();Tr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const Qe=e.reactive({}),kt=e.reactive({items:[]});function Kn(){const t=e.toRaw(Qe);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function z_(t){return Kn().find(n=>n.toastId===t)}function Tr(t,n={}){if(v_(n)){const o=Ps(n.containerId);o&&o.addEventListener("animationend",Ts.bind(null,t,n),!1)}else Ts(t,n)}function Ts(t,n={}){const o=Ps(n.containerId);o&&o.removeEventListener("animationend",Ts.bind(null,t,n),!1);const r=Qe[n.containerId]||[],a=r.length>0;if(!a&&!S_(n.position)){const s=D_(n),i=e.createApp(i2,n);n.useHandler&&n.useHandler(i),i.mount(s),N_(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?mt.update(n):mt.add(t,n)})}const mt={add(t,n){const{containerId:o=""}=n;o&&(Qe[o]=Qe[o]||[],Qe[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=Qe[o])==null||r.unshift(n):(a=Qe[o])==null||a.push(n),n.onOpen&&n.onOpen(wd(n))},n.delay||0))},remove(t){if(t){const n=T_(t);if(n){const o=Qe[n];let r=o.find(a=>a.toastId===t);Qe[n]=o.filter(a=>a.toastId!==t),!Qe[n].length&&!O_(n)&&Ms(n,!1),F_(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(wd(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){Qe[n]=Qe[n]||[];const o=Qe[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};mt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Pe(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Ms(t,n):M_(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",mt.dismissCallback,!1),setTimeout(()=>{mt.remove(o)}))},dismiss(t){if(t){const n=Kn();for(const o of n)if(o.toastId===t){kd(o,r=>{r.addEventListener("animationend",mt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Kn();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",mt.dismissCallback,!1),mt.remove(t));break}}}},R_=e.reactive({useHandler:void 0}),Cd=e.reactive({}),vr=e.reactive({});function Bd(){return Math.random().toString(36).substring(2,9)}function I_(t){return typeof t=="number"&&!isNaN(t)}function vs(t){return typeof t=="string"}function Xn(t){return typeof t=="function"}function Or(...t){return e.mergeProps(...t)}function Fr(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function L_(t={}){Cd[`${Ae.CSS_NAMESPACE}-default-options`]=t}function Ed(){return Cd[`${Ae.CSS_NAMESPACE}-default-options`]||bd}function $_(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var zr=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(zr||{});const _d={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:Ao.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:Gn.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:st.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},j_={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:st.DEFAULT},theme:{type:String,required:!1,default:Gn.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},U_=e.defineComponent({name:"ProgressBar",props:j_,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(()=>[`${Ae.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Ae.CSS_NAMESPACE}__progress-bar--controlled`:`${Ae.CSS_NAMESPACE}__progress-bar--animated`,`${Ae.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Ae.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Ae.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)}}),W_=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Gn.AUTO},type:{type:String,required:!1,default:Gn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Ae.CSS_NAMESPACE}__close-button ${Ae.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)])])}}),Rr=({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 H_(t){return e.createVNode(Rr,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 q_(t){return e.createVNode(Rr,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 G_(t){return e.createVNode(Rr,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 K_(t){return e.createVNode(Rr,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 X_(){return e.createVNode("div",{class:`${Ae.CSS_NAMESPACE}__spinner`},null)}const Ir={info:q_,warning:H_,success:G_,error:K_,spinner:X_},Y_=t=>t in Ir;function J_({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 Ir.spinner();if(r!==!1){if(Fr(r))a=e.toRaw(r);else if(Xn(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?Ir.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):vs(r)||I_(r)?a=r:Y_(n)&&(a=Ir[n](i));return a}}const Q_=()=>{};function Z_(t,n,o=Ae.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 e2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(zr.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Ae.COLLAPSE_DURATION}),i=s.done||Q_,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:w,onMouseleave:C}:{});function u(){const A=l.value.split(" ");m().addEventListener(Ds.ENTRANCE_ANIMATION_END,C,{once:!0});const D=V=>{const B=m();V.target===B&&(B.dispatchEvent(new Event(Ds.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",D),B.removeEventListener("animationcancel",D),a.value===zr.Enter&&V.type!=="animationcancel"&&B.classList.remove(...A))},S=()=>{const V=m();V.classList.add(...A),V.addEventListener("animationend",D),V.addEventListener("animationcancel",D)};t.pauseOnFocusLoss&&h(),S()}function f(){if(!m())return;const A=()=>{const S=m();S.removeEventListener("animationend",A),s.collapse?Z_(S,i,s.collapseDuration):i()},D=()=>{const S=m();a.value=zr.Exit,S&&(S.className+=` ${c.value}`,S.addEventListener("animationend",A))};o.value||(r.value?A():setTimeout(D))}function m(){return t.toastRef.value}function h(){document.hasFocus()||w(),window.addEventListener("focus",C),window.addEventListener("blur",w)}function k(){window.removeEventListener("focus",C),window.removeEventListener("blur",w)}function C(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function w(){n.value=!1}function p(A){A&&(A.stopPropagation(),A.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const A=Kn();o.value=A.findIndex(D=>D.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?w():C())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&k()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function t2(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 n2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:_d,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>J_(t)),s=e.computed(()=>[`${Ae.CSS_NAMESPACE}__toast`,`${Ae.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Ae.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Ae.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=e2({toastRef:n,loading:o,done:()=>{mt.remove(t.toastId)},...xd(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(t2(f)){const m=[];return f.title!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Ae.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Ae.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ae.CSS_NAMESPACE}__toast-text`},[m])}return Fr(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Xn(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:`${Ae.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Ae.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Ae.CSS_NAMESPACE}--animate-icon ${Ae.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Fr(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Xn(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(W_,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Fr(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Xn(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(U_,{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)])}}),Lr="vue3-toastify:url-change";let $r=0,Do;function o2(){if(!(typeof window>"u")&&vr.lastUrl!==window.location.href){vr.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Ed().clearOnUrlChange!==!1,n=Object.values(Qe).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&mt.dismiss(o.toastId);kt.items=kt.items.filter(o=>!t(o.toastProps))}}function r2(){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(Lr)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(Lr)),a},()=>{t.pushState=n,t.replaceState=o}}function a2(){if(typeof window>"u"||Do)return;const t=r2(),n=()=>o2();window.addEventListener(Lr,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Do=()=>{t(),window.removeEventListener(Lr,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Do=void 0}}function s2(){Do&&(Do(),vr.lastUrl="")}const i2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:_d,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>Qe[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&($r+=1,a2())}),e.onUnmounted(()=>{typeof window<"u"&&$r>0&&($r-=1,$r===0&&s2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(n2,e.mergeProps({key:s},a),null)})])}});let Os=!1;const Sd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Ad(){const t=[];return Kn().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Pr)&&t.push(n)}),t}function l2(t){const n=Ad().length,o=t??0;return o>0&&n+kt.items.length>=o}function c2(t){l2(t.limit)&&!t.updateId&&kt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function dn(t,n,o={}){if(Os)return;o=Or(Ed(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Bd()),o={...o,...o.type==="loading"?Sd:{},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=$_()),c2(o),vr.lastUrl=window.location.href,o.multiple?kt.items.length?o.updateId&&Tr(t,o):Tr(t,o):(Os=!0,Pe.clearAll(void 0,!1),setTimeout(()=>{Tr(t,o)},0),setTimeout(()=>{Os=!1},390)),o.toastId}const Pe=(t,n)=>dn(t,st.DEFAULT,n);Pe.info=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.INFO}),Pe.error=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.ERROR}),Pe.warning=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.WARNING}),Pe.warn=Pe.warning,Pe.success=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.SUCCESS}),Pe.loading=(t,n)=>dn(t,st.DEFAULT,Or(n,Sd)),Pe.dark=(t,n)=>dn(t,st.DEFAULT,Or(n,{theme:Gn.DARK})),Pe.remove=t=>{t?mt.dismiss(t):mt.clear()},Pe.clearAll=(t,n)=>{e.nextTick(()=>{mt.clear(t,n)})},Pe.isActive=t=>{let n=!1;return n=Ad().findIndex(o=>o.toastId===t)>-1,n},Pe.update=(t,n={})=>{setTimeout(()=>{const o=z_(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Bd()},i=s.render||a;delete s.render,dn(i,s.type,s)}},0)},Pe.done=t=>{Pe.update(t,{isLoading:!1,progress:1})},Pe.promise=d2;function d2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=vs(n)?Pe.loading(n,d):Pe.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=(h,k,C)=>{if(k==null){Pe.remove(c);return}const w={type:h,...u,...a,data:C},p=vs(k)?{render:k}:k;return c?Pe.update(c,{...w,...p,isLoading:!1}):Pe(p.render,{...w,...p,isLoading:!1}),C},m=Xn(t)?t():t;return m.then(h=>{f("success",r,h)}).catch(h=>{f("error",o,h)}),m}Pe.POSITION=Ao,Pe.THEME=Gn,Pe.TYPE=st,Pe.TRANSITIONS=y_;const u2={install(t,n={}){R_.useHandler=n.useHandler||(()=>{}),f2(n)}};typeof window<"u"&&(window.Vue3Toastify=u2);function f2(t={}){const n=Or(bd,t);L_(n)}const m2={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:[]},h2={key:0,class:"inline-block"},Fs=at(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(()=>bn(n.icon,At)),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 _e(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>_e("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,m)=>r.value?(e.openBlock(),e.createElementBlock("div",h2,[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-1e8e809d"]]);var jr={exports:{}},p2=jr.exports,Vd;function g2(){return Vd||(Vd=1,(function(t,n){(function(o,r){t.exports=r()})(p2,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(w){return r.apply(w,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,m,h;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 m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.filter(function(w){return r.truthy(r.apply(f,w))}):[];if(l==="map")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.map(function(w){return r.apply(f,w)}):[];if(l==="reduce")return m=r.apply(c[0],i),f=c[1],h=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(m)?m.reduce(function(w,p){return r.apply(f,{current:p,accumulator:w})},h):h;if(l==="all"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="none"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="some"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(c=c.map(function(w){return r.apply(w,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var k=String(l).split("."),C=a;for(d=0;d<k.length;d++){if(!C.hasOwnProperty(k[d]))throw new Error("Unrecognized operation "+l+" (failed at "+k.slice(0,d+1).join(".")+")");C=C[k[d]]}return C.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})})(jr)),jr.exports}var b2=g2();const Ft=Oi(b2),y2={class:"dcode-card animate-slide-up"},x2={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"},k2={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},w2={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]"},C2={class:"relative w-full sm:w-64"},B2={key:0,class:"relative"},E2={class:"flex flex-col h-full"},_2={key:0,class:"flex-1 overflow-y-auto py-4"},S2={class:"grid grid-cols-1 gap-4 px-1"},A2={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"},V2={class:"flex justify-end gap-2 w-full"},D2={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},N2={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},M2={class:"dcode-table w-full"},P2={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},T2=["onClick"],v2={key:0,class:"flex items-center justify-center w-full"},O2={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},F2={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},z2={key:0,class:"px-3 py-0.5"},R2={key:1},I2=["colspan"],L2={class:"flex flex-col items-center gap-2"},$2={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},j2={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},U2={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},W2={key:0,class:"flex items-center justify-center"},H2={key:0,class:"px-3 py-0.5 !text-center"},q2={key:0,class:"flex items-center justify-center gap-1.5"},G2={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},K2=["colspan"],X2={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"},Y2={class:"flex items-center gap-4"},J2={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},Q2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},Z2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},eS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},tS={class:"flex-shrink-0"},nS={class:"space-y-4"},oS={class:"text-gray-600 dark:text-gray-400"},rS={class:"grid grid-cols-1 gap-4 py-4 px-1"},aS={key:0,class:"mb-2 p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-900/30 rounded-lg flex items-center gap-3"},sS={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},iS={class:"flex flex-col gap-0.5"},lS={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},cS={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},dS={class:"flex items-end gap-2"},Yn=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},baseUrl:{default:void 0}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var Hd,qd,Gd,Kd,Xd,Yd;Ft.add_operation("length",N=>N==null?0:typeof N=="string"||Array.isArray(N)?N.length:typeof N=="number"?String(N).length:typeof N=="object"?Object.keys(N).length:0),Ft.add_operation("==",(N,z)=>N!==null&&typeof N=="object"&&"_isLogicValue"in N?N.id==z||N.code==z:z!==null&&typeof z=="object"&&"_isLogicValue"in z?z.id==N||z.code==N:N==z),Ft.add_operation("!=",(N,z)=>N!==null&&typeof N=="object"&&"_isLogicValue"in N?!(N.id==z||N.code==z):z!==null&&typeof z=="object"&&"_isLogicValue"in z?!(z.id==N||z.code==N):N!=z);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=Ke(),{locale:l}=gt.useI18n();let c={query:{},params:{},path:""};try{const N=un.useRoute();N?c=N:(Gd=(qd=(Hd=s==null?void 0:s.appContext)==null?void 0:Hd.config)==null?void 0:qd.globalProperties)!=null&&Gd.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:N=>{console.warn("Router push() logic called from fallback:",N),typeof N=="string"&&N.startsWith("/")&&(window.location.href=N)}};try{const N=un.useRouter();N?d=N:(Yd=(Xd=(Kd=s==null?void 0:s.appContext)==null?void 0:Kd.config)==null?void 0:Xd.globalProperties)!=null&&Yd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),m=e.ref(r.perPage),h=e.ref({key:"",direction:"asc"}),k=e.ref([]),C=e.ref(!1),w=e.ref(0),p=e.ref({}),A=e.ref([]),D=e.ref(null),S=e.ref(!0),V=e.ref([]),B=e.ref([]),g=e.ref([]),b=e.ref(!1),_=e.ref(!1),y=e.ref({}),x=e.ref(null),E=e.ref(null),M=e.ref(null),T=e.ref([]),$=e.computed(()=>{if(H.value.length===0)return!1;const N=H.value.map(z=>{const Y=X.value.find(L=>L.type==="CHECKBOX"),F=(Y==null?void 0:Y.keyCheckbox)||"id";return z[F]}).filter(z=>z!=null);return N.length===0?!1:N.every(z=>T.value.includes(z))}),v=e.computed(()=>{if(H.value.length===0)return!1;const N=X.value.find(L=>L.type==="CHECKBOX"),z=(N==null?void 0:N.keyCheckbox)||"id",Y=H.value.map(L=>L[z]).filter(L=>L!=null),F=Y.filter(L=>T.value.includes(L)).length;return F>0&&F<Y.length}),I=N=>{const z=X.value.find(L=>L.type==="CHECKBOX"),Y=(z==null?void 0:z.keyCheckbox)||"id",F=N[Y];return F!==void 0&&T.value.includes(F)},j=N=>{const z=X.value.find(L=>L.type==="CHECKBOX"),Y=(z==null?void 0:z.keyCheckbox)||"id",F=H.value.map(L=>L[Y]).filter(L=>L!=null);if(N){const L=new Set([...T.value,...F]);T.value=Array.from(L)}else T.value=T.value.filter(L=>!F.includes(L))},U=(N,z)=>{const Y=X.value.find(J=>J.type==="CHECKBOX"),F=(Y==null?void 0:Y.keyCheckbox)||"id",L=N[F];L!=null&&(z?T.value.includes(L)||T.value.push(L):T.value=T.value.filter(J=>J!==L))};e.watch(T,N=>{var Y;a("update:selection",N);const z=$.value||N.length>1;(Y=B.value)!=null&&Y.length&&B.value.forEach(F=>{var L;(L=F.fieldActionGlobal)!=null&&L.length&&F.fieldActionGlobal.forEach(J=>{var ye,Te;const ie=F.endpoint||((ye=F.propsActionGlobal)==null?void 0:ye.endpointPropAction)||F.propsActionGlobal,ge=(Te=ie==null?void 0:ie.keyParam)==null?void 0:Te[0];(ge&&J.model===ge||!ge&&/^(id|ids|idAuditTrail)/i.test(J.model))&&z&&J.model&&(y.value[J.model]=N)})})},{deep:!0});const P=N=>Array.from({length:N}).map((z,Y)=>{const F={id:Y+1,no:Y+1};return X.value.forEach(L=>{L.key!=="no"&&L.key!=="action"&&L.type!=="ACTION"&&L.type!=="action"&&(L.type==="CHECKBOX"?F[L.keyCheckbox||"id"]=Y+1:L.type==="BADGE"||L.type==="badge"||L.condition?F[L.key]=L.condition&&L.condition.length>0?L.condition[0].value:"Active":F[L.key]=`Data ${L.label} ${Y+1}`)}),F}),R=N=>N&&typeof N=="string"&&N.trim()?N:void 0,G=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiModule)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiModule)||r.apiModule}),q=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiAction)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiAction)||r.apiAction}),W=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiMethod)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiMethod)||r.apiMethod||"POST"}),Z=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiUrl)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiUrl)||r.apiUrl}),ne=e.computed(()=>r.permissionBase||""),ue=e.computed(()=>!g.value||g.value.length===0?[]:[...g.value].sort((N,z)=>(N.seq||0)-(z.seq||0))),ke=N=>{var J,ie,ge;const z=(N==null?void 0:N.column)||((J=N==null?void 0:N.props)==null?void 0:J.column)||((ie=N==null?void 0:N.propsFieldGlobal)==null?void 0:ie.column)||((ge=N==null?void 0:N.propsFieldCustom)==null?void 0:ge.column);if(!z)return"col-span-1";const Y=z.toLowerCase(),L={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"}[Y]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${N==null?void 0:N.model}: type=${z}, returned=${L}`),L},me=()=>{let N=null;if(r.tableConfig&&(N=r.tableConfig),N){D.value=N,V.value=[],B.value=[],N.headers&&(A.value=N.headers.map(F=>{var ie,ge,be,ye,Te,Be,De,ht,Rt,Qr;if(F.key==="action"||((ie=F.custom)==null?void 0:ie.type)==="ACTION"||((ge=F.custom)==null?void 0:ge.type)==="action"){const pt=((be=F.custom)==null?void 0:be.actionCustom)||((ye=F.custom)==null?void 0:ye.action);if(pt){const DA=pt.map(wt=>{const qe=wt.propsActionCustom||wt.props||{},Zr=wt.propCustomMessage||{};return{permission:wt.permission,label:l.value==="id"?qe.labelID:qe.labelEN,tooltip:l.value==="id"?qe.tooltipID||qe.labelID:qe.tooltipEN||qe.labelEN,icon:qe.icon,variant:qe.variant||"ghost",bgColor:qe.bgColor,action:qe.actionType||qe.key,route:qe.route,path:qe.path,endpoint:qe.endpointPropAction,requiredCondition:wt.requiredCondition||!1,propCustomCondition:wt.propCustomCondition||[],fieldMapping:wt.fieldMapping||qe.fieldMapping||null,openDialog:wt.openDialog||!1,fieldActionCustom:(wt.fieldActionCustom||[]).map(ea=>{const js=ea.propsFieldCustom||ea.propsFieldGlobal||ea.props||{};return{...ea,props:{...js,endpoint:js.endpointComponent||js.endpoint}}}),condition:wt.visibleRule||wt.propCustomCondition||qe.visibleRule||qe.propCustomCondition||null,requireConfirm:wt.requireConfirm||qe.requireConfirm||!1,confirmTitle:l.value==="id"?Zr.titleID||qe.confirmTitleID||"Konfirmasi":Zr.titleEN||qe.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Zr.messageID||qe.confirmMessageID||"Apakah Anda yakin?":Zr.messageEN||qe.confirmMessageEN||"Are you sure?"}});V.value.push(...DA)}return null}let L;const J=((Te=F.custom)==null?void 0:Te.conditionBadge)||((Be=F.custom)==null?void 0:Be.condition);return(((De=F.custom)==null?void 0:De.type)==="BADGE"||((ht=F.custom)==null?void 0:ht.type)==="badge")&&J&&(L=J.map(pt=>({value:pt.value,label:l.value==="id"?pt.labelID:pt.labelEN,labelID:pt.labelID,labelEN:pt.labelEN,color:pt.color||pt.bgColor,variant:pt.variant,logic:pt.logic||pt.conditionRule||null}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Rt=F.custom)==null?void 0:Rt.type,condition:L,keyCheckbox:(Qr=F.custom)==null?void 0:Qr.keyCheckbox}}).filter(F=>F!==null));const z=N.filters||N.filter;z&&Array.isArray(z)&&(g.value=z.map(F=>({...F,props:F.propsFilters||F.props||{}})),g.value.forEach(F=>{p.value[F.model]=""}));const Y=N.actionTableGlobal||N.actionGlobal||N.action;console.log("[DEBUG] loadConfig rawActions:",Y),Y&&Array.isArray(Y)?(B.value=Y.map(F=>{const L=F.propsActionGlobal||F.props||{};return{key:L.key,permission:F.permission,label:l.value==="id"?L.labelID||"Action":L.labelEN||"Action",tooltip:l.value==="id"?L.tooltipID||L.labelID:L.tooltipEN||L.labelEN,icon:L.icon,variant:L.variant||"default",bgColor:L.bgColor,textColor:L.textColor,route:L.route,path:L.path,endpoint:L.endpointPropAction||F.endpoint,fieldMapping:F.fieldMapping||L.fieldMapping||null,visibleRule:F.visibleRule||L.visibleRule||F.propCustomCondition||L.propCustomCondition||null,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(J=>{const ie=J.propsFieldGlobal||J.props||{};return{...J,props:{...ie,endpoint:ie.endpointComponent||ie.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),N.pagination!==void 0&&(S.value=N.pagination)}};e.watch(()=>r.tableConfig,()=>{me()},{deep:!0,immediate:!0});const X=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?A.value:r.columns||[]),O=e.computed(()=>r.hasActions||V.value.length>0),K=e.computed(()=>r.dummyMode?!1:G.value||Z.value?C.value:r.loading),ee=e.computed(()=>!!G.value||!!Z.value),he=e.computed(()=>[]),Ve=N=>{if(console.log("[DEBUG] hasAction called:",{actionCode:N,permissionChecker:!!r.permissionChecker,effectivePath:ne.value}),r.menuPermissions&&r.menuPermissions.length>0){const z=c.path,Y=r.menuPermissions.find(F=>z.startsWith(F.path));if(Y&&Y.actions){const F=Y.actions.find(L=>L.code===N.toUpperCase());return F?F.checked:!1}return!1}if(r.permissionChecker){const z=r.permissionChecker(ne.value,N);return console.log("[DEBUG] permissionChecker result:",z),z}return he.value.some(z=>z.code===N)},Ne=(N,z)=>{if(N.condition)try{return Ft.apply(N.condition,z)}catch(ie){return console.warn("Row action jsonLogic error:",ie),!1}if(!N.visibilityCondition)return!0;const{field:Y,operator:F,value:L}=N.visibilityCondition,J=Ee(z,Y);switch(F){case"equals":return J===L;case"notEquals":return J!==L;case"in":return Array.isArray(L)&&L.includes(J);case"notIn":return Array.isArray(L)&&!L.includes(J);case"greaterThan":return J>L;case"lessThan":return J<L;case"contains":return String(J).includes(String(L));default:return!0}},ze=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const N=B.value.filter(z=>{if(z.visibleRule)try{const F=H.value[0]||{};if(!Ft.apply(z.visibleRule,F))return!1}catch(F){console.warn("Header action visibility logic error:",F)}if(r.ignorePermissions||r.dummyMode)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 Y=Ve(z.permission);return console.log("[DEBUG] Internal permission check:",{label:z.label,permission:z.permission,hasPerm:Y}),Y});return console.log("[DEBUG] Filtered header actions:",N.length),N}),Re=e.computed(()=>V.value.length===0?V.value:V.value.filter(N=>r.ignorePermissions||r.dummyMode||!N.permission?!0:r.checkPermission?r.checkPermission(N.permission):r.permissions?r.permissions.includes(N.permission):Ve(N.permission))),Ue=N=>Re.value.filter(z=>Ne(z,N)),Me=(N,z)=>{var L,J;if(N.requiredCondition&&((L=N.propCustomCondition)==null?void 0:L.length)>0){const ie=Ee(z,"status"),ge=N.propCustomCondition.find(be=>be.value===ie);if(ge)return ge.bgColor||N.bgColor||"primary"}if(!N.dynamicColor||!N.colorCondition)return N.bgColor||"primary";const Y=Ee(z,N.colorCondition.field),F=(J=N.colorCondition.conditions)==null?void 0:J.find(ie=>ie.value===Y);return(F==null?void 0:F.bgColor)||N.bgColor||"primary"},Ze=N=>{const z=(N||"left").toLowerCase();return z==="center"?"justify-center":z==="right"?"justify-end":"justify-start"},ct={ToggleLeft:te.ToggleLeft,SquarePen:te.SquarePen,Trash2:te.Trash2,Eye:te.Eye,CheckCircle:te.CheckCircle,Plus:te.Plus,Download:te.Download,RefreshCw:te.RefreshCw,Search:te.Search,SlidersHorizontal:te.SlidersHorizontal},St=N=>N&&(bn(N,At)||ct[N])||null,H=e.computed(()=>r.dummyMode?X.value.length>0?P(10):[]:ee.value?k.value.map((N,z)=>({...N,no:(f.value-1)*m.value+z+1})):se.value),re=e.computed(()=>r.dummyMode?10:ee.value?w.value:Q.value.length),pe=e.computed(()=>re.value===0?0:(f.value-1)*m.value+1),Ie=e.computed(()=>{const N=f.value*m.value;return N>re.value?re.value:N}),Ee=(N,z)=>{if(!(!N||!z))return z in N?N[z]:z.split(".").reduce((Y,F)=>Y&&Y[F],N)},Q=e.computed(()=>{if(ee.value)return[];if(!u.value)return r.data;const N=u.value.toLowerCase();return r.data.filter(z=>X.value.some(Y=>{const F=Ee(z,Y.key);return F==null?!1:String(F).toLowerCase().includes(N)}))}),oe=e.computed(()=>ee.value?[]:h.value.key?[...Q.value].sort((z,Y)=>{const F=Ee(z,h.value.key),L=Ee(Y,h.value.key);if(F===L)return 0;let J=0;return typeof F=="number"&&typeof L=="number"?J=F-L:J=String(F).localeCompare(String(L)),h.value.direction==="asc"?J:-J}):Q.value),se=e.computed(()=>{if(ee.value)return[];const N=(f.value-1)*m.value,z=N+m.value;return oe.value.slice(N,z).map((Y,F)=>({...Y,no:N+F+1}))}),xe=e.computed(()=>ee.value?Object.values(p.value).some(N=>!!N):!!u.value),He=[10,25,50,100],zt=()=>{ee.value&&(p.value={...p.value,keyword:u.value},f.value=1,rt())};let qr;const Fd=()=>{r.enableQuickSearch&&(clearTimeout(qr),qr=setTimeout(()=>{zt()},500))};let Gr;const zd=()=>{clearTimeout(Gr),Gr=setTimeout(()=>{ee.value&&rt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&ee.value&&Fd()});const rt=async()=>{if(!r.dummyMode&&ee.value&&!(!G.value&&!Z.value))try{C.value=!0;const N={page:f.value,perPage:m.value,...p.value,...r.apiParams};u.value&&(N.keyword=u.value),Object.keys(N).forEach(Y=>{(N[Y]===""||N[Y]===null||N[Y]===void 0)&&delete N[Y]});let z;if(G.value)z=await i(G.value,q.value,N);else if(Z.value){let Y=Z.value;if(r.baseUrl&&typeof Y=="string"&&!Y.startsWith("http")){const F=r.baseUrl.replace(/\/$/,""),L=Y.startsWith("/")?Y:`/${Y}`;Y=`${F}${L}`}z=await i(Y,W.value,N)}Rd(z)}catch(N){console.error("DataTable fetch error",N),C.value=!1}},Rd=N=>{console.log("DataTable handleResponseData:",N),N&&(r.dynamicColumns&&N.columns&&Array.isArray(N.columns)&&(A.value=N.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}))),N.data&&Array.isArray(N.data)?(k.value=N.data,N.totalData?w.value=N.totalData:N.maxPage?w.value=N.maxPage*m.value:w.value=N.data.length*(N.maxPage||1)):Array.isArray(N)?(k.value=N,w.value=N.length):N.users?(k.value=N.users,w.value=N.users.length):N.items&&Array.isArray(N.items)?(k.value=N.items,w.value=N.total||N.totalItems||N.items.length):N.list&&Array.isArray(N.list)?(k.value=N.list,w.value=N.total||N.list.length):N.rows&&Array.isArray(N.rows)?(k.value=N.rows,w.value=N.count||N.total||N.rows.length):N.result&&Array.isArray(N.result)?(k.value=N.result,w.value=N.total||N.count||N.result.length):(console.warn("DataTable: Unknown response format",N),k.value=[],w.value=0)),C.value=!1};e.onUnmounted(()=>{clearTimeout(qr),clearTimeout(Gr)});const Kr=()=>{Object.keys(p.value).forEach(N=>{p.value[N]=""}),u.value="",f.value=1,rt()},Id=()=>{f.value=1,rt()},Xr=(N,z)=>{const Y=Ee(N,z.key);let F={variant:"secondary",class:"",label:Y};if(z.condition){const L=z.condition.find(J=>{if(J.logic||typeof J.value=="object"&&J.value!==null)try{const ge=J.logic||J.value;return Ft.apply(ge,N)}catch(ge){return console.warn("Badge logic error:",ge),!1}const ie=(ge,be)=>ge==null||be===void 0||be===null?!1:typeof ge=="string"&&typeof be=="string"?ge.toLowerCase().trim()===be.toLowerCase().trim():ge==be;if(ie(J.value,Y)||typeof Y=="object"&&Y!==null&&(ie(J.value,Y.code)||ie(J.value,Y.id)))return!0;if(z.key.includes(".")){const be=z.key.split(".").slice(0,-1).join("."),ye=Ee(N,be);if(ye&&typeof ye=="object"&&(ie(J.value,ye.code)||ie(J.value,ye.id)))return!0}return!1});if(L){L.variant&&(F.variant=L.variant);const ie=(l.value||"en")==="id"?L.labelID:L.labelEN;if(F.label=ie||L.label||(typeof Y=="object"?Y.name||Y.code:Y),L.color||L.bgColor){const ge=(L.color||L.bgColor||"").toLowerCase(),be=F.variant==="outline",ye={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"},Te={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"},Be={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};be?Te[ge]&&(F.class=Te[ge]):Be[ge]?F.variant=Be[ge]:ye[ge]&&(F.class=ye[ge])}}else F.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y}else F.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y;return F},Ld=N=>{h.value.key===N?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=N,h.value.direction="asc"),a("update:sort",h.value)},$s=N=>{N!==f.value&&(f.value=N,ee.value&&rt(),a("update:page",N))},$d=N=>{m.value=N,f.value=1,ee.value&&rt()},jd=N=>{const z=Math.random()*15+75;if(N.width){const Y=parseInt(String(N.width));return Y<100?`${Math.floor(Y*(Math.random()*.2+.7))}px`:`${z}%`}return`${z}%`},Yr=()=>{u.value="",p.value={},f.value=1,rt()},wA=N=>{var z;if(console.log("[DEBUG] handleHeaderAction called:",N),N.route&&!r.dummyMode){if(N.path){const Y=N.route.startsWith("/")?N.route:"/"+N.route;sessionStorage.setItem(`layout_${Y}`,N.path)}d==null||d.push(N.route)}else if(N.openDialog||r.dummyMode&&N.route){E.value=N,M.value=null,y.value={};const Y=N.fieldActionGlobal||N.field||[];Y.length&&Y.forEach(F=>{var ie;const L=N.endpoint||((ie=N.propsActionGlobal)==null?void 0:ie.endpointPropAction)||N.propsActionGlobal,J=L!=null&&L.keyParam&&L.keyParam.length>0?L.keyParam[0]:null;J&&F.model===J||!J&&/^(id|ids|idAuditTrail)/i.test(F.model)?y.value[F.model]=T.value:y.value[F.model]||(y.value[F.model]="")}),_.value=!0}else a("action",{action:((z=N.propsActionCustom)==null?void 0:z.key)||N.key||"create",row:null,selection:T.value})},CA=async(N,z)=>{var Y,F,L,J;if(N.requireConfirm){x.value={button:N,row:z},b.value=!0;return}if(N.openDialog){E.value=N,M.value=z,y.value={};const ie=X.value.find(ye=>ye.type==="CHECKBOX"),ge=(ie==null?void 0:ie.keyCheckbox)||"id";N.fieldActionCustom&&N.fieldActionCustom.forEach(ye=>{/^(id|ids|idAuditTrail)/i.test(ye.model)?y.value[ye.model]=[z[ge]]:N.action==="showToken"&&ye.model==="token"?y.value[ye.model]=z.token!==void 0?z.token:"":z[ye.model]!==void 0?y.value[ye.model]=z[ye.model]:y.value[ye.model]=""});const be=N.endpoint||((Y=N.propsActionGlobal)==null?void 0:Y.endpointPropAction)||((F=N.propsActionCustom)==null?void 0:F.endpointPropAction)||((L=N.props)==null?void 0:L.endpointPropAction);if(((J=be==null?void 0:be.apiMethod)==null?void 0:J.toUpperCase())==="GET"&&be.apiUrl){C.value=!0;const{apiUrl:ye}=Ke(),Te={};be.keyParam&&Array.isArray(be.keyParam)&&be.keyParam.forEach((Be,De)=>{const ht=be.model&&De===0?be.model:Be;z[Be]!==void 0&&(Te[ht]=z[Be])}),Object.keys(Te).length===0&&z.id&&(Te.id=z.id),ye(be.apiUrl,"GET",Te).then(Be=>{let De=Be;if(Be&&Be.data!==void 0?De=Be.data:Be&&Be.result!==void 0&&(De=Be.result),De!=null){if(typeof De=="string")y.value.hasOwnProperty("token")&&(y.value.token=De);else if(typeof De=="object"&&(De.item&&(De=De.item),Array.isArray(De)&&(De=De[0]||{}),Object.keys(De).forEach(ht=>{y.value[ht]=De[ht]}),!y.value.token)){const ht=Object.keys(De).find(Rt=>Rt.toLowerCase().includes("token"));if(ht)y.value.token=De[ht];else{const Rt=Object.values(De).filter(Qr=>typeof Qr=="string");Rt.length===1&&(y.value.token=Rt[0])}}}_.value=!0}).catch(Be=>{console.error("Fetch Data Failed",Be)}).finally(()=>{C.value=!1});return}_.value=!0;return}Ud(N,z)},Ud=(N,z)=>{if(N.route){if(N.path){const L=N.route.startsWith("/")?N.route:"/"+N.route;sessionStorage.setItem(`layout_${L}`,N.path)}let Y=N.route;Y.includes(":")?Y=Y.replaceAll(/:([a-zA-Z0-9_]+)/g,(L,J)=>z[J]||z.id||J):z.id&&(Y=`${Y.replace(/\/$/,"")}/${z.id}`);const F={};N.path&&(F.code=N.path),d==null||d.push({path:Y,query:F})}else if(N.endpoint&&N.endpoint.apiUrl){C.value=!0;const{apiUrl:Y}=Ke(),F=N.endpoint.apiUrl,L=N.endpoint.apiMethod||"POST",J={},ie=N.fieldMapping;if(ie&&typeof ie=="object"){const{locale:ge}=gt.useI18n(),be=ge.value||"en",ye=[];if(Object.entries(ie).forEach(([Te,Be])=>{if(typeof Be=="string"){const De=Ee(z,Te);De!==void 0?J[Be]=De:(console.warn(`[MAPPING-DEBUG] No matching source found for '${Te}'`),ye.push(Te))}}),ye.length>0){const Te=be==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Be=be==="id"?`Terdapat ketidaksesuaian skema pada field: ${ye.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${ye.join(", ")}. Please contact the development team.`;Pe.warning(`${Te}: ${Be}`,{autoClose:5e3,position:"top-right"})}}if(Object.keys(J).length===0){const ge=N.endpoint;ge.model&&ge.keyParam&&Array.isArray(ge.keyParam)?ge.keyParam.forEach(be=>{const ye=Ee(z,be);ye!==void 0&&(J[ge.model]=ye)}):z.id&&(J.id=z.id)}Y(F,L,J).then(()=>{rt(),a("action",{action:N.action||"success",row:z})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{C.value=!1})}else a("action",{action:N.action,row:z})},BA=()=>{x.value&&(Ud(x.value.button,x.value.row),Wd())},EA=()=>{var N,z,Y;if(E.value){const F=E.value,L=F.endpoint||((N=F.propsActionGlobal)==null?void 0:N.endpointPropAction)||F.propsActionGlobal;let J=(L==null?void 0:L.model)||(L!=null&&L.keyParam&&L.keyParam.length>0?L.keyParam[0]:null);if(!J){const ye=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(Te=>/^(id|ids|idAuditTrail)/i.test(Te.model));J=ye?ye.model:"ids"}let ie=null,ge=!1;if(M.value){const be=X.value.find(Be=>Be.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=M.value[ye];if(L!=null&&L.apiUrl){ie={...y.value};const Be=F.fieldMapping;Be&&typeof Be=="object"&&Object.entries(Be).forEach(([De,ht])=>{if(typeof ht=="string"){const Rt=Ee(M.value,De);Rt!==void 0&&(ie[ht]=Rt)}}),ie[J]||(ie[J]=L!=null&&L.model?Te:[Te]),ge=!0}}else L!=null&&L.apiUrl&&(ie={...y.value},ie[J]||(ie[J]=T.value||[]),ge=!0);if(ge&&ie&&(L!=null&&L.apiUrl)){if(((z=L==null?void 0:L.apiMethod)==null?void 0:z.toUpperCase())==="GET"){_.value=!1,M.value||(T.value=[]);return}const{apiUrl:be}=Ke(),ye=L.apiUrl,Te=L.apiMethod||"POST";be(ye,Te,ie).then(()=>{_.value=!1,M.value||(T.value=[]),rt(),a("action",{action:"success",row:null})}).catch(Be=>{console.error("Action Failed",Be)})}else if(M.value){const be=X.value.find(De=>De.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=M.value[ye],Be={...y.value};Be[J]||(Be[J]=[Te]),a("action",{action:E.value.action,row:Be}),_.value=!1}else{const be={...y.value};be[J]||(be[J]=T.value);const ye={action:((Y=E.value.propsActionGlobal)==null?void 0:Y.key)||E.value.key,row:be,selection:T.value};a("action",ye),_.value=!1}}},_A=N=>{const z=y.value[N];z&&Nm(String(z)).then(()=>{Pe.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Y=>{console.error("Failed to copy",Y)})},Wd=()=>{b.value=!1,x.value=null},SA=e.computed(()=>x.value?x.value.button.confirmTitle||"Confirm":""),AA=e.computed(()=>x.value?x.value.button.confirmMessage||"Confirm":"");n({fetchData:rt,filters:p,resetFilters:Kr,handleRefresh:Yr});const Jr=e.ref(""),VA=N=>{if(!N)return"";const z=N.endpoint||N.endpointGlobal||{};return JSON.stringify({url:z.apiUrl||N.apiUrl,module:z.apiModule||N.apiModule,action:z.apiAction||N.apiAction,method:z.apiMethod||N.apiMethod,params:N.apiParams,socket:z.socket||N.socketEndpoint,socketParams:N.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){me();const N=VA(r.tableConfig);N!==Jr.value&&(!Jr.value&&ee.value?(Jr.value=N,rt()):(Jr.value=N,ee.value&&zd()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{ee.value&&rt()}),e.watch(()=>r.apiParams,()=>{ee.value&&rt()},{deep:!0}),e.watch(()=>B.value,N=>{console.log("[DEBUG] headerActions changed:",N.length,"items");const z=ze.value;console.log("[DEBUG] visibleHeaderActions evaluated:",z.length,"items")},{deep:!0}),e.onMounted(()=>{me(),ee.value&&(r.tableConfig||(C.value=!0,rt()))}),(N,z)=>{var Y;return e.openBlock(),e.createElementBlock("div",y2,[e.createElementVNode("div",x2,[e.createElementVNode("div",k2,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",w2,[e.createElementVNode("div",C2,[e.createVNode(e.unref(te.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(t_),{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(zt,["enter"])},null,8,["modelValue"])]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",B2,[e.createVNode(QE,null,{trigger:e.withCtx(()=>[e.createVNode(Le,{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",V2,[e.renderSlot(N.$slots,"filter-footer",{fetch:rt,reset:Kr})])]),default:e.withCtx(()=>[z[9]||(z[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",E2,[e.renderSlot(N.$slots,"filter-form",{filters:p.value},()=>[g.value.length>0?(e.openBlock(),e.createElementBlock("div",_2,[e.createElementVNode("div",S2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,(F,L)=>(e.openBlock(),e.createElementBlock("div",{key:L,class:e.normalizeClass(ke(F))},[e.createVNode(gd,{field:F,modelValue:p.value[F.model],"onUpdate:modelValue":J=>p.value[F.model]=J},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",A2,[e.createVNode(Le,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Kr,disabled:K.value},null,8,["disabled"]),e.createVNode(Le,{onClick:Id,disabled:K.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",D2)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{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:Yr,disabled:K.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(te.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":K.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(F,L)=>(e.openBlock(),e.createBlock(Le,{key:L,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:J=>wA(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(N.$slots,"header-actions")],2)])]),e.createElementVNode("div",N2,[e.createElementVNode("table",M2,[e.createElementVNode("thead",P2,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,class:e.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"text-left",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:L=>F.sortable&&Ld(F.key)},[F.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",v2,[e.createVNode(Yt,{"model-value":$.value,indeterminate:v.value,"onUpdate:modelValue":z[1]||(z[1]=L=>j(!!L)),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",Ze(F.align)])},[e.createElementVNode("span",null,e.toDisplayString(F.label),1)],2))],14,T2))),128)),O.value?(e.openBlock(),e.createElementBlock("th",O2,[...z[10]||(z[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",F2,[K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,F=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${F}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,L=>{var J,ie;return e.openBlock(),e.createElementBlock("td",{key:L.key,class:e.normalizeClass([L.align?`text-${L.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(L.type??"")||L.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((J=L.align)==null?void 0:J.toLowerCase())==="center"?"mx-auto":"",((ie=L.align)==null?void 0:ie.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(L.type??"")||L.condition?void 0:jd(L),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",z2,[...z[11]||(z[11]=[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)):H.value.length===0?(e.openBlock(),e.createElementBlock("tr",R2,[e.createElementVNode("td",{colspan:X.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",L2,[e.createVNode(e.unref(eu.Vue3Lottie),{animationData:e.unref(m2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",$2,e.toDisplayString(xe.value?"No search results":"No data"),1),e.createElementVNode("p",j2,e.toDisplayString(xe.value?"Try changing keywords":"No data added"),1)])])],8,I2)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H.value,(F,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:L},[e.createElementVNode("tr",U2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,J=>(e.openBlock(),e.createElementBlock("td",{key:J.key,class:e.normalizeClass([J.align?`text-${J.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(N.$slots,`cell-${J.key}`,{row:F,value:Ee(F,J.key)},()=>[J.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",W2,[e.createVNode(Yt,{"model-value":I(F),"onUpdate:modelValue":ie=>U(F,!!ie),onClick:z[3]||(z[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):J.type==="badge"||J.type==="BADGE"||J.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[J.align?`justify-${J.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(Fs,{variant:Xr(F,J).variant,class:e.normalizeClass([Xr(F,J).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xr(F,J).label),1)]),_:2},1032,["variant","class"])],2)):J.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*m.value+L+1),1)],64)):J.type==="date"||J.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Ee(F,J.key)?e.unref(Vm)(Ee(F,J.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(J.format?J.format(Ee(F,J.key)):Ee(F,J.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",H2,[e.renderSlot(N.$slots,"actions",{row:F,buttons:Ue(F),getButtonColor:Me,getIconComponent:St},()=>[Ue(F).length>0?(e.openBlock(),e.createElementBlock("div",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue(F),(J,ie)=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:"group relative"},[e.createVNode(Le,{tooltip:J.tooltip||J.label,icon:J.icon,text:J.icon?"":J.label||(e.unref(l)==="id"?"Aksi":"Action"),size:J.icon?"icon":"sm",rounded:J.rounded||"sm",borderStyle:J.borderStyle||"none",variant:J.variant||"ghost","bg-color":Me(J,F),onClick:ge=>CA(J,F)},null,8,["tooltip","icon","text","size","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),N.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",G2,[e.createElementVNode("td",{colspan:X.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(N.$slots,"expanded-row",{row:F,index:L})],8,K2)])):e.createCommentVNode("",!0)],64))),128))])])]),!K.value&&H.value.length>0&&t.showPagination&&S.value?(e.openBlock(),e.createElementBlock("div",X2,[e.createElementVNode("div",Y2,[e.createVNode(e.unref(d_),{"model-value":String(m.value),"onUpdate:modelValue":z[4]||(z[4]=F=>$d(Number(F)))},{default:e.withCtx(()=>[e.createVNode(e.unref(g_),{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(b_),{placeholder:String(m.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(u_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(He,F=>e.createVNode(e.unref(m_),{key:F,value:String(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),z[16]||(z[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",J2,[z[12]||(z[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",Q2,e.toDisplayString(pe.value),1),z[13]||(z[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",Z2,e.toDisplayString(Ie.value),1),z[14]||(z[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",eS,e.toDisplayString(re.value),1),z[15]||(z[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",tS,[e.createVNode(e.unref(n_),{total:re.value,"items-per-page":m.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":$s,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(o_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:F})=>[e.createVNode(e.unref(a_),{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(te.ChevronsLeft),{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(te.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(L,J)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[L.type==="page"?(e.openBlock(),e.createBlock(e.unref(s_),{key:J,value:L.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(_t),{class:"w-8 h-8 p-0 text-sm",variant:L.value===f.value?"default":"outline",disabled:L.value===f.value,onClick:ie=>$s(L.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(r_),{key:L.type,index:J},null,8,["index"]))],64))),256)),e.createVNode(e.unref(l_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(i_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Jt,{modelValue:b.value,"onUpdate:modelValue":z[5]||(z[5]=F=>b.value=F),title:SA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",onClick:Wd,text:"Cancel"}),e.createVNode(Le,{variant:"default",onClick:BA,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",nS,[e.createElementVNode("p",oS,e.toDisplayString(AA.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:_.value,"onUpdate:modelValue":z[8]||(z[8]=F=>_.value=F),title:((Y=E.value)==null?void 0:Y.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var F;return[e.createVNode(Le,{variant:"outline",onClick:z[6]||(z[6]=L=>_.value=!1),text:"Cancel"}),t.dummyMode&&((F=E.value)!=null&&F.route)?(e.openBlock(),e.createBlock(Le,{key:1,variant:"default",onClick:z[7]||(z[7]=L=>_.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Le,{key:0,variant:"default",onClick:EA,text:"Save"}))]}),default:e.withCtx(()=>{var F,L,J;return[e.createElementVNode("div",rS,[t.dummyMode&&((F=E.value)!=null&&F.route)?(e.openBlock(),e.createElementBlock("div",aS,[e.createElementVNode("div",sS,[e.createVNode(e.unref(te.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",iS,[e.createElementVNode("span",lS,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",cS,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${E.value.route}`:`This action will navigate to: ${E.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((L=E.value)==null?void 0:L.fieldActionCustom)||((J=E.value)==null?void 0:J.fieldActionGlobal)||[],(ie,ge)=>{var be,ye,Te,Be;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ge},[!ie.isHidden&&!(t.dummyMode&&((be=E.value)!=null&&be.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ke(ie))},[e.createElementVNode("div",dS,[e.createVNode(gd,{class:"flex-1 w-full",field:ie,modelValue:y.value[ie.model],"onUpdate:modelValue":De=>y.value[ie.model]=De},null,8,["field","modelValue","onUpdate:modelValue"]),ie.isCopyable||(ye=ie.props)!=null&&ye.isCopyable||((Te=E.value)==null?void 0:Te.action)==="showToken"||((Be=E.value)==null?void 0:Be.action)==="copyToken"?(e.openBlock(),e.createBlock(Le,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:De=>_A(ie.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}}),uS={class:"flex items-center gap-2 shrink-0"},fS={class:"flex-1 text-right overflow-hidden"},mS=["title"],No=at(e.defineComponent({name:"DCodeStaticLabel",__name:"DCodeStaticLabel",props:{label:{},value:{},icon:{},color:{}},setup(t){const n=t,o=e.computed(()=>{const a=n.color||"secondary",s={primary:"border-blue-200 text-blue-700",success:"border-green-200 text-green-700",warning:"border-yellow-200 text-yellow-700",danger:"border-red-200 text-red-700",info:"border-cyan-200 text-cyan-700",secondary:"border-slate-200 text-slate-700 dark:border-slate-700/50",dark:"border-b border-gray-300 text-gray-900 dark:text-gray-100"};return s[a]||s.secondary}),r=a=>a==null||a===""?"-":typeof a=="boolean"?a?"Yes":"No":String(a);return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row justify-between items-center gap-4 py-3 px-0 border-b transition-all duration-300 rounded-none bg-transparent",o.value])},[e.createElementVNode("div",uS,[e.createVNode(Dn,{label:t.label,icon:t.icon,class:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider"},null,8,["label","icon"])]),e.createElementVNode("div",fS,[e.renderSlot(a.$slots,"value",{},()=>[e.createElementVNode("span",{class:"text-sm font-medium truncate block",title:r(t.value)},e.toDisplayString(r(t.value)),9,mS)],!0)])],2))}}),[["__scopeId","data-v-19682b84"]]),hS={class:"space-y-2 group"},pS=["onClick"],gS=["src","alt"],bS={key:0,class:"absolute inset-0 bg-black/0 group-hover/item:bg-black/20 flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-all duration-300"},yS={class:"bg-white/90 dark:bg-neutral-800/90 p-1.5 rounded-full shadow-sm"},xS={key:0,class:"flex flex-col h-full"},kS={class:"flex flex-col items-center justify-center p-8 bg-neutral-50 dark:bg-neutral-950/50"},wS=["src","alt"],CS={class:"px-8 py-4 bg-white dark:bg-neutral-900 border-t border-neutral-200 dark:border-neutral-700/50"},BS={class:"flex flex-col space-y-0.5"},Dd=at(e.defineComponent({name:"DCodeStaticImage",__name:"DCodeStaticImage",props:{items:{},alt:{default:"Image"},label:{},aspectRatio:{default:"16/9"},width:{},height:{},fit:{default:"cover"},rounded:{type:Boolean,default:!1},allowPreview:{type:Boolean,default:!0},columns:{default:3},gap:{default:"0.5rem"}},setup(t){const n=t,o=e.computed(()=>Array.isArray(n.items)?n.items.map(d=>typeof d=="string"?{src:d,alt:n.alt}:{...d,alt:d.alt||n.alt}):[]),r=e.ref(null),a=e.ref(!1),s=d=>{n.allowPreview&&(r.value=d,a.value=!0)},i=()=>{r.value=null,a.value=!1},l=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${n.columns}, minmax(0, 1fr))`,gap:n.gap,width:n.width||"100%"})),c=e.computed(()=>["w-full h-full transition-all duration-500",n.rounded?"rounded-xl":"rounded-none",n.fit==="cover"?"object-cover":n.fit==="contain"?"object-contain":n.fit==="fill"?"object-fill":"object-none"].join(" "));return e.onMounted(()=>{window.addEventListener("keydown",d=>{r.value!==null&&d.key==="Escape"&&i()})}),(d,u)=>(e.openBlock(),e.createElementBlock("div",hS,[e.createElementVNode("div",{style:e.normalizeStyle(l.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(f,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"flex flex-col space-y-1 group/item"},[e.createElementVNode("div",{class:e.normalizeClass(["relative overflow-hidden bg-neutral-100 dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 transition-all duration-300 transform hover:scale-[1.02] hover:z-10",[t.rounded?"rounded-xl":"rounded-none",t.allowPreview?"cursor-zoom-in":""]]),style:e.normalizeStyle({aspectRatio:t.aspectRatio}),onClick:h=>s(m)},[e.createElementVNode("img",{src:f.src,alt:f.alt,class:e.normalizeClass(c.value),loading:"lazy"},null,10,gS),t.allowPreview?(e.openBlock(),e.createElementBlock("div",bS,[e.createElementVNode("div",yS,[e.createVNode(e.unref(te.Maximize2),{class:"w-3.5 h-3.5 text-neutral-700 dark:text-neutral-200"})])])):e.createCommentVNode("",!0)],14,pS)]))),128))],4),e.createVNode(Jt,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=f=>a.value=f),title:(r.value!==null?o.value[r.value].label:null)||t.label||"Preview Image","max-width":"1200",persistent:!1,onClose:i},{"header-append":e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"p-2 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-full text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 transition-colors",onClick:i},[e.createVNode(e.unref(te.X),{class:"w-5 h-5"})])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-5 py-2 text-sm font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 rounded-md hover:bg-neutral-200 dark:hover:bg-neutral-700 transition-colors",onClick:i}," Close Preview ")]),default:e.withCtx(()=>[r.value!==null?(e.openBlock(),e.createElementBlock("div",xS,[e.createElementVNode("div",kS,[e.createElementVNode("img",{src:o.value[r.value].src,alt:o.value[r.value].alt||t.alt,class:"max-w-full max-h-[60vh] object-contain shadow-2xl rounded-sm border border-neutral-200 dark:border-white/10"},null,8,wS)]),e.createElementVNode("div",CS,[e.createElementVNode("div",BS,[e.createVNode(No,{label:"File Name",value:o.value[r.value].src.split("/").pop()||"Untitled"},null,8,["value"]),o.value[r.value].label?(e.openBlock(),e.createBlock(No,{key:0,label:"Item Label",value:o.value[r.value].label},null,8,["value"])):e.createCommentVNode("",!0),t.label?(e.openBlock(),e.createBlock(No,{key:1,label:"Gallery Label",value:t.label},null,8,["value"])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])]))}}),[["__scopeId","data-v-ac931980"]]);function ES(){const t=e.reactive({}),n=e.reactive({}),o=e.reactive({}),r=e.reactive({}),a=e.reactive({}),s=e.ref(!1),i=e.ref(null),l=e.reactive({}),c=e.reactive({visible:!1,title:"",message:"",action:null});return{formData:t,errors:n,fieldErrors:o,wizardState:r,inlineState:a,isSubmitting:s,internalSchema:i,rawItemsCache:l,confirmDialog:c}}const Ur=t=>{var n,o,r;return((n=t.propsForm)==null?void 0:n.key)||((o=t.propsTable)==null?void 0:o.key)||((r=t.propsWizard)==null?void 0:r.key)||t.id},Nn=(t,n)=>n?n.split(".").reduce((o,r)=>o==null?void 0:o[r],t):void 0,Nd=(t,n,o)=>{if(!n)return;const r=n.split(".");let a=t;for(let s=0;s<r.length-1;s++){const i=r[s];(a[i]===void 0||a[i]===null||typeof a[i]!="object")&&(a[i]={}),a=a[i]}a[r[r.length-1]]=o},Mn=t=>{const n=e.toRaw(t);if(Array.isArray(n))return n.map(o=>Mn(o));if(n&&typeof n=="object"){const o={};return Object.keys(n).forEach(r=>o[r]=Mn(n[r])),o}return n},Wr=t=>{if(!t||typeof t!="object")return[];if("var"in t)return[t.var];let n=[];return Object.values(t).forEach(o=>{Array.isArray(o)?o.forEach(r=>{n=n.concat(Wr(r))}):typeof o=="object"&&(n=n.concat(Wr(o)))}),n},_S=t=>t?[...t].sort((n,o)=>(n.seq||0)-(o.seq||0)):[],zs=(t,n)=>{if(!t||typeof t!="string"||t.startsWith("http")||!n)return t;const o=n.replace(/\/$/,""),r=t.startsWith("/")?t:`/${t}`;return`${o}${r}`};function SS({formData:t,errors:n,fieldMap:o,rawItemsCache:r,activeSchema:a,locale:s}){const i=(_,y)=>{if(y==null||typeof y=="object"&&y._isLogicValue)return y;const x=o.value.get(_);if(!x)return y;const E=x.field,M=r[E.key];if(!M||!Array.isArray(M))return y;const $=(E.props||{}).itemValue||"id",v=M.find(I=>String(I[$])===String(y)||String(I.id)===String(y)||String(I.code)===String(y));return v!=null&&v.code?{id:y,code:v.code,_isLogicValue:!0}:y},l=_=>{const y=(x,E)=>{if(x==null||typeof x=="object"&&x._isLogicValue)return x;if(typeof x=="boolean")return String(x);if(typeof x=="number"||typeof x=="string")return E?i(E,x):x;if(typeof x=="object"&&!Array.isArray(x)){const M=(x==null?void 0:x.id)??(x==null?void 0:x.code)??(x==null?void 0:x.value)??(x==null?void 0:x.key)??x;return E&&(typeof M=="string"||typeof M=="number")?i(E,M):M}return x};return new Proxy(_,{get(x,E){if(typeof E!="string")return x[E];const M=o.value.get(E);if(M){const T=Nn(x,M.path);if(T!=null)return y(T,E)}return y(x[E],E)}})},c=e.computed(()=>l(t)),d=(_,y,x="LOGIC")=>{if(_==null||typeof _=="object"&&Object.keys(_).length===0)return!0;if(typeof _=="boolean")return _;if(typeof _=="object")try{return Ft.apply(_,y)}catch(E){return console.error(`[${x}] JsonLogic error:`,E),!1}return!1},u=(_,y,x)=>_==null?null:Array.isArray(_)?_.find(E=>!E.condition||d(E.condition,y))||null:_,f=(_,y)=>{var T;if(_.isHidden)return!0;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.visibleRule;if(E==null)return!0;const M=u(E,x,`VISIBLE-${_.model}`);return M===null?!0:typeof M=="object"?!!d(M,x,`VISIBLE-${_.model}`):!!M},m=(_,y)=>{var T,$,v;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.requiredRule;if(E==null)return(($=_.props)==null?void 0:$.required)||!1;const M=u(E,x,`REQUIRED-${_.model}`);return M===null?((v=_.props)==null?void 0:v.required)||!1:typeof M=="object"?"required"in M?!!M.required:!!d(M,x):!!M},h=(_,y)=>{var T,$,v;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.disabledRule;if(E==null)return(($=_.props)==null?void 0:$.disabled)||!1;const M=u(E,x,`DISABLED-${_.model}`);return M===null?((v=_.props)==null?void 0:v.disabled)||!1:typeof M=="object"?"disabled"in M?!!M.disabled:!!d(M,x):!!M},k=_=>{var T;const y=_.propsForm||_.propsTable||_.propsWizard||_.props||{};let x=s.value==="id"?y.titleID||_.titleID||_.labelID:y.titleEN||_.titleEN||_.labelEN,E=s.value==="id"?y.descriptionID||_.descriptionID:y.descriptionEN||_.descriptionEN;const M=u((T=_.logic||y.logic)==null?void 0:T.labelingRule,c.value);return M&&(x=s.value==="id"?M.labelID||M.titleID||M.title:M.labelEN||M.titleEN||M.title,E=s.value==="id"?M.descriptionID:M.descriptionEN),{title:x,description:E}},C=(_,y)=>{var $,v;if(!_)return!0;const x=_.propsForm||_.propsTable||_.propsWizard||_.props||{},E=($=_.logic||x.logic)==null?void 0:$.visibleRule,M=y?l(y):c.value;if(E!=null){const I=u(E,M);return I===null?!0:typeof I=="object"?!!d(I,M,"VISIBLE-SEC"):!!I}if(_.type==="TABLE"&&((v=x.headers)!=null&&v.length))return!0;const T=x.fields||_.fields||[];return T.length===0||T.some(I=>f(I,y))},w=(_,y)=>{var M;const x=y?l(y):c.value;return u((M=_.logic)==null?void 0:M.labelingRule,x,`LABEL-${_.model}`)||null},p=(_,y)=>{var M;const x=y?l(y):c.value;return u((M=_.logic)==null?void 0:M.lengthRule,x,`LENGTH-${_.model}`)||null},A=(_,y)=>{var I;const x=_.props||{},E=r[_.key]||x.items||x.options||[];if(!((I=_.logic)!=null&&I.optionsFilterRule))return E;const M=y?l(y):c.value,T=u(_.logic.optionsFilterRule,M,`FILTER-${_.model}`);if(!(T!=null&&T.values))return E;const $=new Set((T.values||[]).map(String)),v=x.itemValue||"id";return E.filter(j=>j==null?!1:typeof j!="object"?$.has(String(j)):[v,"code","id","value","key"].some(U=>{const P=j[U];return P!=null&&$.has(String(P))}))},D=_=>{var x;return(((x=_.propsWizard)==null?void 0:x.propsSteps)||[]).filter(E=>C(E)).map((E,M)=>{var v;let T=[];if(Array.isArray(E.sectionsWizard))T=E.sectionsWizard;else if(E.sectionsWizard&&typeof E.sectionsWizard=="object"){const I=E.sectionsWizard;let j=I.type;j||(I.fields?j="FORM":I.isDataTable?j="TABLE":j="UNKNOWN"),T=[{type:j,...I}]}const $=k(E);return{key:E.key||`step-${M}`,title:$.title,description:$.description,icon:E.icon||void 0,sections:T,actions:((v=E.propsComponent)==null?void 0:v.actionComponent)||E.actionComponent||[]}})},S=()=>{var _;if((_=a.value)!=null&&_.sections)for(let y=0;y<3;y++){let x=!1;if(a.value.sections.forEach(E=>{var M;(((M=E.propsForm)==null?void 0:M.fields)||E.fields||[]).forEach(T=>{var v;const $=(v=T.logic)==null?void 0:v.calculateRule;if($&&typeof $=="object"){const I=Object.keys($)[0],j=d($[I],c.value,`CALC-${I}`);j!==void 0&&t[I]!==j&&(t[I]=j,x=!0)}})}),!x)break}},V=_=>{if(!f(_)||!m(_))return!1;const y=t[_.model];return Array.isArray(y)?y.length===0:y==null||y===""},B=_=>_.sections.flatMap(x=>x.fields||[]).some(V),g=_=>{var x;return(((x=_.propsForm)==null?void 0:x.fields)||_.fields||[]).some(V)?!0:_.type==="WIZARD"?D(_).some(B):!1},b=e.computed(()=>{var _;return(_=a.value)!=null&&_.sections?Object.keys(n).length>0?!0:a.value.sections.some(g):!1});return{normalizedData:c,getNormalizedData:l,evaluateLogic:d,resolveActiveRule:u,resolveValueIdentifier:i,getFilteredItems:A,isFieldVisible:f,isFieldRequired:m,isFieldDisabled:h,resolveSectionLabels:k,isSectionVisible:C,resolveFieldLabels:w,resolveFieldLength:p,getWizardTabs:D,applyCalculations:S,isSubmitDisabled:b,resolveSectionGridClass:_=>{switch(_){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}},resolveFieldColumnClass:(_,y="")=>{var E;const x=(E=_.props)==null?void 0:E.colSpan;return x==="FULL"?"col-span-1 md:col-span-full":x==="HALF"?"col-span-1 md:col-span-1":"col-span-1"}}}function AS({formData:t,locale:n,errors:o,fieldMap:r,activeSchema:a,isSectionVisible:s,isFieldVisible:i,isFieldRequired:l,resolveFieldLength:c}){const d=(f,m,h)=>{const k=f.props||f.propsFieldGlobal||{},C=m==null?"":String(m).trim();if(l(f,h)&&C==="")return n.value==="id"?"Wajib diisi":"Required";if(C==="")return null;const w=c==null?void 0:c(f,h),p=Number((w==null?void 0:w.minLength)??k.minLength),A=Number((w==null?void 0:w.maxLength)??k.maxLength);if(!Number.isNaN(p)&&p>0&&C.length<p)return n.value==="id"?`Minimal ${p} karakter`:`Minimum ${p} characters`;if(!Number.isNaN(A)&&A>0&&C.length>A)return n.value==="id"?`Maksimal ${A} karakter`:`Maximum ${A} characters`;if(k.regex)try{if(!new RegExp(k.regex).test(C))return k.regexMessage||(n.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${f.model}:`,k.regex)}return null};return{validateField:d,validateAll:()=>{var m,h;let f=!0;return(h=(m=a.value)==null?void 0:m.sections)==null||h.forEach(k=>{var C;s(k)&&(((C=k.propsForm)==null?void 0:C.fields)||k.fields||[]).forEach(w=>{if(w.model&&i(w)){const p=r.value.get(w.model),A=p?Nn(t,p.path):t[w.model],D=d(w,A);D&&(o[w.model]=D,f=!1)}})}),f}}}function VS({formData:t,activeSchema:n,isSectionVisible:o,isFieldVisible:r,getWizardTabs:a}){const s=()=>{var f;const d=[],u=m=>{m==null||m.forEach(h=>{var C;if(h.type==="TABLE"||h.propsTable){const w=h.propsTable||h;w.modelDatatable&&d.push({key:w.modelDatatable,subFields:(w.headers||[]).map(p=>p.key)})}(((C=h.propsForm)==null?void 0:C.fields)||h.fields||[]).forEach(w=>{var A,D;const p=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(w.component);if(w.model&&((A=w.props)!=null&&A.multiple||((D=w.props)==null?void 0:D.valueType)==="array"||p)){const S=w.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];d.push({key:w.model,subFields:S})}}),h.type==="WIZARD"&&a(h).forEach(w=>u(w.sections))})};return u((f=n.value)==null?void 0:f.sections),d};return{getCleanPayload:()=>{var f;if(!((f=n.value)!=null&&f.sections))return{...t};const d={},u=new Set;return n.value.sections.forEach(m=>{var C,w;if(!o(m))return;const h=Ur(m),k=(p,A)=>{if(p.model)if(r(p)){const D=Nn(t,A?`${A}.${p.model}`:p.model)??t[p.model];d[p.model]=Mn(D)??null,u.add(p.model)}else t[p.model]!==void 0&&(d[p.model]=null)};if((((C=m.propsForm)==null?void 0:C.fields)||m.fields||[]).forEach(p=>{var A;return k(p,h||((A=m.propsForm)==null?void 0:A.key))}),m.type==="WIZARD"&&a(m).forEach(p=>p.sections.forEach(A=>(A.fields||[]).forEach(D=>k(D,p.key)))),(w=m.propsTable)!=null&&w.modelDatatable){const p=m.propsTable.modelDatatable;d[p]=Mn(Nn(t,h?`${h}.${p}`:p)??t[p]),u.add(p)}}),["id","_id"].forEach(m=>{t[m]!==void 0&&!u.has(m)&&(d[m]=Mn(t[m]))}),d},applyFieldMapping:(d,u)=>{const f={},m=h=>h&&typeof h=="object"?h._isLogicValue?h.id:h.id??h.code??h.value??h:h;return Object.entries(u).forEach(([h,k])=>{if(typeof k=="string"){const C=d[h]??Nn(t,h)??t[h];C!==void 0&&(f[k]=m(C))}else if(Array.isArray(k)&&k[0]){const C=k[0],w=Object.keys(C);let p=d[h]??Nn(t,h)??t[h];if(!Array.isArray(p)||p.length===0){const A=s().find(D=>w.some(S=>D.subFields.includes(S)));if(A){const D=d[A.key]??Nn(t,A.key)??t[A.key];Array.isArray(D)&&D.length>0&&(p=D)}}Array.isArray(p)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${h}:`,Mn(p)),f[h]=p.map((A,D)=>{const S={},V=Mn(A);return Object.entries(C).forEach(([B,g])=>{const b=V[B]??V[g]??A[B]??A[g]??null;S[g]=m(b)}),S}))}}),console.log("[DynamicForm][MAPPING-RESULT]",f),f},handleResponseMapping:(d,u)=>{const f=(d==null?void 0:d.data)!==void 0?d.data:d,m=Array.isArray(f)?f[0]:f;m&&Object.entries(u).forEach(([h,k])=>{const C=m[k]??m[h];C!==void 0&&Nd(t,h,C)})},getFormArrayModels:s}}function DS({state:t,props:n,emit:o,apiUrl:r,router:a,locale:s,mapping:i,validation:l,fieldMap:c,activeSchema:d,resolvedBaseUrl:u}){const f=A=>!A.permission||(n.isEditMode?A.permission!=="CREATE":A.permission!=="UPDATE"),m=A=>{var D,S,V,B;A.requireConfirm?(t.confirmDialog.title=s.value==="id"?((D=A.propCustomMessage)==null?void 0:D.titleID)||"Konfirmasi":((S=A.propCustomMessage)==null?void 0:S.titleEN)||"Confirm",t.confirmDialog.message=s.value==="id"?((V=A.propCustomMessage)==null?void 0:V.messageID)||"Lanjutkan?":((B=A.propCustomMessage)==null?void 0:B.messageEN)||"Continue?",t.confirmDialog.action=A,t.confirmDialog.visible=!0):k(A)},h=()=>{t.confirmDialog.visible=!1,t.confirmDialog.action&&k(t.confirmDialog.action)},k=async A=>{var B,g;const D=A.propsActionGlobal||A.props||{},S=i.applyFieldMapping(i.getCleanPayload(),D.fieldMapping||A.fieldMapping||{});o("action",A,S);const V=D.endpointPropAction||A.endpointPropAction||D.endpoint||A.endpoint;if((D.type==="SUBMIT"||D.type==="ACTION")&&(V!=null&&V.apiUrl)){const b=Pe.loading(s.value==="id"?"Memproses...":"Processing..."),_=zs(V.apiUrl,u.value);try{const y=await r(_,V.apiMethod||"POST",S),x=(y==null?void 0:y.status)===!0||(y==null?void 0:y.success)===!0,E=(y==null?void 0:y.message)||(x?s.value==="id"?"Sukses":"Success":s.value==="id"?"Gagal":"Failed");Pe.update(b,{render:E,type:x?"success":"error",isLoading:!1,autoClose:x?3e3:5e3}),x?((D.fieldMapping||A.fieldMapping)&&i.handleResponseMapping(y,D.fieldMapping||A.fieldMapping),o("success",y)):o("error",y)}catch(y){const x=((g=(B=y.response)==null?void 0:B.data)==null?void 0:g.message)||y.message||(s.value==="id"?"Terjadi kesalahan":"An error occurred");Pe.update(b,{render:`Gagal: ${x}`,type:"error",isLoading:!1,autoClose:5e3}),o("error",y)}}else D.type==="SUBMIT"&&o("submit",S);D.keyRedirect&&D.route&&a&&a.push(D.route)};return{isActionVisible:f,handleGlobalButtonClick:m,confirmAction:h,performAction:k,handleSubmit:async()=>{var A,D;if(l.validateAll()){t.isSubmitting.value=!0;try{const S=i.getCleanPayload(),V=(((A=d.value)==null?void 0:A.actions)||[]).find(g=>{var b;return g.type==="SUBMIT"||g.key==="SUBMIT"||((b=g.propsActionGlobal)==null?void 0:b.type)==="SUBMIT"}),B=(V==null?void 0:V.fieldMapping)||((D=V==null?void 0:V.propsActionGlobal)==null?void 0:D.fieldMapping);o("submit",B?i.applyFieldMapping(S,B):S)}finally{t.isSubmitting.value=!1}}},handleCancel:()=>o("cancel"),handleFieldUpdate:(A,D,S)=>{var B;t.formData[A]=D;const V=(B=c.value.get(A))==null?void 0:B.field;if(V){const g=l.validateField(V,D);g?t.errors[A]=g:delete t.errors[A]}}}}function NS({formData:t,validation:n,locale:o,emit:r,mapping:a}){const s=e.ref(!1),i=e.ref(""),l=e.ref("Plus"),c=e.ref([]),d=e.reactive({}),u=e.reactive({}),f=e.ref(""),m=e.ref(null),h=e.ref(!1),k=e.ref(null),C=e.ref(!1),w=y=>{var x;return!(y!=null&&y.apiUrl)&&!((x=y==null?void 0:y.endpointTable)!=null&&x.apiUrl)},p=y=>{if(!y)return!1;const x=(y.key||"").toLowerCase(),E=(y.permission||"").toUpperCase();return x==="detail"||x.includes("view")||E==="VIEW"},A=y=>Array.isArray(t[y.modelDatatable])?t[y.modelDatatable]:[],D=y=>{var E,M;if((E=y.fields)!=null&&E.length)return y.fields;const x=(y.actionTableGlobal||[]).find(T=>T.permission==="CREATE"||(T.key||"").toLowerCase().includes("add"));return(M=x==null?void 0:x.fieldActionGlobal)!=null&&M.length?x.fieldActionGlobal:(y.headers||[]).filter(T=>T.key&&T.key!=="no").map(T=>({key:T.key,model:T.key,component:"DCodeTextField"}))},S=(y,x)=>{k.value={propsTable:y,row:x},C.value=!0},V=()=>{if(!k.value)return;const{propsTable:y,row:x}=k.value;C.value=!1;const E=t[y.modelDatatable];if(Array.isArray(E)){const M=E.indexOf(x);if(M!==-1)E.splice(M,1);else{const T=JSON.stringify(x,(v,I)=>["no","_index"].includes(v)?void 0:I),$=E.findIndex(v=>JSON.stringify(v,(I,j)=>["no","_index"].includes(I)?void 0:j)===T);$!==-1&&E.splice($,1)}r("update:model",a.getCleanPayload())}},B=(y,x)=>{d[y]=x;const E=c.value.find(M=>M.model===y);if(E){const M=n.validateField(E,x);M?u[y]=M:delete u[y]}},g=(y,x,E)=>{f.value=y.modelDatatable||"",h.value=p(x),m.value=null,i.value=o.value==="id"?x.labelID||"Tambah Data":x.labelEN||"Add Data",l.value=x.icon||"Plus";const M=D(y);c.value=M,Object.keys(d).forEach(T=>delete d[T]),Object.keys(u).forEach(T=>delete u[T]),M.forEach(T=>d[T.model]=E?E[T.model]??null:null),s.value=!0};return{tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,tableRowFormData:d,tableRowErrors:u,activeTableKey:f,editingRowIndex:m,tableDialogViewOnly:h,confirmDeletePending:k,confirmDeleteOpen:C,isTemporaryTable:w,isActionViewOnly:p,tableRows:A,resolveTableFields:D,confirmTableDelete:S,executeTableDelete:V,handleTableRowUpdate:B,openTableRowDialog:g,handleDataTableAction:(y,x)=>{const{action:E,row:M}=x;if(/delete|trash/i.test(E)){const j=t[y.modelDatatable];if(Array.isArray(j)){const U=j.indexOf(M);if(U!==-1)j.splice(U,1);else{const P=JSON.stringify(M,(G,q)=>["no","_index"].includes(G)?void 0:q),R=j.findIndex(G=>JSON.stringify(G,(q,W)=>["no","_index"].includes(q)?void 0:W)===P);R!==-1&&j.splice(R,1)}}return}if(/detail|view/i.test(E)){g(y,{key:"detail",permission:"VIEW"},M);return}const T=y.modelDatatable||"";f.value=T,h.value=!1,i.value=o.value==="id"?"Ubah Data":"Edit Data",l.value="SquarePen";const $=t[T];let v=Array.isArray($)?$.indexOf(M):-1;if(v===-1&&Array.isArray($)){const j=JSON.stringify(M,(U,P)=>["no","_index"].includes(U)?void 0:P);v=$.findIndex(U=>JSON.stringify(U,(P,R)=>["no","_index"].includes(P)?void 0:R)===j)}m.value=v!==-1?v:null;const I=D(y);c.value=I,Object.keys(d).forEach(j=>delete d[j]),I.forEach(j=>d[j.model]=M[j.model]??null),s.value=!0},saveTableRow:()=>{let y=!0;if(c.value.forEach(E=>{const M=n.validateField(E,d[E.model]);M&&(u[E.model]=M,y=!1)}),!y)return;const x=f.value;x&&(t[x]=t[x]||[],m.value!==null?t[x].splice(m.value,1,{...d}):t[x].push({...d}),s.value=!1,r("update:model",a.getCleanPayload()))}}}function MS(t){const{state:n,props:o,emit:r,logic:a,mapping:s,activeSchema:i,fieldMap:l,prefetchFieldItems:c}=t;let d="";const u=new Map,f=new Map,m=(h,k)=>{var V;const C=(V=i.value)==null?void 0:V.sections;if(!C)return;a.applyCalculations();const w=a.getNormalizedData(h),p=(B,g,b,_)=>{const y=B.model,x=a.isFieldVisible(B,b)&&g,E=u.get(y),M=n.formData[y];return u.set(y,x),_&&E===!0&&x===!1&&M!=null&&(console.log(`[DynamicForm][DEBUG][RESET-VISIBLE] ${y} became hidden. Clearing value:`,M),n.formData[y]=Array.isArray(M)?[]:null),x},A=(B,g,b,_)=>{var I,j,U,P,R,G;const y=B.model,x=B.logic,E=Array.isArray((j=(I=B.props)==null?void 0:I.endpoint)==null?void 0:j.keyParam)||Array.isArray((P=(U=B.props)==null?void 0:U.endpointReference)==null?void 0:P.keyParam);if(!x&&!E)return;const M={};let T=!1;["lengthRule","optionsFilterRule","visibleRule","disabledRule"].forEach(q=>{const W=x==null?void 0:x[q];if(!W)return;const Z=a.resolveActiveRule(W,b,`${q}-${y}`),ne=JSON.stringify(Z);M[q]=ne;const ue=f.get(y);(ue==null?void 0:ue[q])!==void 0&&ue[q]!==ne&&(T=!0,console.log(`[DynamicForm][DEBUG][CONTEXT-CHANGE] ${y} rule ${q} changed while tracking.`))});const v=((R=B.props)==null?void 0:R.endpoint)||((G=B.props)==null?void 0:G.endpointReference);Array.isArray(v==null?void 0:v.keyParam)&&v.keyParam.forEach(q=>{const W=b[q],Z=JSON.stringify(W);M[`kp-${q}`]=Z;const ne=f.get(y);(ne==null?void 0:ne[`kp-${q}`])!==void 0&&ne[`kp-${q}`]!==Z&&(T=!0,console.log(`[DynamicForm][DEBUG][CASCADE] ${y} dependency ${q} changed while tracking.`),_&&g&&c(B,!0))}),_&&T&&n.formData[y]!=null&&(console.log(`[DynamicForm][DEBUG][RESET-LOGIC] Context changed for ${y}. Clearing value.`),n.formData[y]=Array.isArray(n.formData[y])?[]:null),f.set(y,M)},D=(B,g,b)=>{var y;if(B.type!=="WIZARD")return;(((y=B.propsWizard)==null?void 0:y.propsSteps)||[]).forEach(x=>{const M=a.isSectionVisible(x,b)&&g;Array.isArray(x.sectionsWizard)?S(x.sectionsWizard,M):x.sectionsWizard&&S([x.sectionsWizard],M)})},S=(B,g=!0)=>{var b;for(const _ of B){const x=a.isSectionVisible(_,h)&&g,E=((b=_.propsForm)==null?void 0:b.fields)||_.fields||[];for(const M of E){if(!M.model)continue;const T=p(M,x,h,k);A(M,T,w,k)}D(_,x,h)}};S(C,!0)};return e.watch(()=>i.value,h=>{var C,w,p,A,D;if(!(h!=null&&h.sections))return;const k=S=>{if(!S)return;const V=["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"];for(const B of V){const g=S[B];if(Array.isArray(g))for(const b of g)b.condition&&Wr(b.condition);else g&&Wr(g)}};for(const S of h.sections){if(k(S.logic||((C=S.propsForm)==null?void 0:C.logic)),S.type==="WIZARD")for(const B of((w=S.propsWizard)==null?void 0:w.propsSteps)||[])k(B.logic);const V=((p=S.propsForm)==null?void 0:p.fields)||S.fields||[];for(const B of V)k(B.logic),(A=B.logic)!=null&&A.optionsFilterRule&&c(B);if(S.type==="TABLE"&&((D=S.propsTable)!=null&&D.modelDatatable)&&(n.formData[S.propsTable.modelDatatable]=n.formData[S.propsTable.modelDatatable]||[]),S.type==="WIZARD"){const B=Ur(S);n.wizardState[B]===void 0&&(n.wizardState[B]=0)}}m(n.formData,!1)},{immediate:!0}),e.watch(n.formData,h=>{m(h,!0);const k=s.getCleanPayload()||{},C=JSON.stringify(k);C!==d&&(console.log("[DynamicForm][DEBUG][EMIT] Sending updated model to parent:",k),d=C,r("update:model",k))},{deep:!0}),e.watch(()=>o.model,h=>{h&&Object.keys(h).length>0&&JSON.stringify(h)!==d&&Object.entries(h).forEach(([C,w])=>{if(u.get(C)===!1)return;const p=l.value.get(C),A=(p==null?void 0:p.path)||C;Nd(n.formData,A,w)})},{immediate:!0,deep:!0}),{lastEmittedPayload:()=>d}}Ft.add_operation("length",t=>t==null?0:typeof t=="string"||Array.isArray(t)?t.length:typeof t=="number"?String(t).length:typeof t=="object"?Object.keys(t).length:0),Ft.add_operation("==",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null?n==null:n==null?t==null:o(t)&&o(n)?String(t.id)===String(n.id)||String(t.code)===String(n.code):o(t)?String(t.code)===String(n)||String(t.id)===String(n):o(n)?String(n.code)===String(t)||String(n.id)===String(t):typeof t=="boolean"&&typeof n=="string"?String(t)===n:typeof n=="boolean"&&typeof t=="string"?String(n)===t:String(t)===String(n)}),Ft.add_operation("!=",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null&&n==null?!1:t==null||n===null||n===void 0?!0:o(t)&&o(n)?!(String(t.id)===String(n.id)||String(t.code)===String(n.code)):o(t)?!(String(t.code)===String(n)||String(t.id)===String(n)):o(n)?!(String(n.code)===String(t)||String(n.id)===String(t)):String(t)!==String(n)});function PS(t,n){const{t:o,locale:r}=gt.useI18n(),a=e.computed(()=>r.value),{apiUrl:s}=Ke(),i=un.useRouter(),l=ES(),c=e.computed(()=>t.schema||l.internalSchema.value),d=e.computed(()=>{var S;if((S=t.selectedTokenCore)!=null&&S.address)return t.selectedTokenCore.address;if(t.baseUrl)return t.baseUrl}),u=(S,V,B)=>{V.model&&S.set(V.model,{field:V,path:V.model})},f=(S,V)=>{V.key||V.id;const B=Array.isArray(V.sectionsWizard)?V.sectionsWizard:[V.sectionsWizard].filter(Boolean);for(const g of B)if(g.fields)for(const b of g.fields)u(S,b)},m=e.computed(()=>{var B,g,b;const S=new Map,V=(B=c.value)==null?void 0:B.sections;if(!V)return S;for(const _ of V){const y=_.propsForm||_.propsTable||_.props||{};Ur(_);const x=y.fields||_.fields||[];for(const E of x)u(S,E);if(((g=_.type)==null?void 0:g.toUpperCase())==="WIZARD"&&((b=_.propsWizard)!=null&&b.propsSteps))for(const E of _.propsWizard.propsSteps)f(S,E)}return S}),h=SS({formData:l.formData,errors:l.errors,fieldMap:m,rawItemsCache:l.rawItemsCache,activeSchema:c,locale:a}),k=AS({formData:l.formData,locale:a,errors:l.errors,fieldMap:m,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,isFieldRequired:h.isFieldRequired,resolveFieldLength:h.resolveFieldLength}),C=VS({formData:l.formData,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,getWizardTabs:h.getWizardTabs}),w=DS({state:l,props:t,emit:n,apiUrl:s,router:i,locale:a,mapping:C,validation:k,fieldMap:m,activeSchema:c,resolvedBaseUrl:d}),p=NS({formData:l.formData,validation:k,locale:a,emit:n,mapping:C}),A=async(S,V=!1)=>{const B=S.props||{},g=B.endpointReference||B.endpoint;if(g!=null&&g.apiUrl&&!(!V&&l.rawItemsCache[S.key]))try{const b=zs(g.apiUrl,d.value),_={page:1,perPage:100};if(Array.isArray(g.keyParam)){let M=!1;if(g.keyParam.forEach(T=>{const $=h.getNormalizedData(l.formData)[T];$==null||$===""?M=!0:_[T]=$&&typeof $=="object"&&$._isLogicValue?$.id:$}),M){l.rawItemsCache[S.key]=[];return}}const y=await s(b,g.apiMethod||"GET",_),x=(y==null?void 0:y.data)||y;let E=[];Array.isArray(x)?E=x:x&&(E=[x]),l.rawItemsCache[S.key]=E}catch(b){console.error(`[prefetchFieldItems] Error fetching items for ${S.key}:`,b),l.rawItemsCache[S.key]=[]}};MS({state:l,props:t,emit:n,logic:h,mapping:C,fieldMap:m,activeSchema:c,prefetchFieldItems:A});const D=e.computed(()=>{const S={},V=c.value;return V!=null&&V.sections&&V.sections.forEach(B=>{var b,_,y;(((b=B.propsForm)==null?void 0:b.fields)||((_=B.propsTable)==null?void 0:_.fields)||((y=B.props)==null?void 0:y.fields)||[]).forEach(x=>{var E,M,T,$,v,I,j,U,P,R,G;if(x.component==="DCodeRadioCustom"){const q=((E=x.props)==null?void 0:E.name)||"default-group";S[q]||(S[q]=[]);let W=((T=(M=x.props)==null?void 0:M.endpoint)==null?void 0:T.apiUrl)||(($=x.props)==null?void 0:$.apiUrl);W=zs(W,d.value),S[q].push({key:x.key,value:(v=x.props)==null?void 0:v.value,label:((I=x.props)==null?void 0:I.labelID)||((j=x.props)==null?void 0:j.labelEN)||x.key,model:x.model||x.key,apiUrl:W,apiMethod:((P=(U=x.props)==null?void 0:U.endpoint)==null?void 0:P.apiMethod)||((R=x.props)==null?void 0:R.apiMethod),icon:(G=x.props)==null?void 0:G.icon,name:q})}})}),S});return{t:o,locale:a,i18nLocale:r,apiUrl:s,router:i,isSubmitting:l.isSubmitting,internalSchema:l.internalSchema,activeSchema:c,resolvedBaseUrl:d,radioGroups:D,confirmDialog:l.confirmDialog,fieldMap:m,rawItemsCache:l.rawItemsCache,formData:l.formData,errors:l.errors,fieldErrors:l.fieldErrors,inlineState:l.inlineState,wizardState:l.wizardState,getSectionKey:Ur,sortedFields:_S,prefetchFieldItems:A,...h,...C,...w,...p}}const TS={key:0},vS=["value","name"],OS={key:1,class:"flex flex-col gap-1"},FS={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},zS=["src"],RS={key:1,class:"text-sm text-neutral-400 italic"},IS={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},LS={key:3,class:"text-xs text-neutral-400 italic"},Mo=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},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=gt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,w=>{s.value=w});const i={DCodeTextField:Fn,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr,DCodeRadio:Es,DCodeRadioCustom:_s,DCodeDynamicUploadList:ms,DCodeMultiSelect:Bs,DCodeCurrencyField:fs,DCodePermissionMenu:As,DCodeTreePermissions:Vs,DCodeCardCheckboxList:us,DCodeBeforeAfter:Ca,DCodeListLabels:Ba},l=e.computed(()=>{const w=r.field.component;return i[w]||null}),c=e.computed(()=>{var p;const w=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return w.includes("image")||w.includes("upload")}),d=e.computed(()=>{var p;const w=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return w.includes("switch")||w.includes("checkbox")}),u=e.computed(()=>{var D,S;const w=r.field.props||r.field.propsFieldGlobal||{},p=((D=r.dynamicLabels)==null?void 0:D.labelID)||w.labelID,A=((S=r.dynamicLabels)==null?void 0:S.labelEN)||w.labelEN;return o.value==="id"?p||A||r.field.model:A||p||r.field.model}),f=e.computed(()=>{const w=r.modelValue;return w==null||w===""?null:Array.isArray(w)?w.map(p=>typeof p=="object"&&p!==null?p.label||p.name||p.code||p.value||JSON.stringify(p):String(p)).join(", "):typeof w=="object"?w.label||w.name||w.code||w.value||w.id||JSON.stringify(w):String(w)}),m=(w,p)=>{const A={label:"",placeholder:""},D=(p==null?void 0:p.labelID)||w.labelID,S=(p==null?void 0:p.labelEN)||w.labelEN;(D||S)&&(A.label=o.value==="id"?D:S);const V=(p==null?void 0:p.placeholderID)||w.placeholderID,B=(p==null?void 0:p.placeholderEN)||w.placeholderEN;return(V||B)&&(A.placeholder=o.value==="id"?V:B),A},h=(w,p)=>{const A=w.endpoint||{};if(!A.apiUrl)return{};const D={};let S=!0;if(Array.isArray(A.keyParam)&&A.keyParam.length>0&&A.keyParam.forEach(B=>{const g=p?p[B]:null;g!=null&&g!==""?D[B]=g:S=!1}),!S)return{};let V=A.apiUrl;if(r.baseUrl&&typeof V=="string"&&!V.startsWith("http")){const B=r.baseUrl.replace(/\/$/,""),g=V.startsWith("/")?V:`/${V}`;V=`${B}${g}`}return{endpoint:{apiUrl:V,apiMethod:A.apiMethod||"GET"},...Object.keys(D).length?{apiParams:D}:{}}},k=e.computed(()=>{var S,V,B;const w=r.field.props||r.field.propsFieldGlobal||{},p={},A=m(w,r.dynamicLabels);if(A.label&&(p.label=A.label),A.placeholder&&(p.placeholder=A.placeholder),p.required=r.required!==void 0?r.required:w.required??!1,["disabled","readonly","clearable","icon","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(g=>{w[g]!==void 0&&w[g]!==null&&(p[g]=w[g])}),p.minLength=((S=r.dynamicLength)==null?void 0:S.minLength)??w.minLength,p.maxLength=((V=r.dynamicLength)==null?void 0:V.maxLength)??w.maxLength,w.valueType&&(p.type=w.valueType),r.error&&(p.error=r.error),Object.assign(p,h(w,r.formData)),(B=w.endpointReference)!=null&&B.apiUrl){let g=w.endpointReference.apiUrl;if(r.baseUrl&&typeof g=="string"&&!g.startsWith("http")){const b=r.baseUrl.replace(/\/$/,""),_=g.startsWith("/")?g:`/${g}`;g=`${b}${_}`}p.endpointReference={...w.endpointReference,apiUrl:g}}return r.options&&r.options.length>0&&(p.items=r.options,p.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete p.endpoint,delete p.apiParams,delete p.apiUrl)),r.baseUrl&&(p.baseUrl=r.baseUrl),p}),C=w=>{s.value=w,a("update:modelValue",w)};return(w,p)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",TS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,vS)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",OS,[e.createElementVNode("span",FS,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,zS)):(e.openBlock(),e.createElementBlock("span",RS,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",IS,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},k.value,{modelValue:s.value,"onUpdate:modelValue":[p[0]||(p[0]=A=>s.value=A),C]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",LS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),$S={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},jS={key:0,class:"px-4 py-3"},US={class:"text-sm font-semibold text-white"},WS={class:"px-4 py-3 flex items-center gap-2"},HS=e.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{}},setup(t){const n=e.computed(()=>{var b,_;switch((_=(b=t.section)==null?void 0:b.propsForm)==null?void 0:_.layoutColumns){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}}),o=e.inject("dynamicFormContext",{}),{resolveSectionLabels:r,isActionVisible:a,handleGlobalButtonClick:s,locale:i,t:l,handleCancel:c,sortedFields:d,isFieldVisible:u,getDeepValue:f,formData:m,getSectionKey:h,isFieldRequired:k,isFieldDisabled:C,getFilteredItems:w,errors:p,resolveFieldLabels:A,resolveFieldLength:D,resolvedBaseUrl:S,handleFieldUpdate:V}=o,B=g=>typeof d!="function"?[]:d(g||[]);return(g,b)=>{var _,y,x,E,M,T,$,v,I,j;return e.openBlock(),e.createElementBlock("div",$S,[((y=(_=t.section)==null?void 0:_.type)==null?void 0:y.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between mb-2",(x=e.unref(r)(t.section))!=null&&x.title?"bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30":""])},[(E=e.unref(r)(t.section))!=null&&E.title?(e.openBlock(),e.createElementBlock("div",jS,[e.createElementVNode("h3",US,e.toDisplayString(e.unref(r)(t.section).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",WS,[($=(T=(M=t.section)==null?void 0:M.propsForm)==null?void 0:T.actionSection)!=null&&$.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsForm.actionSection,(U,P)=>{var R,G,q,W,Z,ne,ue,ke;return e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[(R=e.unref(a))!=null&&R(U)?(e.openBlock(),e.createBlock(Le,{key:0,icon:U.icon||((G=U.propsActionGlobal)==null?void 0:G.icon),text:e.unref(i)==="id"?U.labelID||((q=U.propsActionGlobal)==null?void 0:q.labelID):U.labelEN||((W=U.propsActionGlobal)==null?void 0:W.labelEN),"bg-color":((ne=U.bgColor||((Z=U.propsActionGlobal)==null?void 0:Z.bgColor))==null?void 0:ne.toLowerCase())||"primary",variant:((ke=U.variant||((ue=U.propsActionGlobal)==null?void 0:ue.variant))==null?void 0:ke.toLowerCase())||"outline",size:"sm",onClick:me=>{var X;return(X=e.unref(s))==null?void 0:X(U)}},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),t.sIdx===0?(e.openBlock(),e.createBlock(Le,{key:1,size:"sm",icon:"List",text:(v=e.unref(l))==null?void 0:v("common.back"),variant:"outline",onClick:b[0]||(b[0]=U=>{var P;return(P=e.unref(c))==null?void 0:P()})},null,8,["text"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",n.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B((j=(I=t.section)==null?void 0:I.propsForm)==null?void 0:j.fields),U=>{var P,R,G,q,W,Z,ne,ue;return e.openBlock(),e.createElementBlock(e.Fragment,{key:U==null?void 0:U.key},[(P=e.unref(u))!=null&&P(U)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.value)},[e.createVNode(Mo,{field:U,"model-value":(R=e.unref(m))==null?void 0:R[U.model],"form-data":e.unref(m),required:(G=e.unref(k))==null?void 0:G(U),disabled:(q=e.unref(C))==null?void 0:q(U),options:(W=e.unref(w))==null?void 0:W(U),error:(Z=e.unref(p))==null?void 0:Z[U.model],"dynamic-labels":(ne=e.unref(A))==null?void 0:ne(U),"dynamic-length":(ue=e.unref(D))==null?void 0:ue(U),"base-url":e.unref(S),"onUpdate:modelValue":ke=>e.unref(V)(U.model,ke)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64)}),128))],2)])}}}),qS={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},GS=e.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{tableRows:o,isTemporaryTable:r,handleDataTableAction:a,locale:s,openTableRowDialog:i,resolveTableFields:l,confirmTableDelete:c,resolvedBaseUrl:d}=n;return(u,f)=>(e.openBlock(),e.createElementBlock("div",qS,[e.createVNode(Yn,{"table-config":t.section.propsTable,data:e.unref(o)(t.section.propsTable),nested:!0,"show-pagination":t.section.propsTable.pagination??!0,"has-actions":e.unref(r)(t.section.propsTable),"base-url":e.unref(d),"dummy-mode":t.dummyMode,onAction:f[0]||(f[0]=m=>e.unref(a)(t.section.propsTable,m))},null,8,["table-config","data","show-pagination","has-actions","base-url","dummy-mode"])]))}}),KS={class:"w-full"},XS={class:"space-y-6 mt-4"},YS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},JS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},QS=e.defineComponent({__name:"DynamicWizardSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{getWizardTabs:o,wizardState:r,getSectionKey:a,isSubmitting:s,isActionVisible:i,locale:l,handleGlobalButtonClick:c,isSectionVisible:d,sortedFields:u,isFieldVisible:f,getDeepValue:m,formData:h,isFieldRequired:k,isFieldDisabled:C,getFilteredItems:w,errors:p,resolveFieldLabels:A,resolveFieldLength:D,resolvedBaseUrl:S,handleFieldUpdate:V,tableRows:B,handleDataTableAction:g,resolveSectionGridClass:b,resolveFieldColumnClass:_}=n;return(y,x)=>{var E;return e.openBlock(),e.createElementBlock("div",KS,[e.createVNode(Ss,{tabs:e.unref(o)(t.section),modelValue:e.unref(r)[e.unref(a)(t.section)],"onUpdate:modelValue":x[0]||(x[0]=M=>e.unref(r)[e.unref(a)(t.section)]=M),"is-vertical":t.section.propsWizard.isVertical,"is-wizard":t.section.propsWizard.isWizard,"type-wizard":((E=t.section.propsWizard.typeWizard)==null?void 0:E.toLowerCase())||"icon",loading:e.unref(s)},e.createSlots({_:2},[e.renderList(e.unref(o)(t.section),M=>({name:`tab-${M.key}`,fn:e.withCtx(()=>[e.createElementVNode("div",XS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.sections,(T,$)=>{var v,I,j;return e.openBlock(),e.createElementBlock(e.Fragment,{key:$},[e.unref(d)(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((v=T.type)==null?void 0:v.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",e.unref(b)(T.layoutColumns)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u)(T.fields),U=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U.key},[e.unref(f)(U)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(_)(U,T.layoutColumns))},[e.createVNode(Mo,{field:U,"model-value":e.unref(h)[U.model],"form-data":e.unref(h),required:e.unref(k)(U),disabled:e.unref(C)(U),options:e.unref(w)(U),error:e.unref(p)[U.model],"dynamic-labels":e.unref(A)(U),"dynamic-length":e.unref(D)(U),"base-url":e.unref(S),"onUpdate:modelValue":P=>e.unref(V)(U.model,P)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((I=T.type)==null?void 0:I.toUpperCase())==="TABLE"||T.isDataTable?(e.openBlock(),e.createElementBlock("div",YS,[e.createVNode(Yn,{"dummy-mode":t.dummyMode,"table-config":T.propsDataTableWizard||T.propsTable,data:e.unref(B)(T.propsDataTableWizard||T.propsTable),nested:!0,"show-pagination":((j=T.propsDataTableWizard||T.propsTable)==null?void 0:j.pagination)??!0,onAction:U=>e.unref(g)(T.propsDataTableWizard||T.propsTable,U)},null,8,["dummy-mode","table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",JS," Unknown section type: "+e.toDisplayString(T.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])])}))]),1032,["tabs","modelValue","is-vertical","is-wizard","type-wizard","loading"])])}}}),ZS={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},eA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},tA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},nA=e.defineComponent({__name:"DynamicFormDialogs",setup(t){const n=e.inject("dynamicFormContext"),{confirmDialog:o,t:r,confirmAction:a,tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,tableRowFormData:u,tableDialogViewOnly:f,isFieldRequired:m,isFieldDisabled:h,getFilteredItems:k,tableRowErrors:C,resolveFieldLabels:w,resolveFieldLength:p,resolvedBaseUrl:A,handleTableRowUpdate:D,locale:S,saveTableRow:V,confirmDeleteOpen:B,executeTableDelete:g}=n;return(b,_)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(Jt,{modelValue:e.unref(o).visible,"onUpdate:modelValue":_[1]||(_[1]=y=>e.unref(o).visible=y),title:e.unref(o).title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(r)("common.cancel"),onClick:_[0]||(_[0]=y=>e.unref(o).visible=!1)},null,8,["text"]),e.createVNode(Le,{text:e.unref(r)("common.confirm"),onClick:e.unref(a)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",ZS,e.toDisplayString(e.unref(o).message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:e.unref(s),"onUpdate:modelValue":_[3]||(_[3]=y=>e.isRef(s)?s.value=y:null),title:e.unref(i),icon:e.unref(l),"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(f)?e.unref(S)==="id"?"Tutup":"Close":e.unref(S)==="id"?"Batal":"Cancel",onClick:_[2]||(_[2]=y=>s.value=!1)},null,8,["text"]),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{key:0,text:"Save",onClick:e.unref(V)},null,8,["onClick"]))]),default:e.withCtx(()=>[e.unref(c).length?(e.openBlock(),e.createElementBlock("div",eA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),y=>(e.openBlock(),e.createElementBlock("div",{key:y.key,class:e.normalizeClass(y.column==="FULL"?"md:col-span-2":"col-span-1")},[e.unref(d)(y,e.unref(u))?(e.openBlock(),e.createBlock(Mo,{key:0,field:y,"model-value":e.unref(u)[y.model],"form-data":e.unref(u),required:e.unref(f)?!1:e.unref(m)(y,e.unref(u)),disabled:e.unref(f)||e.unref(h)(y,e.unref(u)),"view-only":e.unref(f),options:e.unref(k)(y,e.unref(u)),error:e.unref(f)?void 0:e.unref(C)[y.model],"dynamic-labels":e.unref(w)(y,e.unref(u)),"dynamic-length":e.unref(p)(y,e.unref(u)),"base-url":e.unref(A),"onUpdate:modelValue":x=>e.unref(D)(y.model,x)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Jt,{modelValue:e.unref(B),"onUpdate:modelValue":_[5]||(_[5]=y=>e.isRef(B)?B.value=y:null),title:e.unref(S)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(S)==="id"?"Batal":"Cancel",onClick:_[4]||(_[4]=y=>B.value=!1)},null,8,["text"]),e.createVNode(Le,{variant:"default","bg-color":"danger",icon:"Trash2",text:e.unref(S)==="id"?"Hapus":"Delete",onClick:e.unref(g)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",tA,e.toDisplayString(e.unref(S)==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])]))}}),oA={class:"w-full space-y-6"},Rs=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},dummyMode:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){const o=t,a=PS(o,n);e.provide("dynamicFormContext",a);const{activeSchema:s,isSectionVisible:i,inlineState:l,isActionVisible:c,locale:d,isSubmitting:u,isSubmitDisabled:f,handleGlobalButtonClick:m,handleSubmit:h}=a;return(k,C)=>{var w,p,A,D,S,V;return e.openBlock(),e.createElementBlock("div",oA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((w=e.unref(s))==null?void 0:w.sections,(B,g)=>{var b,_,y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[((b=B.type)==null?void 0:b.toUpperCase())==="FORM"&&B.propsForm&&e.unref(i)(B)?(e.openBlock(),e.createBlock(HS,{key:0,"dummy-mode":o.dummyMode,section:B,sIdx:Number(g)},null,8,["dummy-mode","section","sIdx"])):((_=B.type)==null?void 0:_.toUpperCase())==="TABLE"&&B.propsTable&&e.unref(i)(B)?(e.openBlock(),e.createBlock(GS,{key:1,"dummy-mode":o.dummyMode,section:B},null,8,["dummy-mode","section"])):((y=B.type)==null?void 0:y.toUpperCase())==="WIZARD"&&B.propsWizard&&e.unref(i)(B)?(e.openBlock(),e.createBlock(QS,{key:2,"dummy-mode":o.dummyMode,section:B},null,8,["dummy-mode","section"])):e.createCommentVNode("",!0)],64)}),128)),(p=e.unref(l))!=null&&p.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((D=(A=e.unref(s))==null?void 0:A.ui)==null?void 0:D.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(V=(S=e.unref(s))==null?void 0:S.actionGlobal)!=null&&V.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).actionGlobal,(B,g)=>{var b,_,y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[B.propsActionGlobal&&e.unref(c)(B)?(e.openBlock(),e.createBlock(Le,{key:0,icon:B.propsActionGlobal.icon,text:e.unref(d)==="id"?B.propsActionGlobal.labelID:B.propsActionGlobal.labelEN,"bg-color":((b=B.propsActionGlobal.bgColor)==null?void 0:b.toLowerCase())||"primary",variant:((_=B.propsActionGlobal.variant)==null?void 0:_.toLowerCase())||"default",loading:e.unref(u),disabled:e.unref(f)&&(B.permission==="CREATE"||B.permission==="UPDATE"||((y=B.propsActionGlobal)==null?void 0:y.key)==="submit"),onClick:x=>e.unref(m)(B)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0)],2)),e.createVNode(nA)])}}}),rA={"aria-label":"Breadcrumb"},aA={class:"flex flex-wrap items-center text-sm md:text-base"},sA={class:"truncate max-w-[100px] sm:max-w-[150px] md:max-w-none"},Md=e.defineComponent({__name:"Breadcrumb",props:{items:{},showHomeIcon:{type:Boolean,default:!0},iconSize:{default:18},separatorSize:{default:16},separatorType:{default:"chevron"},strokeWidth:{default:2}},setup(t){const n=t,o=te.Home,r=n.separatorType==="slash"?te.Slash:te.ChevronRight;return(a,s)=>(e.openBlock(),e.createElementBlock("nav",rA,[e.createElementVNode("ol",aA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.to?"router-link":"span"),{to:i.to,class:e.normalizeClass(["inline-flex items-center gap-1.5 transition-all duration-200 rounded-lg font-medium",i.to?"text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 cursor-pointer":"dark:text-gray-100 bg-primary-50 dark:bg-primary-900/30 text-primary-700"])},{default:e.withCtx(()=>[i.icon||l===0&&t.showHomeIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon||e.unref(o)),{key:0,size:t.iconSize,class:e.normalizeClass(["flex-shrink-0",i.to?"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-400":"text-primary-600 dark:text-primary-400",i.iconClass||""]),"stroke-width":t.strokeWidth},null,8,["size","class","stroke-width"])):e.createCommentVNode("",!0),e.createElementVNode("span",sA,e.toDisplayString(i.label),1)]),_:2},1032,["to","class"])),l<t.items.length-1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{key:0,size:t.separatorSize,class:"mx-1.5 text-gray-300 dark:text-gray-700 flex-shrink-0"},null,8,["size"])):e.createCommentVNode("",!0)]))),128))])]))}});function Pd(){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 iA={class:"w-full space-y-6 animate-pulse"},lA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},cA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",iA,[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",lA,[(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))]))}}),dA={class:"w-full"},uA={class:"relative mx-auto min-h-[37.5rem]"},fA={key:"content",class:"w-full"},mA={class:"mb-6"},hA={class:"text-neutral-500 dark:text-neutral-400"},pA={key:"skeleton",class:"w-full"},gA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Is=at(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var E,M,T,$,v,I,j,U;const o=t,r=n,a=(M=(E=e.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:M.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 P=un.useRoute();if(P&&Object.keys(P).length>0)s=P;else{const R=e.getCurrentInstance();(v=($=(T=R==null?void 0:R.appContext)==null?void 0:T.config)==null?void 0:$.globalProperties)!=null&&v.$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:P=>{typeof window<"u"&&(typeof P=="string"?window.location.href=P:P&&P.path&&(window.location.href=P.path))},__isFallback:!0};try{const P=un.useRouter();if(P)i=P;else{const R=e.getCurrentInstance();(U=(j=(I=R==null?void 0:R.appContext)==null?void 0:I.config)==null?void 0:j.globalProperties)!=null&&U.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Ke();let d;try{d=gt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=Pd(),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 m=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const P=s.path.match(/\/edit\/([^\/]+)$/);return P?P[1]:null}),h=e.ref({}),k=e.ref(null),C=e.ref(!0),w=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",A="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",D=e.ref(o.layoutCode),S=e.computed(()=>{var G;if(!k.value)return"";const P=((G=d==null?void 0:d.value)==null?void 0:G.toLowerCase())||"en";return(P==="en"||P.startsWith("en-")?k.value.titleEN:k.value.titleID)||k.value.title||o.layoutCode});e.watch(S,P=>{P&&u(P)},{immediate:!0});const V=(P,R="")=>{const G={};return!P||typeof P!="object"||Object.keys(P).forEach(q=>{const W=P[q],Z=R?`${R}.${q}`:q;W&&typeof W=="object"&&!Array.isArray(W)&&!(W instanceof Date)&&Object.assign(G,V(W,Z)),G[Z]=W}),G},B=P=>{var W;if(!P||typeof P!="string"||P.startsWith("http"))return P;const R=(W=o.selectedTokenCore)==null?void 0:W.address;if(!R)return P;const G=R.replace(/\/$/,""),q=P.startsWith("/")?P:`/${P}`;return`${G}${q}`},g=async()=>{var P,R,G,q,W,Z;C.value=!0;try{let ne=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ne=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",ke=ue?{Authorization:`Bearer ${ue}`}:{},me=B(`${p}${ne}`);let X=await l(me,"GET",null,ke);if(!X.status||!X.data||Array.isArray(X.data)&&X.data.length===0)try{const O=B(`${A}${ne}`),K=await l(O,"GET",null,ke);if(K.status){const ee=Array.isArray(K.data)?K.data[0]:K.data;ee&&ee.code&&(ne=ee.code,D.value=ne,X=await l(B(`${p}${ne}`),"GET",null,ke))}}catch(O){console.warn("Failed to resolve layout code via datatable",O)}if(X.status){k.value=Array.isArray(X.data)?X.data[0]:X.data;const O={};if((P=k.value)!=null&&P.sections&&k.value.sections.forEach(K=>{((K.propsForm||K.props||{}).fields||K.fields||[]).forEach(Ve=>{var ze;const Ne=Ve.model||((ze=Ve.props)==null?void 0:ze.model)||Ve.key;Ne&&(O[Ne]=null)})}),h.value=O,C.value=!1,f.value&&m.value){w.value=!0;try{const K=(q=(G=(R=k.value.sections)==null?void 0:R[0])==null?void 0:G.propsForm)==null?void 0:q.endpointForm,ee=k.value.endpointForm,he=K||ee;if(he!=null&&he.apiUrl){const Ve=he.apiUrl,Ne=he.apiMethod||"GET",ze=he.keyParam||[],Re={};ze.length>0?ze.forEach(Me=>{Re[Me]=m.value}):Re.id=m.value;const Ue=await c(B(Ve),Ne,Re);if(console.log(`[AutoLayoutForm] API Result for ${Ve}:`,Ue),Ue.status){let Me=Array.isArray(Ue.data)?Ue.data[0]:Ue.data;Ue.payload&&(Me={...Me,...Ue.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Me);const Ze=V(Me);h.value={...h.value,...Me,...Ze},console.log("[AutoLayoutForm] Updated initialData:",h.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",Ue)}else if((W=k.value.endpointGlobal)!=null&&W.apiUrl){const Ve=k.value.endpointGlobal.apiUrl,Ne=k.value.endpointGlobal.apiMethod||"GET",ze={id:m.value},Re=await c(B(Ve),Ne,ze);if(Re.status){const Ue=Array.isArray(Re.data)?Re.data[0]:Re.data,Me=V(Ue);h.value={...h.value,...Ue,...Me}}}else{const Ve=((Z=k.value.endpoint)==null?void 0:Z.detailUrl)||`/api/${D.value}/detail/${m.value}`,Ne=await l(B(Ve),"GET");if(Ne.status){let ze=Array.isArray(Ne.data)?Ne.data[0]:Ne.data;if(Ne.payload){const Me={...Ne.payload};if(Object.keys(Me).forEach(Ze=>{ze[Ze]!==void 0&&ze[Ze]!==null&&(Me[Ze]=ze[Ze])}),!("id"in Me)&&ze.id){const Ze=Object.keys(Me).find(ct=>ct.startsWith("id")&&ct.length>2&&!Me[ct]);Ze&&(Me[Ze]=ze.id)}ze=Me}const Re={...ze};Object.keys(h.value).forEach(Me=>{if(Re[Me]===void 0||Re[Me]===null){if(Me.toLowerCase().startsWith("id")&&Me.length>2){const ct=Me.substring(2).toLowerCase(),St=Array.isArray(Ne.data)?Ne.data[0]:Ne.data,H=Object.keys(St).find(re=>re.toLowerCase()===ct);H&&St[H]&&typeof St[H]=="object"&&"id"in St[H]&&(Re[Me]=St[H].id)}if(Me==="idSupervisor"){const ct=Array.isArray(Ne.data)?Ne.data[0]:Ne.data;ct.supervisorId&&(Re[Me]=ct.supervisorId)}}});const Ue=V(Re);h.value={...h.value,...Re,...Ue}}}}catch(K){console.error("Failed to fetch record data:",K)}finally{w.value=!1}}}}catch(ne){console.error("Failed to load form layout:",ne),C.value=!1}},b=P=>{const R=Object.keys(h.value||{}).filter(q=>h.value[q]!==null&&h.value[q]!==void 0),G=Object.keys(P||{}).filter(q=>P[q]!==null&&P[q]!==void 0);if(R.length>3&&G.length<R.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:R.length,incomingCount:G.length,data:P});return}console.log("[AutoLayoutForm] Allowing model update:",P),h.value=P,r("update:model",P)},_=async P=>{var R,G,q;try{const W=(q=(G=(R=k.value.sections)==null?void 0:R[0])==null?void 0:G.propsForm)==null?void 0:q.endpointForm,Z=k.value.endpointGlobal||k.value.endpoint,ne=(W==null?void 0:W.submitUrl)||(Z==null?void 0:Z.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(W==null?void 0:W.submitMethod)||(Z==null?void 0:Z.submitMethod)||(f.value?"PUT":"POST"),ke=Object.values(P).some(X=>X instanceof File||X instanceof Blob);let me;ke?(me=new FormData,Object.keys(P).forEach(X=>{const O=P[X];O!=null&&(Array.isArray(O)?O.forEach(K=>me.append(`${X}[]`,K)):me.append(X,O))})):(me={...P},f.value&&m.value&&!me.id&&(me.id=m.value)),await l(B(ne),ue,me),r("submit-success",me),i.back()}catch(W){console.error("Submit failed:",W)}},y=async(P,R,G)=>{if(P==="cancel"){x();return}const q=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(q)try{C.value=!0;const W=G?{...G}:{...h.value};f.value&&R.model&&m.value&&(W[R.model]=m.value);const Z=q.apiUrl,ne=q.apiMethod||"POST";(await c(B(Z),ne,W)).status&&(r("action-success",P,R,W),i.back())}catch(W){console.error("Action failed:",W)}finally{C.value=!1}},x=()=>{r("cancel"),i.back()};return e.onMounted(()=>{g()}),e.watch(()=>o.model,P=>{P&&Object.keys(P).length>0&&(h.value={...h.value,...P})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(P,R)=>(e.openBlock(),e.createElementBlock("div",dA,[e.createElementVNode("div",uA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!C.value&&k.value?(e.openBlock(),e.createElementBlock("div",fA,[e.createElementVNode("div",mA,[e.createElementVNode("p",hA,e.toDisplayString(k.value.description),1)]),e.createVNode(Rs,{schema:k.value,model:h.value,"is-edit-mode":f.value,loading:w.value,"selected-token-core":o.selectedTokenCore,"onUpdate:model":R[0]||(R[0]=G=>b(G)),onSubmit:_,onCancel:x,onAction:y,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core"])])):C.value?(e.openBlock(),e.createElementBlock("div",pA,[e.createVNode(cA)])):(e.openBlock(),e.createElementBlock("div",gA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-3c619a9c"]]),bA={class:"h-full flex flex-col"},yA={key:1,class:"flex-1 flex items-center justify-center"},xA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ls=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var V,B,g,b,_,y;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=Ke();let i={query:{},params:{},path:""};try{const x=un.useRoute();x?i=x:(g=(B=(V=a==null?void 0:a.appContext)==null?void 0:V.config)==null?void 0:B.globalProperties)!=null&&g.$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:x=>{typeof window<"u"&&(typeof x=="string"?window.location.href=x:x&&x.path&&(window.location.href=x.path))}};try{const x=un.useRouter();x?l=x:(y=(_=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:_.globalProperties)!=null&&y.$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),m=e.ref(null),h="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",k=e.computed(()=>`${h}${o.layoutCode}`),{setPageTitle:C}=Pd();let w;try{w=gt.useI18n().locale}catch{w=e.ref("en")}const p=()=>{if(u.value){const E=(w.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";C(E)}};e.watch(w,()=>{p()});const A=async()=>{f.value=!0;try{const x="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",E=x?{Authorization:`Bearer ${x}`}:{},M=await s(k.value,"GET",null,E);M.status&&(u.value=Array.isArray(M.data)?M.data[0]:M.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(x){console.error("Gagal Menampilkan Datatable:",x)}finally{f.value=!1}},D=x=>{x.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",x.action,x)},S=x=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",x);let E=x.route;const M=x.path;if(!E&&M){const $=((i==null?void 0:i.path)||"").split("/");$.length>=2&&(E=`/${$[1]}/create`)}if(E||M){const T={...x.query||{},code:M||void 0};Object.keys(T).forEach($=>T[$]===void 0&&delete T[$]),console.log("[DEBUG] Emitting navigate to parent:",{route:E,query:T}),r("navigate",{route:E||"/form",query:T}),l&&!l.__isFallback&&l.push({path:E||"/form",query:T})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{A()}),(x,E)=>(e.openBlock(),e.createElementBlock("div",bA,[!f.value&&u.value?(e.openBlock(),e.createBlock(Yn,{key:0,ref_key:"dtRef",ref:m,"api-url":k.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:D,onNavigate:S},{"header-actions":e.withCtx(()=>[...E[0]||(E[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",yA,[...E[1]||(E[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",xA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),Td=e.defineCustomElement(Is),vd=e.defineCustomElement(Ls);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",Td),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",vd));const kA=[Lo,fi,Le,qi,Ca,Ba,nd,Yt,us,fs,_r,Jt,sd,Sr,id,xs,ms,ld,ws,Ar,Cs,Dn,Bs,Vr,cd,dd,Es,_s,Dr,Nr,Fn,qn,hd,pd,Ss,As,Vs,Fs,No,Dd,Yn,Is,Ls,Rs,Md,Mo],Od={install(t,n={}){n&&Object.keys(n).length>0&&Ws(n),kA.forEach(o=>{o.name&&t.component(o.name,o)})}};ae.AutoLayoutDatatable=Ls,ae.AutoLayoutForm=Is,ae.Breadcrumb=Md,ae.DCodeAutoComplete=Lo,ae.DCodeBadge=Fs,ae.DCodeBeforeAfter=Ca,ae.DCodeButton=Le,ae.DCodeCard=qi,ae.DCodeCardCheckboxList=us,ae.DCodeChart=nd,ae.DCodeCheckbox=Yt,ae.DCodeCurrencyField=fs,ae.DCodeDatePicker=_r,ae.DCodeDialog=Jt,ae.DCodeDialogCloseBtn=sd,ae.DCodeDropzone=Sr,ae.DCodeDynamicUploadList=ms,ae.DCodeFileField=id,ae.DCodeFileResult=xs,ae.DCodeIconDropdown=ld,ae.DCodeImageCropperDialog=ws,ae.DCodeImageField=Ar,ae.DCodeImageResult=Cs,ae.DCodeInfiniteAutoComplete=fi,ae.DCodeLabel=Dn,ae.DCodeListLabels=Ba,ae.DCodeMultiSelect=Bs,ae.DCodeOtpInput=Vr,ae.DCodePermissionMenu=As,ae.DCodeProgress=cd,ae.DCodeProgressBar=dd,ae.DCodeRadio=Es,ae.DCodeRadioCustom=_s,ae.DCodeSlider=Dr,ae.DCodeStaticImage=Dd,ae.DCodeStaticLabel=No,ae.DCodeSwitch=Nr,ae.DCodeTextField=Fn,ae.DCodeTextarea=qn,ae.DCodeTimelineWithIcons=hd,ae.DCodeTreePermissions=Vs,ae.DCodeUploadFile=pd,ae.DCodeWizard=Ss,ae.DataTable=Yn,ae.DataTableComponent=Yn,ae.DynamicForm=Rs,ae.DynamicFormField=Mo,ae.DynamicUI=Od,ae.MicroDynamicDatatable=vd,ae.MicroDynamicForm=Td,ae.cn=_e,ae.default=Od,ae.setApiConfig=Ws,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));