ztd-charts-cli 0.6.0 → 0.7.0

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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/api.js +1 -1
  3. package/dist/{chunk-4K4P2AWW.js → chunk-4WXNLD5P.js} +29 -6
  4. package/dist/cli.js +1 -1
  5. package/dist/client/area.js +9 -9
  6. package/dist/client/bar.js +10 -10
  7. package/dist/client/beeswarm.js +10 -10
  8. package/dist/client/box.js +10 -10
  9. package/dist/client/bubble.js +10 -10
  10. package/dist/client/bullet.js +10 -10
  11. package/dist/client/bump.js +10 -10
  12. package/dist/client/calendar.js +10 -10
  13. package/dist/client/candlestick.js +10 -10
  14. package/dist/client/chord.js +10 -10
  15. package/dist/client/donut.js +10 -10
  16. package/dist/client/dumbbell.js +10 -10
  17. package/dist/client/funnel.js +10 -10
  18. package/dist/client/gauge.js +10 -10
  19. package/dist/client/heatmap.js +10 -10
  20. package/dist/client/histogram.js +10 -10
  21. package/dist/client/line.js +9 -9
  22. package/dist/client/lollipop.js +10 -10
  23. package/dist/client/marimekko.js +10 -10
  24. package/dist/client/parallel.js +10 -10
  25. package/dist/client/pareto.js +10 -10
  26. package/dist/client/pie.js +10 -10
  27. package/dist/client/radar.js +10 -10
  28. package/dist/client/radialBar.js +10 -10
  29. package/dist/client/ridgeline.js +10 -10
  30. package/dist/client/sankey.js +10 -10
  31. package/dist/client/scatter.js +10 -10
  32. package/dist/client/segmented.js +10 -10
  33. package/dist/client/skyline.js +10 -10
  34. package/dist/client/slope.js +10 -10
  35. package/dist/client/sparkline.js +10 -10
  36. package/dist/client/stream.js +9 -9
  37. package/dist/client/sunburst.js +10 -10
  38. package/dist/client/tileMap.js +28 -0
  39. package/dist/client/treemap.js +9 -9
  40. package/dist/client/waffle.js +10 -10
  41. package/dist/client/waterfall.js +10 -10
  42. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- (()=>{var Jn=Object.create;var bt=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var Qn=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var We=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var nr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qn(t))!tr.call(e,o)&&o!==n&&bt(e,o,{get:()=>t[o],enumerable:!(r=Zn(t,o))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?Jn(er(e)):{},nr(t||!e||!e.__esModule?bt(n,"default",{value:e,enumerable:!0}):n,e));var O=We((Xo,yt)=>{yt.exports=globalThis.__ztdReact.react});var kt=We((Jo,xt)=>{xt.exports=globalThis.__ztdReact["react-dom/client"]});var N=We((la,Vt)=>{Vt.exports=globalThis.__ztdReact["react/jsx-runtime"]});var pt=S(O(),1),Un=S(kt(),1);var $e=S(O(),1);var Ee=S(O(),1);var vt=S(O(),1),Te=(0,vt.createContext)(void 0);var ar=S(O(),1);var rr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],wt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Ct='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ae={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},or={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},Ke={dark:ae,light:or};function Ge(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Ue(e){let t={};for(let n of rr){let r=e[n];typeof r=="string"&&(t[Ge(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function Ye(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var ir=`
1
+ (()=>{var ao=Object.create;var on=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var lo=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty;var yt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var uo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of so(t))!co.call(e,o)&&o!==n&&on(e,o,{get:()=>t[o],enumerable:!(r=io(t,o))||r.enumerable});return e};var F=(e,t,n)=>(n=e!=null?ao(lo(e)):{},uo(t||!e||!e.__esModule?on(n,"default",{value:e,enumerable:!0}):n,e));var j=yt((wi,an)=>{an.exports=globalThis.__ztdReact.react});var ln=yt(($i,sn)=>{sn.exports=globalThis.__ztdReact["react-dom/client"]});var I=yt((Ii,On)=>{On.exports=globalThis.__ztdReact["react/jsx-runtime"]});var rn=F(j(),1),ro=F(ln(),1);var Ge=F(j(),1);var at=F(j(),1);var cn=F(j(),1),we=(0,cn.createContext)(void 0);var fn=F(j(),1);var mo=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],un='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',mn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fe={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:un,monoFamily:mn,radius:18,radiusCode:14,radiusMark:4},xt={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:un,monoFamily:mn,radius:18,radiusCode:14,radiusMark:4},kt={dark:fe,light:xt};function Ue(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function vt(e){let t={};for(let n of mo){let r=e[n];typeof r=="string"&&(t[Ue(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function wt(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var fo=`
2
2
  .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
3
  .ztd-root:focus{outline:none}
4
- .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ae.accent});outline-offset:3px;border-radius:6px}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${fe.accent});outline-offset:3px;border-radius:6px}
5
5
  .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
6
  .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
7
7
  .ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
@@ -9,9 +9,9 @@
9
9
  .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
10
  .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
11
  .ztd-btn:focus{outline:none}
12
- .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ae.accent});outline-offset:2px}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${fe.accent});outline-offset:2px}
13
13
  .ztd-card{transition:border-color .16s ease}
14
- .ztd-card:hover{border-color:var(--ztd-dim,${ae.dim})}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${fe.dim})}
15
15
  @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
16
  @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
17
  @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
@@ -19,10 +19,10 @@
19
19
  @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
20
  .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
21
  @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
- `;var $t=!1;function ye(){if($t||typeof document>"u"||($t=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=ir,document.head.appendChild(e)}var Se=S(O(),1),ne=typeof window<"u"&&typeof document<"u",ee=ne?Se.useLayoutEffect:Se.useEffect;function Me(){return typeof performance<"u"?performance.now():Date.now()}function z(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ae(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Tt={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},St={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var sr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],lr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function cr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function ur(e){return cr(sr,e)}function Mt(e,t){let n=ur(e);return{text:n?n[t]:e,...lr[n?.id??"basic"]}}var J=S(O(),1);var Lt=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),re="en-US",At=new Map;function qe(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=At.get(r);return o||(o=new Intl.NumberFormat(e,n),At.set(r,o)),o}function Xe(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Je(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=re,...r}=t;return Xe(qe(n,r).format(e))}var Ft=e=>e!==0&&Math.abs(e)<.05,Dt=(e,t,n="")=>`${Je(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Re(e,t={}){if(!Number.isFinite(e))return"-";if(Ft(e)&&t.maximumFractionDigits===void 0)return Dt(e,t.locale??re,"%");let n=Math.abs(e);return`${Je(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function mr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=re,...r}=t;if(z(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,c]=a[i],l=o/s,f=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**f)/10**f;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Je(u,{locale:n,...r,maximumFractionDigits:f})+c}}return Xe(qe(n,{notation:"compact",...r}).format(e))}var dr=(e,t=z(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ne(e,t=re,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=qe(t,o);return c=>Number.isFinite(c)?`${i}${Xe(s.format(c))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Re(o,{locale:t});case"ratio":return o=>Re(o*100,{locale:t});case"compact":return o=>mr(o,{locale:t});case"currency":return r(dr(t));default:{let o=r({maximumFractionDigits:1});return a=>Ft(a)?Dt(a,t):o(a)}}}function fr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var hr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var gr=["january","february","march","april","may","june","july","august","september","october","november","december"],Rt=e=>{let t=e.toLowerCase();return t.length<3?0:gr.findIndex(n=>n.startsWith(t))+1},Nt=e=>+e+(+e<30?2e3:1900);function Et(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var pr=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],br=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,_t=/\{([^{}]+)\}/g;function yr(e,t){let n;for(let r of pr)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[Nt(n[3]),+n[2],+n[1],1]:[Nt(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=br.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Rt(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=Rt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function Ot(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(hr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Ot(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=yr(n,t);if(r)return fr(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var Pt=new Map;function It(e,t={month:"short",day:"numeric"}){let n=Ot(e);if(!n)return"-";let{locale:r=re,...o}=t,a=r+JSON.stringify(o),i=Pt.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Pt.set(a,i)),i.format(n)}var Bt={white:"#ffffff",black:"#000000",transparent:"#00000000"};function zt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Bt[t.toLowerCase()]&&(t=Bt[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function xr(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Ze(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kr(e){return[Ze(e[0]),Ze(e[1]),Ze(e[2])]}function Qe(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function Ht(e){let[t,n,r]=kr(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function vr([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Qe(4.0767416621*o-3.3077115913*a+.2309699292*i),Qe(-1.2684380046*o+2.6097574011*a-.3413193965*i),Qe(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function jt(e,t,n){let r=zt(e),o=zt(t);if(!r||!o)return e;let a=Ht(r),i=Ht(o),s=Math.max(0,Math.min(1,n));return xr(vr([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}var et=S(N(),1),Pe=(0,J.createContext)({theme:ae,cssVars:!0});function wr(e,t=ae){return e?typeof e=="string"?Ke[e]??t:Ye(t,e):t}function Fe(e){let t=(0,J.useContext)(Pe),n=e.base?Ke[e.base]:t.theme,r=(0,J.useMemo)(()=>wr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,J.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,J.useMemo)(()=>Ue(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,et.jsx)(Pe.Provider,{value:i,children:(0,et.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var Cr=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Le(e){return Cr.has(e)}function $r(e,t){let n=r=>t?`var(${Ge(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Le(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Le(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:jt(e[r],e[o],a)}}}function oe(e){let t=(0,J.useContext)(Pe);return(0,J.useMemo)(()=>{let n=Ye(t.theme,e);return $r(n,t.cssVars)},[t.theme,t.cssVars,e])}function Z(e){let t=(0,J.useContext)(Pe);return e??t.locale??re}function Wt(e){return e?Ue(e):{}}var De=S(O(),1),tt=(0,De.createContext)(void 0);function Kt(e){let t=(0,De.useContext)(tt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var v=S(N(),1),Tr={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},Sr={en:Tr,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Mr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},nt=e=>Sr[z(Z(e))];function rt(e){let t=oe(e.theme),n=nt(e.locale),[r,o]=(0,Ee.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),c=e.items.filter(f=>!s.has(f.label)).length,l=(0,v.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((f,u)=>{let h=!s.has(f.label),b=h&&c===1,m=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Ar,{p:t,item:f,off:!h}),(0,v.jsx)("span",{style:h?void 0:{textDecoration:"line-through"},children:f.label})]});return(0,v.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,v.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":h,"aria-disabled":b||void 0,onClick:()=>{b||(i(f.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:b?"default":void 0},children:m}):m},u)})});return i?(0,v.jsxs)(v.Fragment,{children:[l,(0,v.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Mr,children:r?n.shown(c,e.items.length):""})]}):l}function Ar({p:e,item:t,off:n}){let r=t.color?Le(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,v.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,v.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,v.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,v.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function Rr(e){let t=oe(e.theme),n=Mt(e.level,z(Z(e.locale)));return(0,v.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Nr(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,v.jsxs)(v.Fragment,{children:[e.slice(0,r),(0,v.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Gt(e){let t=oe(e.theme),n=nt(e.locale),[r,o]=(0,Ee.useState)(0);ee(()=>ye(),[]);let a=()=>{o(h=>h+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,v.jsx)(rt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,f=e.source!==void 0||e.note!==void 0?(0,v.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,v.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,v.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,v.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,v.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,v.jsx)(Rr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,v.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,v.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,v.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,v.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Nr(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,v.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,v.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,v.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,v.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,v.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,v.jsx)("span",{}),i]}):null]}),(0,v.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,v.jsx)(tt.Provider,{value:r,children:(0,v.jsx)(Te.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),f?(0,v.jsxs)(v.Fragment,{children:[f,u]}):u]})}function ot(e){let t=oe(e.theme),n=nt(e.locale),r=e.height??220;if(ee(()=>ye(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,v.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,v.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,v.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,v.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,v.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,v.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,v.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,v.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,v.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,v.jsx)(v.Fragment,{children:e.children})}function de(e,t,n,r,o="max"){let a=new Set,i=n.length,s=l=>{if(i&&l!=="none"){if(l==="first")a.add(0);else if(l==="last")a.add(i-1);else if(l==="max"||l==="min"){let f=-1,u=l==="max"?-1/0:1/0;r.forEach((h,b)=>{Number.isFinite(h)&&(l==="max"?h>u:h<u)&&(u=h,f=b)}),f>=0&&a.add(f)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((l,f)=>{f<i&&l!==null&&l!==void 0&&e(l,f)&&a.add(f)}),a;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<i&&a.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((f,u)=>{f===l&&a.add(u)});return a}function Ut(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function xe(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function Yt(e,t){return xe(e+1,t).slice(0,e)}function qt(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Pr(e,t){if(e==null||typeof e!="object")return;let n=e;if(qt(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!qt(r,o))return;r=r[o]}return r}}function ke(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Xt(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Pr(r,n)}function ve(e,t){let n=Xt(e,t);return(r,o)=>ke(n(r,o))}function we(e,t){let n=Xt(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function at(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var X=S(O(),1);function Lr(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
23
- `||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,a=[","," ",";","|"],i=",",s=0;for(let c of a){let l=o(c);l>s&&(s=l,i=c)}return i}var Fr=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Jt(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Fr.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ke(t);if(Number.isFinite(n))return n}return t}function ce(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Lr(o),i=[],s=[],c="",l=!1;for(let m=0;m<o.length;m++){let g=o[m];l?g==='"'?o[m+1]==='"'?(c+='"',m++):l=!1:c+=g:g==='"'&&!c.trim()?(l=!0,c=""):g===a?(s.push(c),c=""):g===`
24
- `||g==="\r"?(g==="\r"&&o[m+1]===`
25
- `&&m++,s.push(c),i.push(s),s=[],c=""):c+=g}(c!==""||s.length)&&(s.push(c),i.push(s));let f=i.filter(m=>!(m.length===1&&m[0].trim()===""));if(!f.length)return[];let u=m=>n?Jt(m):m;if(!r)return f.map(m=>Object.fromEntries(m.map((g,C)=>[String(C),u(g)])));let h=[],b=new Set;return f[0].forEach((m,g)=>{let C=m.trim()||`col${g+1}`,p=C;for(let x=2;b.has(p);x++)p=`${C}_${x}`;b.add(p),h.push(p)}),f.slice(1).map(m=>Object.fromEntries(h.map((g,C)=>[g,u(m[C]??"")])))}function it(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof i[c]=="string"?Jt(i[c]):i[c]??null])))}function Dr(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,c)=>Object.fromEntries(a.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Zt(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function ie(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ie(JSON.parse(t))}catch{}return ce(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?it(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?ie(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?it(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?ie(t.rows):Array.isArray(t.values)?it(t.values):Array.isArray(t.items)?ie(t.items):Array.isArray(t.results)?ie(t.results):Dr(t)}return[]}function Qt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}async function Er(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(z(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ce(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return ce(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):ce(a)}async function _r(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await Er(a,t.parse,o,t.locale)}return t.select&&(r=Zt(r,t.select)),t.transform?t.transform(r):ie(r)}function en(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,X.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,X.useState)(0),l=Z(t.locale),f=(0,X.useRef)(t);f.current={...t,locale:l};let u=(0,X.useRef)(e);u.current=e;let h=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",b=t.deps??[],m=JSON.stringify(b.map(p=>typeof p=="object"?JSON.stringify(p):String(p))),g=(0,X.useRef)(!1);(0,X.useEffect)(()=>{let p=u.current;if(!p||!r){i(y=>y.status==="loading"?{...y,status:"idle"}:y);return}let x=new AbortController,T=!0;return g.current=!0,i(y=>({...y,data:o?y.data:[],status:"loading",error:null})),_r(p,{...f.current,signal:x.signal}).then(y=>{T&&i({data:y,status:"success",error:null,updatedAt:Date.now()})}).catch(y=>{!T||x.signal.aborted||i(w=>({...w,status:"error",error:y instanceof Error?y:new Error(String(y))}))}).finally(()=>{T&&(g.current=!1)}),()=>{T=!1,g.current=!1,x.abort()}},[h,r,s,m,o]),(0,X.useEffect)(()=>{if(!n||!r)return;let p=setInterval(()=>{g.current||c(x=>x+1)},n);return()=>clearInterval(p)},[n,r]);let C=(0,X.useCallback)(()=>c(p=>p+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:C}}var lt=S(N(),1),Or=["csv","svg","png"],Ir=/^[=+\-@\t\r\n=+-@]/,Br=/var\(|color-mix\(/;function tn(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Et(e.getTime()):String(e);return`"${(Ir.test(t)&&!Number.isFinite(ke(t))?`'${t}`:t).replace(/"/g,'""')}"`}function zr(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Hr(e,t){return`\uFEFF${[t.map(tn),...e.map(r=>t.map(o=>tn(r[o])))].map(r=>r.join(",")).join(`\r
22
+ `;function hn(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function gn(e,t){let[n]=(0,fn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var dn=!1;function Ie(){if(dn||typeof document>"u"||(dn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=fo,document.head.appendChild(e)}var Xe=F(j(),1),re=typeof window<"u"&&typeof document<"u",se=re?Xe.useLayoutEffect:Xe.useEffect;function Ye(){return typeof performance<"u"?performance.now():Date.now()}function V(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function $e(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var pn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},bn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ho=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],go={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function po(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function bo(e){return po(ho,e)}function yn(e,t){let n=bo(e);return{text:n?n[t]:e,...go[n?.id??"basic"]}}var xn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ce(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),xn[t.toLowerCase()]&&(t=xn[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let i=parseInt(o,16);return o.length===6?[i>>16&255,i>>8&255,i&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let i=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function wn(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Ct(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Me(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kn(e){return .2126*Me(e[0])+.7152*Me(e[1])+.0722*Me(e[2])}function Mt(e,t,n){let r=typeof e=="string"?Ce(e):e,o=typeof t=="string"?Ce(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Ce(n):n:null;o[3]<1&&i&&(o=Ct(o,i));let a=r[3]<1?Ct(r,o):r,s=kn(a),c=kn(o);return(Math.max(s,c)+.05)/(Math.min(s,c)+.05)}function yo(e){return[Me(e[0]),Me(e[1]),Me(e[2])]}function $t(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function vn(e){let[t,n,r]=yo(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function xo([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[$t(4.0767416621*o-3.3077115913*i+.2309699292*a),$t(-1.2684380046*o+2.6097574011*i-.3413193965*a),$t(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function qe(e,t,n){let r=Ce(e),o=Ce(t);if(!r||!o)return e;let i=vn(r),a=vn(o),s=Math.max(0,Math.min(1,n));return wn(xo([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Tt(e,t,n){let r=t[0],o=-1;for(let i of t){let a=Mt(i,e,n);a>o&&(o=a,r=i)}return r}function G(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function ko(e,t){let n=Tt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Mt(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Tt(t,["#FFFFFF","#000000"])}function Je(e,t){let n=qe(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:ko(e,n),raw:n}}function le(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=G(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=G(e,"neutral");else if(s===0)r[a]=G(e,"ink");else if(s===i-1)r[a]=G(e,"neutral");else if(i===3)r[a]=G(e,"strong");else{let c=(s-1)/Math.max(1,i-2);r[a]=c<=.001?G(e,"strong"):Je(e,1-c)}}),r}var St="mix:";function Oe(e){return e({theme:xt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${St}${o}`}).map(n=>n.fill)}function $n(e,t){return t?.startsWith(St)?e.mix("neutralStrong","neutral",Number(t.slice(St.length))):e.color(t)}function Cn(e,t,n){return le(e,t+1,n).slice(0,t)}function Mn(e,t,n,r="neutral"){let o=G(e,"accent"),i=G(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Tn(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=G(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=G(e,"neutral"):s===0?r[a]=G(e,"strong"):s===i-1?r[a]=G(e,"neutral"):r[a]=Je(e,1-s/(i-1))}),r}var oe=F(j(),1);var Qe=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),q="en-US",Sn=new Map;function At(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=Sn.get(r);return o||(o=new Intl.NumberFormat(e,n),Sn.set(r,o)),o}function Ft(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Te(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=q,...r}=t;return Ft(At(n,r).format(e))}var Nt=e=>e!==0&&Math.abs(e)<.05,Rt=(e,t,n="")=>`${Te(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ze(e,t={}){if(!Number.isFinite(e))return"-";if(Nt(e)&&t.maximumFractionDigits===void 0)return Rt(e,t.locale??q,"%");let n=Math.abs(e);return`${Te(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Rn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=q,...r}=t;if(V(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,c]=i[a],l=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**m)/10**m;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+Te(u,{locale:n,...r,maximumFractionDigits:m})+c}}return Ft(At(n,{notation:"compact",...r}).format(e))}var vo=(e,t=V(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function be(e,t=q,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=At(t,o);return c=>Number.isFinite(c)?`${a}${Ft(s.format(c))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Ze(o,{locale:t});case"ratio":return o=>Ze(o*100,{locale:t});case"compact":return o=>Rn(o,{locale:t});case"currency":return r(vo(t));default:{let o=r({maximumFractionDigits:1});return i=>Nt(i)?Rt(i,t):o(i)}}}function Pn(e,t=q,n=0){return e!==void 0?be(e,t):n>=1e5?r=>Nt(r)?Rt(r,t):Rn(r,{locale:t}):r=>Te(r,{locale:t})}function wo(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Pt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,$o=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Co=["january","february","march","april","may","june","july","august","september","october","november","december"],An=e=>{let t=e.toLowerCase();return t.length<3?0:Co.findIndex(n=>n.startsWith(t))+1},Fn=e=>+e+(+e<30?2e3:1900);function Dn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Mo=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],Ln=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,En=/\{([^{}]+)\}/g;function et(e,t){let n;for(let r of Mo)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[Fn(n[3]),+n[2],+n[1],1]:[Fn(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=Ln.exec(e)){let r=+n[1],o=+n[3],i=r>12||o<=12&&t===!0;return[+n[4],i?o:r,i?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=An(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=An(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var _n=e=>$o.test(e)||et(e)!==null;function In(e){let t;for(let n of e){let r=typeof n=="string"?Ln.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function tt(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(Pt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return tt(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=et(n,t);if(r)return wo(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var Nn=new Map;function Be(e,t={month:"short",day:"numeric"}){let n=tt(e);if(!n)return"-";let{locale:r=q,...o}=t,i=r+JSON.stringify(o),a=Nn.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Nn.set(i,a)),a.format(n)}var Dt=F(I(),1),nt=(0,oe.createContext)({theme:fe,cssVars:!0});function To(e,t=fe){return e?typeof e=="string"?kt[e]??t:wt(t,e):t}function rt(e){let t=(0,oe.useContext)(nt),n=e.base?kt[e.base]:t.theme,r=(0,oe.useMemo)(()=>To(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,oe.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,oe.useMemo)(()=>vt(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Dt.jsx)(nt.Provider,{value:a,children:(0,Dt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var So=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Bn(e){return So.has(e)}function Ao(e,t){let n=r=>t?`var(${Ue(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Bn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Bn(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:qe(e[r],e[o],i)}}}function ae(e){let t=(0,oe.useContext)(nt);return(0,oe.useMemo)(()=>{let n=wt(t.theme,e);return Ao(n,t.cssVars)},[t.theme,t.cssVars,e])}function Z(e){let t=(0,oe.useContext)(nt);return e??t.locale??q}function zn(e){return e?vt(e):{}}var ot=F(j(),1),Lt=(0,ot.createContext)(void 0);function Hn(e){let t=(0,ot.useContext)(Lt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var S=F(I(),1),Fo={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},No={en:Fo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Ro={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Et=e=>No[V(Z(e))];function _t(e){let t=ae(e.theme),n=Et(e.locale),[r,o]=(0,at.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),c=e.items.filter(m=>!s.has(m.label)).length,l=(0,S.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((m,u)=>{let d=!s.has(m.label),h=d&&c===1,f=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Po,{p:t,item:m,off:!d}),(0,S.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,S.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,S.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":h||void 0,onClick:()=>{h||(a(m.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return a?(0,S.jsxs)(S.Fragment,{children:[l,(0,S.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Ro,children:r?n.shown(c,e.items.length):""})]}):l}function Po({p:e,item:t,off:n}){let r=$n(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,S.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,S.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,S.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,S.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function Do(e){let t=ae(e.theme),n=yn(e.level,V(Z(e.locale)));return(0,S.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Lo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,S.jsxs)(S.Fragment,{children:[e.slice(0,r),(0,S.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function jn(e){let t=ae(e.theme),n=Et(e.locale),[r,o]=(0,at.useState)(0);se(()=>Ie(),[]);let i=()=>{o(d=>d+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,S.jsx)(_t,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,S.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,S.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,S.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,S.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,S.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,S.jsx)(Do,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,S.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,S.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,S.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,S.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Lo(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,S.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,S.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,S.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,S.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,S.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,S.jsx)("span",{}),a]}):null]}),(0,S.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,S.jsx)(Lt.Provider,{value:r,children:(0,S.jsx)(we.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,S.jsxs)(S.Fragment,{children:[m,u]}):u]})}function It(e){let t=ae(e.theme),n=Et(e.locale),r=e.height??220;if(se(()=>Ie(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,S.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,S.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,S.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,S.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,S.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,S.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,i)=>(0,S.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,S.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,S.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,S.jsx)(S.Fragment,{children:e.children})}var Ee=F(j(),1);var Q=F(j(),1);var B=F(I(),1),it=60;var st={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Vn(e){let{c:t,events:n}=e,r=(0,Q.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,se(()=>{Ie()},[]);let a=n.length,s=!e.noNav&&a>0,c=(0,Q.useContext)(we),l=e.ariaLabel??c??e.kind,m=(0,Q.useMemo)(()=>s?`${n.length}${n.slice(0,it).map(b=>`${b.label}${b.series??""}${b.formatted??b.value??""}`).join("")}`:"",[n,s]),u=(0,Q.useMemo)(()=>(0,B.jsx)(Eo,{label:l,events:n,t:t.t}),[l,m,t.t]),d=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let b=()=>{d.current=null};return window.addEventListener("scroll",b,{capture:!0,passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b,{capture:!0}),window.removeEventListener("resize",b)}},[]),(0,Q.useEffect)(()=>{d.current=null},[t.width,t.height]);let h=b=>{if(b.target!==b.currentTarget)return;if(e.onKey?.(b)){b.preventDefault();return}let M=t.active,R;switch(b.key){case"ArrowRight":case"ArrowDown":R=M===null?0:(M+1)%a;break;case"ArrowLeft":case"ArrowUp":R=M===null?a-1:(M-1+a)%a;break;case"Home":R=0;break;case"End":R=a-1;break;case"Escape":if(M===null)return;R=null;break;case"Enter":case" ":M!==null&&(b.preventDefault(),t.click(M));return;default:return}b.preventDefault(),t.setActive(R,"keyboard")},{via:f,node:p,setActive:k}=t;(0,Q.useEffect)(()=>{if(f!=="touch"||!p)return;let b=M=>{p.contains(M.target)||k(null)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[f,p,k]);let y=t.active!==null?n[t.active]:null,w=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,$=w&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,v=typeof e.renderTip=="function"&&y?e.renderTip(y):null,g=e.announce??(t.via==="keyboard"&&y?`${y.label}${y.series?` ${y.series}`:""}: ${y.formatted??y.value??""} (${(t.active??0)+1}/${a})`:""),N;if(w){let b=w.x*$,M=t.width*$,R=`clamp(${(4-b).toFixed(1)}px, -50%, calc(${(M-b-4).toFixed(1)}px - 100%))`,O=w.y<64;N={position:"absolute",left:b,top:w.y*$,transform:`translate(${R}, ${O?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*$-8)}}let P=b=>{d.current=null,b.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},D=b=>b?M=>{let R=d.current??(d.current=M.currentTarget.getBoundingClientRect());R.width&&b((M.clientX-R.left)/R.width*t.width,(M.clientY-R.top)/R.height*t.height,M)}:void 0,L=D(e.onPointerMove),E=D(e.onPointerDown),A=L||E?b=>{b.pointerType==="touch"&&L?.(b),E?.(b)}:void 0,T=D(e.onPointerUp),C=zn(e.theme);return(0,B.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:b=>{t.via==="keyboard"&&!b.currentTarget.contains(b.relatedTarget)&&t.setActive(null)},onPointerLeave:P,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...C,...e.style},children:[t.pending?null:e.underlay,(0,B.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${i}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:L,onPointerDown:A,onPointerUp:T,onPointerCancel:T,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,B.jsx)("title",{id:o,children:l}),(0,B.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,B.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,w?(0,B.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:v??(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:w.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:w.title}),w.rows.map((b,M)=>(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,B.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(b.strong?"ink":"muted")},children:[b.color?(0,B.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:b.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,b.label]}),(0,B.jsx)("span",{style:{fontWeight:b.strong===!1?500:700},children:b.value})]},M))]})}):null,(0,B.jsx)("span",{className:"ztd-sr",style:st,"aria-live":"polite","aria-atomic":"true",children:g}),s&&!t.pending?u:null]})}function Eo({label:e,events:t,t:n}){return(0,B.jsx)("div",{className:"ztd-sr",style:st,children:(0,B.jsxs)("table",{children:[(0,B.jsx)("caption",{children:n.table(e)}),(0,B.jsxs)("tbody",{children:[t.slice(0,it).map((r,o)=>(0,B.jsxs)("tr",{children:[(0,B.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,B.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>it?(0,B.jsx)("tr",{children:(0,B.jsx)("td",{colSpan:2,children:n.more(t.length-it)})}):null]})]})})}function Se(e){let t=e.baseline??"central";return(0,B.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var x=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ie=x("label","string",!0,"Item name field"),X=x("value","number",!0,"Value field"),_o=[ie,X],Io=[ie,X],Oo=[x("label","string",!0,"Stage name"),x("value","number",!0,"Users at the stage")],Bo=[ie,X],zo=[x("label","string",!0,"Leaf (lowest level) name"),X,x("group","string",!1,"Parent group field")],Ho=[x("label","string",!0,"Leaf name"),X,x("group","string",!1,"Parent group field")],jo=[ie,x("value","number",!0,"Change (total rows may omit it)"),x("type","string",!1,'"total" makes a total bar')],Vo=[ie,X],Wo=[x("x","string",!0,"Column field"),x("series","string",!0,"Stacked series field"),X],Go=[x("x","string",!0,"Column field"),x("y","string",!0,"Row field"),X],Ko=[x("axis","string",!0,"Metric (axis) field"),x("value","number",!0,"Value field",{multi:!0}),x("series","string",!1,"Series field")],Uo=[x("x","number",!0,"x value"),x("y","number",!0,"y value"),x("size","number",!1,"Circle size"),x("label","string",!1,"Name")],Gn=x("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Xo=[x("x","any",!0,"x field (date, number or category)"),x("y","number",!0,"y field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field (long tables)"),x("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Gn],Yo=[x("x","any",!0,"x field"),x("y","number",!0,"y field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field"),x("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Gn],qo=[x("x","any",!0,"x field"),x("y","number",!0,"y field",{multi:!0}),x("series","string",!1,"Series field")],Jo=[x("x","string",!0,"Category field"),x("y","number",!0,"Value field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field"),x("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],Zo=[ie,X],Qo=[x("value","number",!0,"Value field",{prop:"valueKey"}),x("target","number",!1,"Target field",{prop:"targetKey"})],ea=[ie,x("value","number",!0,"Actual value field"),x("target","number",!1,"Target field")],ta=[x("x","any",!1,"x field"),x("y","number",!0,"y field")],na=[ie,x("x","string",!1,"Period field (long tables)"),x("value","number",!1,"Value field (long tables)")],ra=[ie,x("start","number",!0,"Before value"),x("end","number",!0,"After value")],oa=[ie,X],aa=[x("value","number",!0,"Value field"),x("group","string",!1,"Group (row) field"),x("label","string",!1,"Dot name")],ia=[x("group","string",!0,"Group field"),x("value","number",!0,"Value field")],sa=[x("source","string",!0,"Source node"),x("target","string",!0,"Target node"),X],la=[x("source","string",!0,"Sending group"),x("target","string",!0,"Receiving group"),X],ca=[x("date","date",!0,"Date field"),X],ua=[x("x","any",!0,"Period field"),x("series","string",!0,"Item field"),x("rank","number",!1,"Rank field (1 is first)"),x("value","number",!1,"Value field (instead of rank, largest is first)")],ma=[x("group","string",!0,"Group field"),x("value","number",!0,"Value field")],da=[x("label","string",!1,"Row name field")],fa=[x("x","date",!0,"Date (period) field"),x("open","number",!0,"Open price field"),x("high","number",!0,"High price field"),x("low","number",!0,"Low price field"),x("close","number",!0,"Close price field"),x("volume","number",!1,"Volume field")],ha=[ie,X],ga=[x("x","any",!0,"Period field (date or category)"),x("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field (long tables, back row only)"),x("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],pa=[x("value","number",!1,"Sample value field (raw rows)"),x("group","string",!1,"Group field. Up to 2 groups overlap"),x("x0","number",!1,"Bin start (pre-binned rows)"),x("x1","number",!1,"Bin end (pre-binned rows)"),x("count","number",!1,"Samples in the bin (pre-binned rows)")],ba=[x("region","string",!0,"Region name or code, matched to a tile of options.map"),X],ya=[x("x","number",!0,"x value"),x("y","number",!0,"y value"),x("series","string",!1,"Series field (one color per series)"),x("label","string",!1,"Name")],Wn={pie:_o,donut:Io,funnel:Oo,waffle:Bo,treemap:zo,sunburst:Ho,waterfall:jo,pareto:Vo,marimekko:Wo,heatmap:Go,radar:Ko,bubble:Uo,line:Xo,area:Yo,stream:qo,bar:Jo,radialBar:Zo,gauge:Qo,bullet:ea,sparkline:ta,slope:na,dumbbell:ra,lollipop:oa,beeswarm:aa,ridgeline:ia,sankey:sa,chord:la,calendar:ca,bump:ua,box:ma,parallel:da,candlestick:fa,segmented:ha,skyline:ga,histogram:pa,scatter:ya,tileMap:ba},Ae={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"}};function Kn(e,t){return t==="ko"?e.nameKo:e.name}function Un(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Xn=["line","area","bar","scatter"],Yn=24,Ot=["line","area","bar","scatter"];function Bt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function qn(e,t,n){return Ot.includes(e)&&!Bt(e,t,n).length}function Jn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var xa={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap"};function lt(e){let t=Wn[e]?e:xa[e]??Object.keys(Ae).find(n=>n.toLowerCase()===e.toLowerCase()||Ae[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Ae[t]))return{type:t,component:Ae[t].component,name:Ae[t].name,nameKo:Ae[t].nameKo,encoding:Wn[t]}}function Zn(e){let t=new Set,n=i=>{Array.isArray(i)?i.forEach(n):typeof i=="string"&&i&&t.add(i)},r=e.encoding??{};for(let i of lt(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}function Qn(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function ka(e,t){if(e==null||typeof e!="object")return;let n=e;if(Qn(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Qn(r,o))return;r=r[o]}return r}}function me(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Fe(e,t){if(typeof e=="function")return e;let n=e??t;return r=>ka(r,n)}function ye(e,t){let n=Fe(e,t);return(r,o)=>me(n(r,o))}function xe(e,t){let n=Fe(e,t);return(r,o)=>{let i=n(r,o);return i==null?"":i instanceof Date?new Date(i.getTime()-i.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(i)}}function Ne(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function va(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
23
+ `||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,i=[","," ",";","|"],a=",",s=0;for(let c of i){let l=o(c);l>s&&(s=l,a=c)}return a}var wa=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function er(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(wa.test(t)||/^[-+]?\.\d+$/.test(t)){let n=me(t);if(Number.isFinite(n))return n}return t}function ke(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??va(o),a=[],s=[],c="",l=!1;for(let f=0;f<o.length;f++){let p=o[f];l?p==='"'?o[f+1]==='"'?(c+='"',f++):l=!1:c+=p:p==='"'&&!c.trim()?(l=!0,c=""):p===i?(s.push(c),c=""):p===`
24
+ `||p==="\r"?(p==="\r"&&o[f+1]===`
25
+ `&&f++,s.push(c),a.push(s),s=[],c=""):c+=p}(c!==""||s.length)&&(s.push(c),a.push(s));let m=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let u=f=>n?er(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((p,k)=>[String(k),u(p)])));let d=[],h=new Set;return m[0].forEach((f,p)=>{let k=f.trim()||`col${p+1}`,y=k;for(let w=2;h.has(y);w++)y=`${k}_${w}`;h.add(y),d.push(y)}),m.slice(1).map(f=>Object.fromEntries(d.map((p,k)=>[p,u(f[k]??"")])))}function zt(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof a[c]=="string"?er(a[c]):a[c]??null])))}function $a(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(i=>Array.isArray(i))){let i=Object.keys(e),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,c)=>Object.fromEntries(i.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function tr(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function he(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return he(JSON.parse(t))}catch{}return ke(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?zt(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?he(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?zt(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?he(t.rows):Array.isArray(t.values)?zt(t.values):Array.isArray(t.items)?he(t.items):Array.isArray(t.results)?he(t.results):$a(t)}return[]}function ct(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=i=>{try{return JSON.stringify(i)}catch{return String(i)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let i=0;i<t;i+=r)o.push(e[i]);return o.push(e[t-1]),`${t}:${n(o)}`}function Ht(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(c,l)=>{let m=e[c][l];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let c=0;for(let l=1;l<r;l++){let m=0,u=0;for(let d=0;d<n;d++){let h=a(d,l),f=h-a(d,l-1),p=0;for(let k=0;k<d;k++)p+=a(k,l)-a(k,l-1);m+=h,u+=(f/2+p)*h}m&&(c-=u/m),s[l]=c}}for(let c=0;c<r;c++){if(t==="zero"){let u=0,d=0;for(let h=0;h<n;h++){let f=e[h][c],p=Number.isFinite(f)?f:0;p>=0?(o[h][c]=u,u+=p,i[h][c]=u):(o[h][c]=d,d+=p,i[h][c]=d)}continue}let l=0;for(let u=0;u<n;u++)l+=a(u,c);let m=t==="silhouette"?-l/2:s[c];for(let u=0;u<n;u++){let d=a(u,c);t==="expand"&&(d=l?d/l*100:0),o[u][c]=m,m+=d,i[u][c]=m}}if(t==="wiggle"&&r){let c=1/0,l=-1/0;for(let u=0;u<r;u++)c=Math.min(c,o[0]?.[u]??0),l=Math.max(l,i[n-1]?.[u]??0);let m=0;for(let u=0;u<r;u++)m+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;m/=r;for(let u=0;u<n;u++)for(let d=0;d<r;d++)o[u][d]-=m,i[u][d]-=m}return{y0:o,y1:i}}function nr(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function rr(e){let t=e.length,n=e.map(l=>{let m=0,u=-1/0;return l.forEach((d,h)=>{d>u&&(u=d,m=h)}),m}),r=e.map(l=>l.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(l,m)=>m).sort((l,m)=>n[l]-n[m]),i=[],a=[],s=0,c=0;for(let l of o)s<c?(i.push(l),s+=r[l]):(a.push(l),c+=r[l]);return[...a.reverse(),...i]}var Pe=Math.PI*2;function or(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function Re(e){return Math.round(e*100)/100}function ee(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function jt(e,t,n,r,o){let i=o-r;if(!(Math.abs(i)>1e-4))return"";let a=Math.abs(i)>=Pe-1e-4?r+(i>0?Pe-1e-4:-(Pe-1e-4)):o,[s,c]=ee(e,t,n,r),[l,m]=ee(e,t,n,a),u=Math.abs(a-r)>Math.PI?1:0;return`M${Re(s)},${Re(c)}A${Re(n)},${Re(n)} 0 ${u} ${i>0?1:0} ${Re(l)},${Re(m)}`}function ar(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function sr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ir(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var ut=new Map;function ve(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=ut.get(o);if(i===void 0){let a=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);sr(l)?a+=ir(l):s+=ir(l)}i=a+s*(n>=600?1.07:1),ut.size>5e3&&ut.clear(),ut.set(o,i)}return i*t}function Vt(e,t,n,r=400){if(e=e.trim(),ve(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let c=i+a+1>>1;ve(e.slice(0,c)+o,n,r)<=t?i=c:a=c-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(sr(s.charCodeAt(0))?2:3)?"":s+o}var cr=F(I(),1),Ca=e=>Array.isArray(e)&&e.length===2;function lr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ca(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var mr=F(I(),1),Wt=10.5;function Ma(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>Te(a,{locale:n,maximumFractionDigits:i}))}function ur(e,t,n){let r=18;for(let o of Ma(e,t,n))r=Math.max(r,ve(o,Wt));return Math.ceil(r+8)}function Gt(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function De(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,c=Gt(a,n),l=[o,i];for(let m=0;m<4;m++){let u=Math.ceil(i/c-1e-9)*c,d=Math.floor(o/c+1e-9)*c;l=[o===0?0:o-d<=c*.3?d:o-a*s,i===0?0:u-i<=c*.3?u:i+a*s];let h=Gt(l[1]-l[0],n);if(h===c)break;c=h}return l}function dr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=Gt(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let c=s,l=0;c<=o+i*1e-9&&l<200;c+=i,l++)a.push(Number((Math.round(c/i)*i).toPrecision(12)));return a}function Kt(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(c=>o+(c-n)*a);return s.domain=e,s.range=t,s.invert=c=>a===0?n:n+(c-o)/a,s.ticks=(c=4)=>dr(n,r,c),s}function Ut(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[i,a]=De(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function Ta(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(l,m=1)=>{let u=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let h of l){let f=Number((h*10**d).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let c=a([1,2,3,4,5,6,7,8,9]);return c.length>=2?c:dr(e,t,3)}function fr(e,t){let n=Kt([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>Ta(e[0],e[1],Math.abs(t[1]-t[0])),r}function ze(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Sa=864e5;function hr(e,t,n,r=q){let o=t-e;if(!(o>0))return[{t:e,label:Be(e,{locale:r,month:"short",day:"numeric"})}];let i=o/Sa,a=[],s=new Date(e),c=new Date(e).getFullYear()===new Date(t).getFullYear(),l=(m,u,d,h=!1)=>{let f=new Date(m),p=-1,k=0;for(;f.getTime()<=t&&k++<500;){if(f.getTime()>=e){let y=f.getFullYear(),w=h&&!c&&y!==p;a.push({t:f.getTime(),label:Be(f,{locale:r,...d,...w?{year:"numeric"}:{}})}),p=y}u(f)}};if(i<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=m)??12,d=new Date(s);d.setMinutes(0,0,0),l(d,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());l(m,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());m.setDate(m.getDate()+(8-m.getDay())%7),l(m,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=i/30.44,u=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(d>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);l(h,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%d;f&&h.setMonth(h.getMonth()+(d-f)),l(h,p=>p.setMonth(p.getMonth()+d),{month:"short"},!0)}}return a}function gr(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let c=o(a);return c>=0?(r[c]||(i[c]=t(c),r[c]=1),i[c]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var Aa=(e,t,n)=>e==="date"?tt(t,n)?.getTime()??NaN:me(t);function Fa(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&_n(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function He(e,t,n,r,o={}){let i=Fe(t,"x"),a=Array.isArray(n),s=a?n:null,c=a?null:Fe(n,"y"),l=!a&&r!==void 0?Fe(r,"series"):null,m=e.map((C,b)=>i(C,b)),u=o.xType??Fa(m),d=o.locale??q,h,f,p;if(u==="band"){let C=m.map(M=>String(M??""));h=Ne(C);let b=new Map(h.map((M,R)=>[M,R]));f=h.map((M,R)=>R),p=Int32Array.from(C,M=>b.get(M)??-1)}else{let C=u==="date"?o.dayFirst??In(m):void 0,b=m.map(O=>Aa(u,O,C)),M=Array.from(new Set(b.filter(O=>Number.isFinite(O)))).sort((O,z)=>O-z),R=new Map(M.map((O,z)=>[O,z]));f=M,h=M.map(String),p=Int32Array.from(b,O=>R.get(O)??-1)}let k=o.dateFormat,y=C=>typeof C=="string"?et(C.trim())?.[3]:void 0,w=u==="date"&&m.length<5e3?y(m[0]):void 0,$=(w===2||w===3)&&m.every(C=>y(C)===w),v=$&&w===3;if(u==="date"&&!k){let C=f.length>1?f[f.length-1]-f[0]:0;k=$&&w===2||C>864e5*120?{month:"short"}:C<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},C>864e5*800&&(k={year:"numeric",month:"short"})}let g;if(u==="band")g=h;else if(v&&!o.dateFormat){let C=V(d)==="ko";g=f.map(b=>{let M=new Date(b),R=Math.floor(M.getMonth()/3)+1;return C?`${M.getFullYear()}년 ${R}분기`:`Q${R} ${M.getFullYear()}`})}else{let C=f.every(Pt),b=u==="date"?new Intl.DateTimeFormat(d,k):new Intl.NumberFormat(d,C?{useGrouping:!1}:{maximumFractionDigits:6});g=f.length>1e3?gr(f.length,M=>b.format(f[M])):f.map(M=>b.format(M))}let N=s?[...s]:l?Ne(e.map((C,b)=>String(l(C,b)??""))):[""],P=new Map(N.map((C,b)=>[C,b])),D=N.map(()=>new Array(h.length).fill(NaN)),L=N.map(()=>new Array(h.length).fill(null)),E=o.aggregate??"sum",A=E==="mean"?N.map(()=>new Uint32Array(h.length)):null,T=(C,b,M,R)=>{let O=D[C][b];E==="last"?D[C][b]=M:E==="count"?D[C][b]=(Number.isFinite(O)?O:0)+1:E==="mean"?Number.isFinite(M)&&(D[C][b]=(Number.isFinite(O)?O:0)+M,A[C][b]++):D[C][b]=Number.isFinite(O)?O+(Number.isFinite(M)?M:0):M,L[C][b]=R};for(let C=0;C<e.length;C++){let b=p[C];if(b<0)continue;let M=e[C];if(s)for(let R=0;R<s.length;R++)T(R,b,me(M[s[R]]),M);else{let R=l?P.get(String(l(M,C)??""))??0:0;T(R,b,me(c(M,C)),M)}}if(A)for(let C=0;C<D.length;C++)for(let b=0;b<h.length;b++)A[C][b]>1&&(D[C][b]/=A[C][b]);return{type:u,keys:h,xnum:f,labels:g,series:N,values:D,rows:L}}var Na=140,Ve=12,pr=14,Xt=20,br=12.5;function Ra(e,t,n=Yn){let r=xe(t,t),o=new Map;e.forEach((a,s)=>{let c=r(a,s),l=o.get(c);l?l.push(a):o.set(c,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function Pa(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Ve)/(Na+Ve))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Da(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Ve)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var je=e=>e.filter(Number.isFinite);function mt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=ye(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return je(n)}function yr(e,t,n,r,o,i){return He(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function La(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),c=r.yDomain,l=c&&(!s||c[0]>0&&c[1]>0)?c:void 0;if(e==="scatter"){let g=t.flat(),N=r.refLines??{},[P,D]=ze([...mt(g,r.x??"x"),...je([Number(N.x)])]),[L,E]=ze([...mt(g,r.y??"y"),...je([Number(N.y)])].filter(T=>!s||T>0)),A=r.zero??!1;return{y:l??(s?Ut(L,E,a):De(L,E,a,{zero:A,pad:.08})),x:r.xDomain??De(P,D,Math.max(2,Math.round(o/110)),{zero:A,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),h=n.every(g=>g.keys.join("")===d),f=n.length>0&&n.every(g=>g.type!=="band"&&g.type===n[0].type),p=r.xDomain??(!m&&f?ze(n.flatMap(g=>je(g.xnum))):void 0),k=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(k==="percent")return{x:p,sameKeys:h};if(l)return{y:l,x:p,sameKeys:h};let y=[];t.forEach((g,N)=>{let P=n[N];if(k==="stacked"||k==="auto"&&P.series.length>1){let L=Ht(P.values,"zero");L.y0.forEach(E=>y.push(...E)),L.y1.forEach(E=>y.push(...E))}else P.values.forEach(L=>y.push(...L));m&&!u&&r.line!==void 0&&yr(e,g,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(L=>y.push(...L)),m||y.push(...mt(g,r.lower),...mt(g,r.upper))}),m&&y.push(0),u||y.push(...lr(r.annotations));for(let g of r.referenceLines??[])y.push(g.y);r.signColors&&y.push(Number(r.baseline??0));let[w,$]=ze(je(y).filter(g=>!s||g>0));return{y:s?Ut(w,$,a):m?De(w,$,u?Math.max(2,Math.round(o/120)):a):De(w,$,a,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function Ea(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let c=He(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),l=(r.yScale==="log"&&e==="line"?fr:Kt)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=ur(l,Pn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(g=>g.series),d=r.endLabels??n.some(g=>g.series.length>1),h=m+6,f=i-(d?Math.min(i*.28,Math.max(...u.map(g=>ve(g,11,700)),20)+14):10),p=c.keys.length,[k,y]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,w=c.type==="number"?p>12:p>hr(k,y,Math.max(2,Math.floor((f-h)/64)),s).length;if(c.type==="band"||!p||w)return;let $=g=>h+(c.xnum[g]-k)/(y-k)*(f-h),v=g=>ve(c.labels[g],Wt);for(let g=1;;g++){let N=Array.from({length:Math.ceil(p/g)},(P,D)=>D*g);if(g>=p||N.every((P,D)=>!D||$(P)-$(N[D-1])>=(v(P)+v(N[D-1]))/2+8))return N.map(P=>({value:c.xnum[P],label:c.labels[P]}))}}function _a(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function Ia(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${_a(`${e}|${t}|${o}|${ct(r)}`)}`}function Oa(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var Ba={en:{intro:(e,t)=>`${$e(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}};function xr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=Ra(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,c=Pa(s,a,e.columns),{pw:l,ph:m}=Da(s,c,e.height),u=e.scale!=="free",d=t==="scatter"?[]:o.map(A=>yr(t,A,n,n.y,n.series,n.aggregate)),h=u?La(t,o,d,n,l,m):{sameKeys:!1},f=u?Ea(t,o,d,n,h,l,m,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",k=u&&(!p||h.sameKeys),y=u&&(p||h.x!==void 0||h.sameKeys),w=new Set(Oa(e.highlight,r)?[e.highlight].flat():[]),$=w.size>0,v=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,g=e.syncId??Ia(t,e.by,n,e.data),N=Qe(be(n.format,e.locale),n.unit),P=Ba[e.lang],D=[],L=r.map(A=>A===""?P.blank:A);return{panels:r.map((A,T)=>{let C=o[T],b=L[T],M=T%c,R;if(t!=="scatter"){let z=d[T],J=Y=>z.values.reduce((ue,Ke)=>ue+(Number.isFinite(Ke[Y])?Ke[Y]:0),0),_=z.keys.map((Y,ue)=>ue).filter(Y=>z.values.some(ue=>Number.isFinite(ue[Y]))),U=_[_.length-1];D.push({first:_.length?J(_[0]):NaN,last:_.length?J(U):NaN,total:_.reduce((Y,ue)=>Y+J(ue),0)}),t!=="bar"&&z.series.length===1&&U!==void 0&&(R=N(z.values[0][U]))}else D.push({first:NaN,last:NaN,total:C.length});let O={data:C,width:l,height:m,ariaLabel:e.title?`${e.title}, ${b}`:b,syncId:g,highlight:$?w.has(A)?v?()=>!0:void 0:"none":e.highlight,showYAxis:!k||M===0,showXAxis:!y||T+c>=a};return h.y&&(O.yDomain=h.y),h.x&&(O.xDomain=h.x),f&&(O.xTicks=f),{value:A,label:b,props:O,last:R,isPicked:w.has(A)}}),cols:c,pw:l,ph:m,isPanelPick:$,description:za(t,e.by,L,D,i,N,P)}}function za(e,t,n,r,o,i,a){let s=a.intro(n.length,t),c=l=>ar(r.map(m=>m[l]));if(e==="line"||e==="area"){let l=c("last");l>=0&&(s+=a.endHigh(n[l],i(r[l].last)));let m=n.filter((u,d)=>r[d].last<r[d].first);s+=m.length?a.falling(`${m.slice(0,5).join(", ")}${m.length>5?a.more:""}`):a.noneFalling}else{let l=c("total");l>=0&&(s+=e==="bar"?a.total(n[l],i(r[l].total)):a.points(n[l],r[l].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var te=F(j(),1);function Ha(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function ja(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function wr(e,t=!0){let[n,r]=(0,te.useState)({visible:!t,near:!t});return(0,te.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(a=>{let s=ja(a[a.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Ha(.25),rootMargin:"0px 0px -8% 0px"}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function kr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function dt(e){let[t,n]=(0,te.useState)(null),[r,o]=(0,te.useState)(e??null),i=(0,te.useCallback)(a=>{n(a),a&&e===void 0&&o(kr(a))},[e]);return se(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=l=>o(m=>m!==null&&Math.abs(m-l)<.5?m:l),s=()=>a(kr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let m=l[l.length-1]?.contentRect;m?a(m.width>0?Math.round(m.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,i,r]}var Va=()=>()=>{};function Le(){return(0,te.useSyncExternalStore)(Va,()=>!0,()=>!1)}var vr="(prefers-reduced-motion: reduce)";function ft(e="auto"){let[t,n]=(0,te.useState)(()=>re&&typeof window.matchMedia=="function"?window.matchMedia(vr).matches:!1);return(0,te.useEffect)(()=>{if(e!=="auto"||!re||typeof window.matchMedia!="function")return;let r=window.matchMedia(vr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ce=F(I(),1),Wa=60,Ga=420;function $r(e){let t=ae(),n=e.chartProps??{},[,r,o]=dt(e.width),i=e.width??(o||480),a=Z(e.locale??n.locale),s=V(a),c=(0,Ee.useContext)(we),l=e.title??c,m=(0,Ee.useMemo)(()=>xr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:l,locale:a,lang:s}),[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,y)=>typeof y=="function"?String(y):y),e.highlight,e.syncId,i,e.height,l,a,s]),u=`${(0,Ee.useId)().replace(/:/g,"")}fd`,d=ft(n.reducedMotion??"auto"),h=Le(),f=gn({motion:{enabled:n.animate!==!1&&!d&&re},hydrated:h},{waiting:!1,generation:0}),p=e.chart;return(0,ce.jsxs)("div",{ref:r,role:"group","aria-label":l,"aria-describedby":u,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,ce.jsx)("p",{id:u,style:st,children:e.description??m.description}),(0,ce.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${m.cols}, minmax(0, 1fr))`,columnGap:Ve,rowGap:pr},children:m.panels.map((k,y)=>{let w=t.paint(k.isPicked?"accentText":m.isPanelPick?"muted":"ink");return(0,ce.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...hn(f,!1,"fade",y*Wa,Ga)},children:[(0,ce.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Xt,fontSize:br,fontWeight:700,lineHeight:`${Xt}px`,color:w},children:[(0,ce.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,ce.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,ce.jsx)(p,{...n,...k.props})]},k.value)})})]})}function ge(e,t,n,r,o="max"){let i=new Set,a=n.length,s=l=>{if(a&&l!=="none"){if(l==="first")i.add(0);else if(l==="last")i.add(a-1);else if(l==="max"||l==="min"){let m=-1,u=l==="max"?-1/0:1/0;r.forEach((d,h)=>{Number.isFinite(d)&&(l==="max"?d>u:d<u)&&(u=d,m=h)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((l,m)=>{m<a&&l!==null&&l!==void 0&&e(l,m)&&i.add(m)}),i;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<a&&i.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((m,u)=>{m===l&&i.add(u)});return i}var ne=F(j(),1);async function Ka(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(V(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ke(i);if(t==="json"||o.includes("json"))return JSON.parse(i);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return ke(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):ke(i)}async function Ua(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),i=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!i.ok)throw new Error(`HTTP ${i.status}${i.statusText?` ${i.statusText}`:""}`);r=await Ka(i,t.parse,o,t.locale)}return t.select&&(r=tr(r,t.select)),t.transform?t.transform(r):he(r)}function Cr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,ne.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,ne.useState)(0),l=Z(t.locale),m=(0,ne.useRef)(t);m.current={...t,locale:l};let u=(0,ne.useRef)(e);u.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(y=>typeof y=="object"?JSON.stringify(y):String(y))),p=(0,ne.useRef)(!1);(0,ne.useEffect)(()=>{let y=u.current;if(!y||!r){a(v=>v.status==="loading"?{...v,status:"idle"}:v);return}let w=new AbortController,$=!0;return p.current=!0,a(v=>({...v,data:o?v.data:[],status:"loading",error:null})),Ua(y,{...m.current,signal:w.signal}).then(v=>{$&&a({data:v,status:"success",error:null,updatedAt:Date.now()})}).catch(v=>{!$||w.signal.aborted||a(g=>({...g,status:"error",error:v instanceof Error?v:new Error(String(v))}))}).finally(()=>{$&&(p.current=!1)}),()=>{$=!1,p.current=!1,w.abort()}},[d,r,s,f,o]),(0,ne.useEffect)(()=>{if(!n||!r)return;let y=setInterval(()=>{p.current||c(w=>w+1)},n);return()=>clearInterval(y)},[n,r]);let k=(0,ne.useCallback)(()=>c(y=>y+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:k}}var qt=F(I(),1),Xa=["csv","svg","png"],Ya=/^[=+\-@\t\r\n=+-@]/,qa=/var\(|color-mix\(/;function Mr(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Dn(e.getTime()):String(e);return`"${(Ya.test(t)&&!Number.isFinite(me(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ja(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Za(e,t){return`\uFEFF${[t.map(Mr),...e.map(r=>t.map(o=>Mr(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function jr(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function st(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var nn=2,se=16;function rn(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function on(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function an(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,c]=[a+se*2,i+se*2],l=o.cloneNode(!0),f=l.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((m,g)=>{let C;for(let p of Array.from(m.attributes)){if(!Br.test(p.value))continue;let x=(C??(C=getComputedStyle(m))).getPropertyValue(p.name);x&&f[g].setAttribute(p.name,rn(x,u))}}),l.removeAttribute("style");for(let[m,g]of Object.entries({viewBox:`${-se} ${-se} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))l.setAttribute(m,String(g));let h=rn(getComputedStyle(r).backgroundColor,u),b=o.parentElement?.querySelector("canvas")??null;if(n){let m=l.querySelector("desc")?.nextSibling??l.firstChild;l.insertBefore(on("rect",{x:-se,y:-se,width:s,height:c,fill:h}),m),b&&l.insertBefore(on("image",{href:b.toDataURL(),width:a,height:i}),m)}return{svg:new XMLSerializer().serializeToString(l),w:s,h:c,vw:a,vh:i,bg:h,canvas:b}}function Vr(e,t){let n=an(e,nn,!1);if(!n)return;let r=nn,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,se*r,se*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(c=>c&&st(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function sn(e){let t=oe(e.theme),n=z(Z(e.locale))==="ko",r=jr(e.filename),o=(a,i)=>{if(a==="csv")return st(new Blob([Hr(e.data,e.columns?.length?e.columns:zr(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Vr(i,r);let s=an(i,1,!0);s&&st(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,lt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Or.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,lt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(a,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var cn=S(N(),1);function ln(e,t=re){let n=Ne(void 0,t),r=e.split(`
28
- `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?It(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let c=!1,l=s.replace(_t,(f,u)=>o(a,u.trim())??(c=!0,""));c||i.push(l)}return i.length?i.map((s,c)=>(0,cn.jsx)("div",{children:s},c)):null}}var d=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Q=d("label","string",!0,"Item name field"),K=d("value","number",!0,"Value field"),Wr=[Q,K],Kr=[Q,K],Gr=[d("label","string",!0,"Stage name"),d("value","number",!0,"Users at the stage")],Ur=[Q,K],Yr=[d("label","string",!0,"Leaf (lowest level) name"),K,d("group","string",!1,"Parent group field")],qr=[d("label","string",!0,"Leaf name"),K,d("group","string",!1,"Parent group field")],Xr=[Q,d("value","number",!0,"Change (total rows may omit it)"),d("type","string",!1,'"total" makes a total bar')],Jr=[Q,K],Zr=[d("x","string",!0,"Column field"),d("series","string",!0,"Stacked series field"),K],Qr=[d("x","string",!0,"Column field"),d("y","string",!0,"Row field"),K],eo=[d("axis","string",!0,"Metric (axis) field"),d("value","number",!0,"Value field",{multi:!0}),d("series","string",!1,"Series field")],to=[d("x","number",!0,"x value"),d("y","number",!0,"y value"),d("size","number",!1,"Circle size"),d("label","string",!1,"Name")],mn=d("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),no=[d("x","any",!0,"x field (date, number or category)"),d("y","number",!0,"y field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field (long tables)"),d("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),mn],ro=[d("x","any",!0,"x field"),d("y","number",!0,"y field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field"),d("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),mn],oo=[d("x","any",!0,"x field"),d("y","number",!0,"y field",{multi:!0}),d("series","string",!1,"Series field")],ao=[d("x","string",!0,"Category field"),d("y","number",!0,"Value field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field"),d("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],io=[Q,K],so=[d("value","number",!0,"Value field",{prop:"valueKey"}),d("target","number",!1,"Target field",{prop:"targetKey"})],lo=[Q,d("value","number",!0,"Actual value field"),d("target","number",!1,"Target field")],co=[d("x","any",!1,"x field"),d("y","number",!0,"y field")],uo=[Q,d("x","string",!1,"Period field (long tables)"),d("value","number",!1,"Value field (long tables)")],mo=[Q,d("start","number",!0,"Before value"),d("end","number",!0,"After value")],fo=[Q,K],ho=[d("value","number",!0,"Value field"),d("group","string",!1,"Group (row) field"),d("label","string",!1,"Dot name")],go=[d("group","string",!0,"Group field"),d("value","number",!0,"Value field")],po=[d("source","string",!0,"Source node"),d("target","string",!0,"Target node"),K],bo=[d("source","string",!0,"Sending group"),d("target","string",!0,"Receiving group"),K],yo=[d("date","date",!0,"Date field"),K],xo=[d("x","any",!0,"Period field"),d("series","string",!0,"Item field"),d("rank","number",!1,"Rank field (1 is first)"),d("value","number",!1,"Value field (instead of rank, largest is first)")],ko=[d("group","string",!0,"Group field"),d("value","number",!0,"Value field")],vo=[d("label","string",!1,"Row name field")],wo=[d("x","date",!0,"Date (period) field"),d("open","number",!0,"Open price field"),d("high","number",!0,"High price field"),d("low","number",!0,"Low price field"),d("close","number",!0,"Close price field"),d("volume","number",!1,"Volume field")],Co=[Q,K],$o=[d("x","any",!0,"Period field (date or category)"),d("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field (long tables, back row only)"),d("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],To=[d("value","number",!1,"Sample value field (raw rows)"),d("group","string",!1,"Group field. Up to 2 groups overlap"),d("x0","number",!1,"Bin start (pre-binned rows)"),d("x1","number",!1,"Bin end (pre-binned rows)"),d("count","number",!1,"Samples in the bin (pre-binned rows)")],So=[d("x","number",!0,"x value"),d("y","number",!0,"y value"),d("series","string",!1,"Series field (one color per series)"),d("label","string",!1,"Name")],un={pie:Wr,donut:Kr,funnel:Gr,waffle:Ur,treemap:Yr,sunburst:qr,waterfall:Xr,pareto:Jr,marimekko:Zr,heatmap:Qr,radar:eo,bubble:to,line:no,area:ro,stream:oo,bar:ao,radialBar:io,gauge:so,bullet:lo,sparkline:co,slope:uo,dumbbell:mo,lollipop:fo,beeswarm:ho,ridgeline:go,sankey:po,chord:bo,calendar:yo,bump:xo,box:ko,parallel:vo,candlestick:wo,segmented:Co,skyline:$o,histogram:To,scatter:So},fe={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"}};function dn(e,t){return t==="ko"?e.nameKo:e.name}function fn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var ct=["line","area","bar","scatter"];function ut(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function hn(e,t,n){return ct.includes(e)&&!ut(e,t,n).length}function gn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Mo={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram"};function _e(e){let t=un[e]?e:Mo[e]??Object.keys(fe).find(n=>n.toLowerCase()===e.toLowerCase()||fe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!fe[t]))return{type:t,component:fe[t].component,name:fe[t].name,nameKo:fe[t].nameKo,encoding:un[t]}}function pn(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of _e(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}var ge=Math.PI*2;function bn(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function he(e){return Math.round(e*100)/100}function U(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function mt(e,t,n,r,o){let a=o-r;if(!(Math.abs(a)>1e-4))return"";let i=Math.abs(a)>=ge-1e-4?r+(a>0?ge-1e-4:-(ge-1e-4)):o,[s,c]=U(e,t,n,r),[l,f]=U(e,t,n,i),u=Math.abs(i-r)>Math.PI?1:0;return`M${he(s)},${he(c)}A${he(n)},${he(n)} 0 ${u} ${a>0?1:0} ${he(l)},${he(f)}`}function yn(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return ce(t.csv)}return null}var Y=S(O(),1);var A=S(N(),1),Oe=60;var xn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function kn(e){let{c:t,events:n}=e,r=(0,Y.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ee(()=>{ye()},[]);let i=n.length,s=!e.noNav&&i>0,c=(0,Y.useContext)(Te),l=e.ariaLabel??c??e.kind,f=(0,Y.useMemo)(()=>s?`${n.length}${n.slice(0,Oe).map($=>`${$.label}${$.series??""}${$.formatted??$.value??""}`).join("")}`:"",[n,s]),u=(0,Y.useMemo)(()=>(0,A.jsx)(Ao,{label:l,events:n,t:t.t}),[l,f,t.t]),h=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let $=()=>{h.current=null};return window.addEventListener("scroll",$,{capture:!0,passive:!0}),window.addEventListener("resize",$,{passive:!0}),()=>{window.removeEventListener("scroll",$,{capture:!0}),window.removeEventListener("resize",$)}},[]),(0,Y.useEffect)(()=>{h.current=null},[t.width,t.height]);let b=$=>{if($.target!==$.currentTarget)return;if(e.onKey?.($)){$.preventDefault();return}let P=t.active,F;switch($.key){case"ArrowRight":case"ArrowDown":F=P===null?0:(P+1)%i;break;case"ArrowLeft":case"ArrowUp":F=P===null?i-1:(P-1+i)%i;break;case"Home":F=0;break;case"End":F=i-1;break;case"Escape":if(P===null)return;F=null;break;case"Enter":case" ":P!==null&&($.preventDefault(),t.click(P));return;default:return}$.preventDefault(),t.setActive(F,"keyboard")},{via:m,node:g,setActive:C}=t;(0,Y.useEffect)(()=>{if(m!=="touch"||!g)return;let $=P=>{g.contains(P.target)||C(null)};return document.addEventListener("pointerdown",$),()=>document.removeEventListener("pointerdown",$)},[m,g,C]);let p=t.active!==null?n[t.active]:null,x=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,T=x&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,y=typeof e.renderTip=="function"&&p?e.renderTip(p):null,w=e.announce??(t.via==="keyboard"&&p?`${p.label}${p.series?` ${p.series}`:""}: ${p.formatted??p.value??""} (${(t.active??0)+1}/${i})`:""),H;if(x){let $=x.x*T,P=t.width*T,F=`clamp(${(4-$).toFixed(1)}px, -50%, calc(${(P-$-4).toFixed(1)}px - 100%))`,ue=x.y<64;H={position:"absolute",left:$,top:x.y*T,transform:`translate(${F}, ${ue?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*T-8)}}let j=$=>{h.current=null,$.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},V=$=>$?P=>{let F=h.current??(h.current=P.currentTarget.getBoundingClientRect());F.width&&$((P.clientX-F.left)/F.width*t.width,(P.clientY-F.top)/F.height*t.height,P)}:void 0,E=V(e.onPointerMove),I=V(e.onPointerDown),k=E||I?$=>{$.pointerType==="touch"&&E?.($),I?.($)}:void 0,M=V(e.onPointerUp),W=Wt(e.theme);return(0,A.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?b:void 0,onBlur:$=>{t.via==="keyboard"&&!$.currentTarget.contains($.relatedTarget)&&t.setActive(null)},onPointerLeave:j,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...W,...e.style},children:[t.pending?null:e.underlay,(0,A.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:k,onPointerUp:M,onPointerCancel:M,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,A.jsx)("title",{id:o,children:l}),(0,A.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,A.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,x?(0,A.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:H,children:y??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:x.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:x.title}),x.rows.map(($,P)=>(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint($.strong?"ink":"muted")},children:[$.color?(0,A.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:$.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,$.label]}),(0,A.jsx)("span",{style:{fontWeight:$.strong===!1?500:700},children:$.value})]},P))]})}):null,(0,A.jsx)("span",{className:"ztd-sr",style:xn,"aria-live":"polite","aria-atomic":"true",children:w}),s&&!t.pending?u:null]})}function Ao({label:e,events:t,t:n}){return(0,A.jsx)("div",{className:"ztd-sr",style:xn,children:(0,A.jsxs)("table",{children:[(0,A.jsx)("caption",{children:n.table(e)}),(0,A.jsxs)("tbody",{children:[t.slice(0,Oe).map((r,o)=>(0,A.jsxs)("tr",{children:[(0,A.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,A.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>Oe?(0,A.jsx)("tr",{children:(0,A.jsx)("td",{colSpan:2,children:n.more(t.length-Oe)})}):null]})]})})}function pe(e){let t=e.baseline??"central";return(0,A.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}function Cn(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function vn(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var Ie=new Map;function wn(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=Ie.get(o);if(a===void 0){let i=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);Cn(l)?i+=vn(l):s+=vn(l)}a=i+s*(n>=600?1.07:1),Ie.size>5e3&&Ie.clear(),Ie.set(o,a)}return a*t}function $n(e,t,n,r=400){if(e=e.trim(),wn(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let c=a+i+1>>1;wn(e.slice(0,c)+o,n,r)<=t?a=c:i=c-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(Cn(s.charCodeAt(0))?2:3)?"":s+o}var _=S(O(),1);var q=S(O(),1);function Ro(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function No(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Mn(e,t=!0){let[n,r]=(0,q.useState)({visible:!t,near:!t});return(0,q.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=No(i[i.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Ro(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Tn(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function An(e){let[t,n]=(0,q.useState)(null),[r,o]=(0,q.useState)(e??null),a=(0,q.useCallback)(i=>{n(i),i&&e===void 0&&o(Tn(i))},[e]);return ee(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=l=>o(f=>f!==null&&Math.abs(f-l)<.5?f:l),s=()=>i(Tn(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let f=l[l.length-1]?.contentRect;f?i(f.width>0?Math.round(f.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,a,r]}var Po=()=>()=>{};function Be(){return(0,q.useSyncExternalStore)(Po,()=>!0,()=>!1)}var Sn="(prefers-reduced-motion: reduce)";function Rn(e="auto"){let[t,n]=(0,q.useState)(()=>ne&&typeof window.matchMedia=="function"?window.matchMedia(Sn).matches:!1);return(0,q.useEffect)(()=>{if(e!=="auto"||!ne||typeof window.matchMedia!="function")return;let r=window.matchMedia(Sn),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function Nn(e,t){let n=oe(e.theme),[r,o,a]=An(e.width),i=Be(),s=e.width??(a||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,f=Rn(e.reducedMotion??"auto"),u=e.animate!==!1&&!f&&ne,h=Mn(r,e.animateOnView!==!1&&u),b=Z(e.locale),m=z(b),g=(0,_.useMemo)(()=>Ne(e.format,b,t.format),[e.format,b,t.format]),C=(0,_.useCallback)(R=>Re(R,{locale:b}),[b]),p=(0,_.useMemo)(()=>Lt(g,e.unit),[g,e.unit]),x=(0,_.useMemo)(()=>Qt(e.data),[e.data]),[T,y]=(0,_.useState)(null),[w,H]=(0,_.useState)(null),j=(0,_.useRef)([]),V=(0,_.useRef)(e.onHover);V.current=e.onHover;let E=(0,_.useRef)(e.onClick);E.current=e.onClick;let I=(0,_.useRef)(null),k=(0,_.useRef)(null),M=(0,_.useRef)(null),W=(0,_.useCallback)((R,G="pointer")=>{if(M.current!==R){M.current=R;let me=R===null?null:j.current[R]??null;queueMicrotask(()=>V.current?.(me)),k.current?.(R)}I.current=R===null?null:G,y(R),H(I.current)},[]),$=(0,_.useCallback)(R=>{I.current!=="keyboard"&&(I.current=R===null?null:"sync",y(R),H(I.current))},[]),P=(0,_.useCallback)(R=>{let G=j.current[R];G&&E.current?.(G)},[]),F=Kt(e.replayKey),ue=e.width!==void 0||(a??0)>0,B={enabled:u,active:h.visible&&ue,near:h.near,replayKey:F,dataKey:x,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},te=(0,_.useCallback)((R,G=1)=>T===null||T===R?G:G*.38,[T]);return{p:n,width:s,height:l,measured:ue,responsive:e.width===void 0,pending:ne&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:B,fv:p,fmt:g,pct:C,locale:b,lang:m,t:m==="ko"?St:Tt,active:T,via:w,setActive:W,click:P,events:j,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:te,sig:x,description:e.description,reduced:f,publish:k,applySync:$}}var D=S(O(),1);function Lo(e){return 1-Math.pow(1-e,3)}function Fo(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Do(e){return e==="easeInOut"?Fo:e==="linear"?t=>t:Lo}function Eo(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function be(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function ze(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function Pn(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function Ln(e,t,n,r){if(!t||!n||t.length!==n.length)return be(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let c of be(s,n[i]))o.push(c)}return o.length===r?o:be(e,r)}var He=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!ze(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Pn(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=ze(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),c=r>0?Math.min(a*r,240):0;if(s){let l=i.to.length;s.from=Ln(s.cur,s.parts,i.parts,l),s.vel=Ln(s.curVel,s.parts,i.parts,l),s.parts=i.parts,s.to=i.to.slice(),Pn(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=ze(s.from,s.to)&&s.vel.every(f=>Math.abs(f)<1e-6),s.progress=s.done?1:0}else{let l=this.make(i,i.enter??i.from??i.to,n+c,0);l.done=ze(l.from,l.to),this.tracks.set(i.key,l)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=be(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Do(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=be(s.from,l)),s.vel.length!==l&&(s.vel=be(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let f;if(this.easing==="spring"){let u=Math.exp(-a*c),h=a*c>=8&&a*c<20,b=0;for(let m=0;m<l;m++){let g=s.from[m]-s.to[m],C=s.vel[m]+a*g;s.cur[m]=s.to[m]+(g+C*c)*u,s.curVel[m]=(s.vel[m]-a*C*c)*u,h&&b<.15&&(b=Math.max(b,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/a)))}f=a*c>=20||h&&b<.15,s.progress=Math.min(1,1-(1+a*c)*u)}else{let u=Math.min(1,c/o),h=r(u),b=Eo(this.easing,u)/o;for(let m=0;m<l;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*h,s.curVel[m]=(s.to[m]-s.from[m])*b;f=u>=1,s.progress=h}if(f){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Ce=new Set,je=0;function Fn(e){je=0;let t=Array.from(Ce);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ce.delete(n)}Ce.size&&typeof requestAnimationFrame<"u"&&(je=requestAnimationFrame(Fn))}function Dn(e){return Ce.add(e),!je&&typeof requestAnimationFrame<"u"&&(je=requestAnimationFrame(Fn)),()=>{Ce.delete(e)}}function _o(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function En(e,t){let n=(0,D.useMemo)(()=>_o(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:c="spring",duration:l=900,stagger:f=0}=t,u=(0,D.useRef)(null),h=(0,D.useRef)("init"),b=(0,D.useRef)(null),m=(0,D.useRef)(s),g=(0,D.useRef)(i),C=(0,D.useRef)(!1),p=(0,D.useRef)(0),[,x]=(0,D.useState)(0),T=(0,D.useRef)(null),y=(0,D.useRef)(!0);u.current||(u.current=new He,u.current.configure(c,l),u.current.snap(n),b.current=n);let w=u.current;if(w.configure(c,l),b.current!==n){let k=h.current,M=!Object.is(m.current,s);w.sameTargets(n)?w.refreshData(n):!r||k==="init"?w.snap(n):k==="idle"?w.hold(n):k==="running"||M?w.update(n,Me(),f):w.snap(n),b.current=n,m.current=s}let H=(0,D.useRef)(()=>!1);H.current=k=>{if(!y.current)return!1;let M=w.step(k);return!M&&h.current==="running"&&(h.current="done"),x(W=>(W+1)%1e9),M||(T.current=null),M};let j=(0,D.useCallback)(()=>{if(!ne||T.current||!w.animating)return;let k=M=>H.current(M);T.current=Dn(k)},[w]);ee(()=>{let k=!Object.is(g.current,i);if(g.current=i,!r){(h.current!=="done"||w.animating)&&(w.snap(b.current??n),h.current="done",x(M=>M+1));return}h.current==="init"||k&&a?(w.hold(b.current??n),h.current="idle",C.current=!1,x(M=>M+1)):k&&(C.current=!0)},[r,i]),ee(()=>{!r||!a||!C.current||(C.current=!1,w.hold(b.current??n),h.current="idle",x(k=>k+1))},[a,r]),(0,D.useEffect)(()=>{r&&o&&h.current==="idle"&&(w.start(Me()),p.current+=1,h.current="running",j(),x(k=>k+1))},[r,o,i,w,j]),(0,D.useEffect)(()=>{w.animating&&j()}),(0,D.useEffect)(()=>(y.current=!0,()=>{y.current=!1,T.current?.(),T.current=null}),[]);let V=Me(),E=w.elapsed(V),I=r&&h.current==="idle";return{items:w.items(),get:k=>w.get(k),elapsed:I?0:E,fade:(k,M=320)=>I?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-k)/M)):1,waiting:I,animating:w.animating,generation:p.current}}var Oo=S(O(),1);var On=S(N(),1);var _n=e=>e?"neutralStrong":"accent";var dt=S(N(),1);function In(e,t,n,r){if(typeof e!="function")return de(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let c=o.get(r(i,s));c!==void 0&&e(i,s)&&a.add(c)}),a}var Io=S(O(),1);var ht=S(N(),1),Bo={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Ae(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Bn={en:Bo,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},ft=["ink","muted","dim"];function zn(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,ft.length)}var zo=S(O(),1);var Wn=S(N(),1),Ho={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ae(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},jo={en:Ho,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Hn=(e,t)=>jo[e].other(t);function jn(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,bn(o.map(a=>a.value)))}}var Vn=e=>Number.isFinite(e)&&e>0?e:0;var Ve=S(O(),1);var L=S(N(),1),Vo={radial:"Radial bar chart",gauge:"Gauge",vsTarget:"vs. target",current:"Current",target:"Target",targetWord:"target",achieved:"Achieved",range:"Range",rangeWord:"range",span:(e,t)=>`${e} to ${t}`},Wo={en:Vo,ko:{radial:"방사형 막대",gauge:"게이지",vsTarget:"목표 대비",current:"현재",target:"목표",targetWord:"목표",achieved:"달성률",range:"범위",rangeWord:"범위",span:(e,t)=>`${e}~${t}`}};function Ko(e){let{cx:t,cy:n,r,len:o,start:a,span:i,lit:s,on:c,off:l}=e,f=Math.max(2,Math.round(e.count??Math.max(24,Math.min(64,(r-o/2)*i/8)))),u=(0,Ve.useMemo)(()=>{let h=(r-o/2)*i/(f-1),b=Math.max(1.6,Math.min(3.4,h*.42));return Array.from({length:f},(m,g)=>{let C=a+i*(g/(f-1)),[p,x]=U(t,n,r-o,C),[T,y]=U(t,n,r-1,C),w=H=>(0,L.jsx)("line",{x1:p,y1:x,x2:T,y2:y,stroke:H,strokeWidth:b,strokeLinecap:"round"},g);return{on:w(c),off:w(l)}})},[t,n,r,o,a,i,f,c,l]);return(0,L.jsx)("g",{"aria-hidden":"true",children:u.map((h,b)=>s>.002&&b/(f-1)<=s+1e-6?h.on:h.off)})}function gt(e){let t=(0,Ve.useMemo)(()=>e.data??[{value:e.value??0,target:e.target}],[e.data,e.value,e.target]),n=e.variant??"arc",r=Nn({...e,data:t},{height:B=>n==="semi"?Math.max(150,Math.min(210,B*.5)):Math.max(180,Math.min(240,B*.6)),duration:1100,format:"integer"}),{p:o,width:a,height:i}=r,s=ve(e.valueKey,"value"),c=ve(e.targetKey,"target"),l=e.value??(t[0]?s(t[0],0):0),f=e.target??(t[0]?c(t[0],0):NaN),u=e.min??0,h=e.max??100,b=Math.max(0,Math.min(1,(l-u)/(h-u||1))),m=Number.isFinite(f)?Math.max(0,Math.min(1,(f-u)/(h-u||1))):NaN,C=(n==="ring"?360:n==="semi"?180:240)/360*ge,p=n==="ring"?0:-C/2,x=n==="semi"?Math.max(30,Math.min(i-26,a/2-10)):Math.max(30,Math.min(i/2-6,a/2-10)),T=a/2,y=n==="semi"?i-18:n==="ring"?i/2:i/2+x*.12,w=Math.max(8,Math.min(n==="ring"?16:20,x*.17)),H=(0,Ve.useMemo)(()=>[{key:"v",to:[b,l],from:[0,u],enter:[0,u],data:null}],[b,l,u]),j=En(H,r.motion),V=j.get("v")??[b,l],E=Ut(o,"accent"),I=e.bands?.filter(B=>B>u&&B<h)??[],k=Wo[r.lang],M=e.label??r.t.value,W=k.span(r.fmt(u),r.fmt(h)),$=e.value===void 0&&!t.length?[]:[{datum:t[0]??null,index:0,key:"value",label:M,value:l,formatted:`${r.fv(l)}${Number.isFinite(f)?` / ${k.targetWord} ${r.fv(f)}`:""}`}],P=r.active===0?{x:T,y:y-x,title:M,rows:[{label:k.current,value:r.fv(l),color:E.fill},...Number.isFinite(f)?[{label:k.target,value:r.fv(f)},...f?[{label:k.achieved,value:r.pct(l/f*100)}]:[]]:[],{label:k.range,value:W}]}:null,F=Math.max(18,Math.min(42,x*.42)),ue=e.description??`${k.gauge}. ${M} ${r.fv(l)}, ${k.rangeWord} ${W}${Number.isFinite(f)?`, ${k.targetWord} ${r.fv(f)}`:""}.`;return(0,L.jsxs)(kn,{c:r,kind:k.gauge,ariaLabel:e.ariaLabel,description:ue,events:$,tip:P,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,L.jsxs)("g",{onPointerEnter:B=>r.setActive(0,B.pointerType==="touch"?"touch":"pointer"),children:[n==="ticks"?(0,L.jsx)(Ko,{cx:T,cy:y,r:x,len:w*1.3,start:p,span:C,count:e.ticks,lit:V[0],on:E.fill,off:o.paint("neutralSoft")}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("path",{d:mt(T,y,x-w/2,p,p+C),fill:"none",stroke:o.paint("neutralSoft"),strokeWidth:w,strokeLinecap:n==="ring"?"butt":"round"}),I.map((B,te)=>{let R=(B-u)/(h-u),[G,me]=U(T,y,x-w-3,p+C*R),[qn,Xn]=U(T,y,x+2,p+C*R);return(0,L.jsx)("line",{x1:G,y1:me,x2:qn,y2:Xn,stroke:o.paint("panel"),strokeWidth:2},te)}),V[0]>.002?(0,L.jsx)("path",{d:mt(T,y,x-w/2,p,p+C*V[0]),fill:"none",stroke:E.fill,strokeWidth:w,strokeLinecap:"round"}):null]}),Number.isFinite(m)?(()=>{let[B,te]=U(T,y,x-w-4,p+C*m),[R,G]=U(T,y,x+4,p+C*m);return(0,L.jsx)("line",{x1:B,y1:te,x2:R,y2:G,stroke:o.paint("ink"),strokeWidth:2.5,strokeLinecap:"round",opacity:j.fade(500,300)})})():null]}),(0,L.jsx)(pe,{x:T,y:n==="semi"?y-F*.55:y-(e.label?F*.18:0),anchor:"middle",size:F,weight:800,fill:o.paint("ink"),letterSpacing:-1,children:r.fv(V[1])}),e.label?(0,L.jsx)(pe,{x:T,y:n==="semi"?y-6:y+F*.5,anchor:"middle",size:11.5,fill:o.paint("muted"),children:$n(e.label,x*1.5,11.5)}):null,n!=="ring"?(0,L.jsx)("g",{"aria-hidden":"true",children:(()=>{let[B,te]=U(T,y,x-w/2,p),[R,G]=U(T,y,x-w/2,p+C),me=n==="semi"?12:w/2+10;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(pe,{x:B,y:te+me,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(u)}),(0,L.jsx)(pe,{x:R,y:G+me,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(h)})]})})()}):null,Number.isFinite(f)&&r.showLabels&&n!=="ring"?(()=>{let[B,te]=U(T,y,x+14,p+C*m),R=Math.sin(p+C*m);return(0,L.jsx)(pe,{x:B,y:te,anchor:R>.2?"start":R<-.2?"end":"middle",size:10.5,weight:700,fill:o.paint("ink"),opacity:j.fade(600,300),children:`${k.target} ${r.fmt(f)}`})})():null]})}var le=S(N(),1);function Kn(e,t){let n=_e(e);return n?.type==="scatter"&&t?.size!==void 0?_e("bubble"):n}function Go(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Uo(e,t,n,r=!1){let o=Kn(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,c=new Set(!r&&ct.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),l=u=>u.filter(h=>!c.has(h.label)),f=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(f.includes(o.type)){let u=we(a.label,"label"),h=ve(a.value,"value"),b=o.type==="waffle",m=t.map((y,w)=>({r:y,label:u(y,w),value:b?h(y,w):Vn(h(y,w))})),{kept:g,other:C}=b?{kept:m,other:null}:jn(m,i.other,(y,w)=>({r:{},label:Hn(z(n),y),value:w})),p=de(s,g.map(y=>y.r),g.map(y=>y.label),g.map(y=>y.value),b?"first":"max"),x=C?[...g,C]:g,T=xe(x.length,p);return x.map((y,w)=>({label:y.label,color:T[w]}))}if(o.type==="candlestick"){let u=zn(Array.isArray(i.ma)?i.ma:void 0,t.length),h=Bn[z(n)];return[{label:h.up,color:i.upColor??"accent"},{label:h.down,color:i.downColor??"neutralStrong"},...u.map((b,m)=>({label:h.maLegend(b),color:ft[m],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let u=we(a.series,"series"),h=at(t.map((m,g)=>u(m,g)));if(h.length<2)return[];let b=Yt(h.length,In(s,t,h,u));return l(h.map((m,g)=>({label:m,color:b[g],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let g=we(a.series,"series");u=at(t.map((C,p)=>g(C,p)))}let h=ut(o.type,a,i);if(h.length){let g=xe(u.length,de(s,u,u,u.map(()=>0),"none")),C=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((p,x)=>({label:p,color:g[x]}));return[...l(C),...h.map((p,x)=>({label:p,color:_n(x),shape:"line"}))]}if(u.length<2)return[];let b=de(s,u,u,u.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return l(u.map((g,C)=>({label:g,color:b.has(C)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let m=xe(u.length,b);return l(u.map((g,C)=>({label:g,color:m[C]})))}return[]}function Gn(e,t){let{spec:n}=e,r=Kn(n.type,n.encoding),o=(0,$e.useMemo)(()=>yn(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=fn(n,e.locale),s=Z(i),c=z(s),l=en(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),f=gn(n),u=(0,$e.useMemo)(()=>f?ln(f,s):void 0,[f,s]),h=n.options?.hidden,b=Array.isArray(h)?h.map(String):[],m=b.join(""),[g,C]=(0,$e.useState)(null);if(!r)return(0,le.jsx)(ot,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let p=o??l.data,x=t[r.type],T={...n.options??{}},y={...Go(r,n.encoding),...T,...u?{tooltip:u}:{},data:p,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},w=n.card?.legend==="toggle"&&hn(r.type,n.encoding??{},T),H=g&&g.base===m?g.hidden:b;w&&(y.hidden=H);let j=k=>C(M=>{let W=M&&M.base===m?M.hidden:b;return{base:m,hidden:W.includes(k)?W.filter($=>$!==k):[...W,k]}}),V=y.height??220,E=a&&!p.length&&(l.loading||l.error||l.empty)?(0,le.jsx)(ot,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:V,locale:i}):(0,le.jsx)(x,{...y});if(n.card){let k=n.card,M=k.legend==="auto"||k.legend==="toggle"?Uo(n,p,s,w):k.legend,W=M?.length?w?(0,le.jsx)(rt,{items:M,hidden:H,onToggle:j,locale:i}):M:void 0,$=k.download?(0,le.jsx)(sn,{data:p,columns:pn(n),filename:k.title??r.type,formats:Array.isArray(k.download)?k.download:void 0,locale:i}):void 0;E=(0,le.jsx)(Gt,{number:k.number,title:k.title??dn(r,c),subtitle:k.subtitle,legend:W,actions:$,source:k.source||void 0,note:k.note||void 0,accent:k.accent,takeaway:k.takeaway,level:k.level,sample:k.sample,replay:k.replay!==!1,className:e.className,locale:i,children:E})}let I=e.theme??n.theme;return I&&(E=(0,le.jsx)(Fe,{theme:I,children:E})),E}function Yo({cfg:e,components:t}){let n=Be();return Gn({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Yn(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Un.hydrateRoot)(r,(0,pt.createElement)(Fe,{theme:o.theme,cssVars:!0},(0,pt.createElement)(Yo,{cfg:o,components:{[e]:t}})))}Yn("gauge",gt);})();
27
+ `}function Qa(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Yt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Tr=2,pe=16;function Sr(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,i,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function Ar(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function Fr(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,c]=[i+pe*2,a+pe*2],l=o.cloneNode(!0),m=l.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,p)=>{let k;for(let y of Array.from(f.attributes)){if(!qa.test(y.value))continue;let w=(k??(k=getComputedStyle(f))).getPropertyValue(y.name);w&&m[p].setAttribute(y.name,Sr(w,u))}}),l.removeAttribute("style");for(let[f,p]of Object.entries({viewBox:`${-pe} ${-pe} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))l.setAttribute(f,String(p));let d=Sr(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=l.querySelector("desc")?.nextSibling??l.firstChild;l.insertBefore(Ar("rect",{x:-pe,y:-pe,width:s,height:c,fill:d}),f),h&&l.insertBefore(Ar("image",{href:h.toDataURL(),width:i,height:a}),f)}return{svg:new XMLSerializer().serializeToString(l),w:s,h:c,vw:i,vh:a,bg:d,canvas:h}}function ei(e,t){let n=Fr(e,Tr,!1);if(!n)return;let r=Tr,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let i=o.getContext("2d");if(!i)return;i.fillStyle=n.bg,i.fillRect(0,0,o.width,o.height),n.canvas&&i.drawImage(n.canvas,pe*r,pe*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(c=>c&&Yt(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Nr(e){let t=ae(e.theme),n=V(Z(e.locale))==="ko",r=Qa(e.filename),o=(i,a)=>{if(i==="csv")return Yt(new Blob([Za(e.data,e.columns?.length?e.columns:Ja(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return ei(a,r);let s=Fr(a,1,!0);s&&Yt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,qt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Xa.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,qt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(i,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:a},i)})})}var Pr=F(I(),1);function Rr(e,t=q){let n=be(void 0,t),r=e.split(`
28
+ `),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Be(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let c=!1,l=s.replace(En,(m,u)=>o(i,u.trim())??(c=!0,""));c||a.push(l)}return a.length?a.map((s,c)=>(0,Pr.jsx)("div",{children:s},c)):null}}function Dr(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return ke(t.csv)}return null}var zr=F(j(),1);var K=F(j(),1);function Lr(e,t){let n=ae(e.theme),[r,o,i]=dt(e.width),a=Le(),s=e.width??(i||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,m=ft(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&re,d=wr(r,e.animateOnView!==!1&&u),h=Z(e.locale),f=V(h),p=(0,K.useMemo)(()=>be(e.format,h,t.format),[e.format,h,t.format]),k=(0,K.useCallback)(_=>Ze(_,{locale:h}),[h]),y=(0,K.useMemo)(()=>Qe(p,e.unit),[p,e.unit]),w=(0,K.useMemo)(()=>ct(e.data),[e.data]),[$,v]=(0,K.useState)(null),[g,N]=(0,K.useState)(null),P=(0,K.useRef)([]),D=(0,K.useRef)(e.onHover);D.current=e.onHover;let L=(0,K.useRef)(e.onClick);L.current=e.onClick;let E=(0,K.useRef)(null),A=(0,K.useRef)(null),T=(0,K.useRef)(null),C=(0,K.useCallback)((_,U="pointer")=>{if(T.current!==_){T.current=_;let Y=_===null?null:P.current[_]??null;queueMicrotask(()=>D.current?.(Y)),A.current?.(_)}E.current=_===null?null:U,v(_),N(E.current)},[]),b=(0,K.useCallback)(_=>{E.current!=="keyboard"&&(E.current=_===null?null:"sync",v(_),N(E.current))},[]),M=(0,K.useCallback)(_=>{let U=P.current[_];U&&L.current?.(U)},[]),R=Hn(e.replayKey),O=e.width!==void 0||(i??0)>0,z={enabled:u,active:d.visible&&O,near:d.near,replayKey:R,dataKey:w,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},J=(0,K.useCallback)((_,U=1)=>$===null||$===_?U:U*.38,[$]);return{p:n,width:s,height:l,measured:O,responsive:e.width===void 0,pending:re&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:z,fv:y,fmt:p,pct:k,locale:h,lang:f,t:f==="ko"?bn:pn,active:$,via:g,setActive:C,click:M,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:J,sig:w,description:e.description,reduced:m,publish:A,applySync:b}}var W=F(j(),1);function ti(e){return 1-Math.pow(1-e,3)}function ni(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function ri(e){return e==="easeInOut"?ni:e==="linear"?t=>t:ti}function oi(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function _e(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),i=Math.floor(o),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function ht(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function Er(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function _r(e,t,n,r){if(!t||!n||t.length!==n.length)return _e(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let c of _e(s,n[a]))o.push(c)}return o.length===r?o:_e(e,r)}var gt=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!ht(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let i=t.from??t.to,a=t.enter??i;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:i.slice(),enter:a.slice(),exit:(t.exit??a).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),i=this.make(r,r.to,0,0);o&&(i.order=o.order),i.done=!0,i.progress=1,n.set(r.key,i)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let i=this.tracks.get(o.key),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Er(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=ht(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,i=0;for(let a of t){o.add(a.key);let s=this.tracks.get(a.key),c=r>0?Math.min(i*r,240):0;if(s){let l=a.to.length;s.from=_r(s.cur,s.parts,a.parts,l),s.vel=_r(s.curVel,s.parts,a.parts,l),s.parts=a.parts,s.to=a.to.slice(),Er(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=ht(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let l=this.make(a,a.enter??a.from??a.to,n+c,0);l.done=ht(l.from,l.to),this.tracks.set(a.key,l)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=_e(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=ri(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=_e(s.from,l)),s.vel.length!==l&&(s.vel=_e(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let m;if(this.easing==="spring"){let u=Math.exp(-i*c),d=i*c>=8&&i*c<20,h=0;for(let f=0;f<l;f++){let p=s.from[f]-s.to[f],k=s.vel[f]+i*p;s.cur[f]=s.to[f]+(p+k*c)*u,s.curVel[f]=(s.vel[f]-i*k*c)*u,d&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}m=i*c>=20||d&&h<.15,s.progress=Math.min(1,1-(1+i*c)*u)}else{let u=Math.min(1,c/o),d=r(u),h=oi(this.easing,u)/o;for(let f=0;f<l;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*h;m=u>=1,s.progress=d}if(m){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&a.push(s.key)}else n=!0}for(let s of a)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},We=new Set,pt=0;function Ir(e){pt=0;let t=Array.from(We);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||We.delete(n)}We.size&&typeof requestAnimationFrame<"u"&&(pt=requestAnimationFrame(Ir))}function Or(e){return We.add(e),!pt&&typeof requestAnimationFrame<"u"&&(pt=requestAnimationFrame(Ir)),()=>{We.delete(e)}}function ai(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function Br(e,t){let n=(0,W.useMemo)(()=>ai(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:c="spring",duration:l=900,stagger:m=0}=t,u=(0,W.useRef)(null),d=(0,W.useRef)("init"),h=(0,W.useRef)(null),f=(0,W.useRef)(s),p=(0,W.useRef)(a),k=(0,W.useRef)(!1),y=(0,W.useRef)(0),[,w]=(0,W.useState)(0),$=(0,W.useRef)(null),v=(0,W.useRef)(!0);u.current||(u.current=new gt,u.current.configure(c,l),u.current.snap(n),h.current=n);let g=u.current;if(g.configure(c,l),h.current!==n){let A=d.current,T=!Object.is(f.current,s);g.sameTargets(n)?g.refreshData(n):!r||A==="init"?g.snap(n):A==="idle"?g.hold(n):A==="running"||T?g.update(n,Ye(),m):g.snap(n),h.current=n,f.current=s}let N=(0,W.useRef)(()=>!1);N.current=A=>{if(!v.current)return!1;let T=g.step(A);return!T&&d.current==="running"&&(d.current="done"),w(C=>(C+1)%1e9),T||($.current=null),T};let P=(0,W.useCallback)(()=>{if(!re||$.current||!g.animating)return;let A=T=>N.current(T);$.current=Or(A)},[g]);se(()=>{let A=!Object.is(p.current,a);if(p.current=a,!r){(d.current!=="done"||g.animating)&&(g.snap(h.current??n),d.current="done",w(T=>T+1));return}d.current==="init"||A&&i?(g.hold(h.current??n),d.current="idle",k.current=!1,w(T=>T+1)):A&&(k.current=!0)},[r,a]),se(()=>{!r||!i||!k.current||(k.current=!1,g.hold(h.current??n),d.current="idle",w(A=>A+1))},[i,r]),(0,W.useEffect)(()=>{r&&o&&d.current==="idle"&&(g.start(Ye()),y.current+=1,d.current="running",P(),w(A=>A+1))},[r,o,a,g,P]),(0,W.useEffect)(()=>{g.animating&&P()}),(0,W.useEffect)(()=>(v.current=!0,()=>{v.current=!1,$.current?.(),$.current=null}),[]);let D=Ye(),L=g.elapsed(D),E=r&&d.current==="idle";return{items:g.items(),get:A=>g.get(A),elapsed:E?0:L,fade:(A,T=320)=>E?0:Number.isFinite(L)?Math.max(0,Math.min(1,(L-A)/T)):1,waiting:E,animating:g.animating,generation:y.current}}var Jt=F(I(),1);function Hr(e,t,n,r,o){if(r)return o==="categorical"?le(e,t,n):Tn(e,t,n);if(o==="categorical")return le(e,t,n);let i=G(e,"strong"),a=G(e,"accent");return Array.from({length:t},(s,c)=>n.has(c)?a:i)}var ii=F(j(),1);var Zt=F(I(),1);var jr=e=>e?"neutralStrong":"accent";var Qt=F(I(),1);function Vr(e,t,n,r){if(typeof e!="function")return ge(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let c=o.get(r(a,s));c!==void 0&&e(a,s)&&i.add(c)}),i}var si=F(j(),1);var tn=F(I(),1),li={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${$e(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Wr={en:li,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},en=["ink","muted","dim"];function Gr(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,en.length)}var ci=F(j(),1);var qr=F(I(),1),ui={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${$e(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},mi={en:ui,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Kr=(e,t)=>mi[e].other(t);function Ur(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((i,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,or(o.map(i=>i.value)))}}var Xr=e=>Number.isFinite(e)&&e>0?e:0;function Yr(e,t,n,r){return r==="emphasis"?Mn(e,t,n):le(e,t,n)}var bt=F(j(),1);var H=F(I(),1),di={radial:"Radial bar chart",gauge:"Gauge",vsTarget:"vs. target",current:"Current",target:"Target",targetWord:"target",achieved:"Achieved",range:"Range",rangeWord:"range",span:(e,t)=>`${e} to ${t}`},fi={en:di,ko:{radial:"방사형 막대",gauge:"게이지",vsTarget:"목표 대비",current:"현재",target:"목표",targetWord:"목표",achieved:"달성률",range:"범위",rangeWord:"범위",span:(e,t)=>`${e}~${t}`}};function hi(e){let{cx:t,cy:n,r,len:o,start:i,span:a,lit:s,on:c,off:l}=e,m=Math.max(2,Math.round(e.count??Math.max(24,Math.min(64,(r-o/2)*a/8)))),u=(0,bt.useMemo)(()=>{let d=(r-o/2)*a/(m-1),h=Math.max(1.6,Math.min(3.4,d*.42));return Array.from({length:m},(f,p)=>{let k=i+a*(p/(m-1)),[y,w]=ee(t,n,r-o,k),[$,v]=ee(t,n,r-1,k),g=N=>(0,H.jsx)("line",{x1:y,y1:w,x2:$,y2:v,stroke:N,strokeWidth:h,strokeLinecap:"round"},p);return{on:g(c),off:g(l)}})},[t,n,r,o,i,a,m,c,l]);return(0,H.jsx)("g",{"aria-hidden":"true",children:u.map((d,h)=>s>.002&&h/(m-1)<=s+1e-6?d.on:d.off)})}function nn(e){let t=(0,bt.useMemo)(()=>e.data??[{value:e.value??0,target:e.target}],[e.data,e.value,e.target]),n=e.variant??"arc",r=Lr({...e,data:t},{height:z=>n==="semi"?Math.max(150,Math.min(210,z*.5)):Math.max(180,Math.min(240,z*.6)),duration:1100,format:"integer"}),{p:o,width:i,height:a}=r,s=ye(e.valueKey,"value"),c=ye(e.targetKey,"target"),l=e.value??(t[0]?s(t[0],0):0),m=e.target??(t[0]?c(t[0],0):NaN),u=e.min??0,d=e.max??100,h=Math.max(0,Math.min(1,(l-u)/(d-u||1))),f=Number.isFinite(m)?Math.max(0,Math.min(1,(m-u)/(d-u||1))):NaN,k=(n==="ring"?360:n==="semi"?180:240)/360*Pe,y=n==="ring"?0:-k/2,w=n==="semi"?Math.max(30,Math.min(a-26,i/2-10)):Math.max(30,Math.min(a/2-6,i/2-10)),$=i/2,v=n==="semi"?a-18:n==="ring"?a/2:a/2+w*.12,g=Math.max(8,Math.min(n==="ring"?16:20,w*.17)),N=(0,bt.useMemo)(()=>[{key:"v",to:[h,l],from:[0,u],enter:[0,u],data:null}],[h,l,u]),P=Br(N,r.motion),D=P.get("v")??[h,l],L=G(o,"accent"),E=e.bands?.filter(z=>z>u&&z<d)??[],A=fi[r.lang],T=e.label??r.t.value,C=A.span(r.fmt(u),r.fmt(d)),b=e.value===void 0&&!t.length?[]:[{datum:t[0]??null,index:0,key:"value",label:T,value:l,formatted:`${r.fv(l)}${Number.isFinite(m)?` / ${A.targetWord} ${r.fv(m)}`:""}`}],M=r.active===0?{x:$,y:v-w,title:T,rows:[{label:A.current,value:r.fv(l),color:L.fill},...Number.isFinite(m)?[{label:A.target,value:r.fv(m)},...m?[{label:A.achieved,value:r.pct(l/m*100)}]:[]]:[],{label:A.range,value:C}]}:null,R=Math.max(18,Math.min(42,w*.42)),O=e.description??`${A.gauge}. ${T} ${r.fv(l)}, ${A.rangeWord} ${C}${Number.isFinite(m)?`, ${A.targetWord} ${r.fv(m)}`:""}.`;return(0,H.jsxs)(Vn,{c:r,kind:A.gauge,ariaLabel:e.ariaLabel,description:O,events:b,tip:M,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,H.jsxs)("g",{onPointerEnter:z=>r.setActive(0,z.pointerType==="touch"?"touch":"pointer"),children:[n==="ticks"?(0,H.jsx)(hi,{cx:$,cy:v,r:w,len:g*1.3,start:y,span:k,count:e.ticks,lit:D[0],on:L.fill,off:o.paint("neutralSoft")}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("path",{d:jt($,v,w-g/2,y,y+k),fill:"none",stroke:o.paint("neutralSoft"),strokeWidth:g,strokeLinecap:n==="ring"?"butt":"round"}),E.map((z,J)=>{let _=(z-u)/(d-u),[U,Y]=ee($,v,w-g-3,y+k*_),[ue,Ke]=ee($,v,w+2,y+k*_);return(0,H.jsx)("line",{x1:U,y1:Y,x2:ue,y2:Ke,stroke:o.paint("panel"),strokeWidth:2},J)}),D[0]>.002?(0,H.jsx)("path",{d:jt($,v,w-g/2,y,y+k*D[0]),fill:"none",stroke:L.fill,strokeWidth:g,strokeLinecap:"round"}):null]}),Number.isFinite(f)?(()=>{let[z,J]=ee($,v,w-g-4,y+k*f),[_,U]=ee($,v,w+4,y+k*f);return(0,H.jsx)("line",{x1:z,y1:J,x2:_,y2:U,stroke:o.paint("ink"),strokeWidth:2.5,strokeLinecap:"round",opacity:P.fade(500,300)})})():null]}),(0,H.jsx)(Se,{x:$,y:n==="semi"?v-R*.55:v-(e.label?R*.18:0),anchor:"middle",size:R,weight:800,fill:o.paint("ink"),letterSpacing:-1,children:r.fv(D[1])}),e.label?(0,H.jsx)(Se,{x:$,y:n==="semi"?v-6:v+R*.5,anchor:"middle",size:11.5,fill:o.paint("muted"),children:Vt(e.label,w*1.5,11.5)}):null,n!=="ring"?(0,H.jsx)("g",{"aria-hidden":"true",children:(()=>{let[z,J]=ee($,v,w-g/2,y),[_,U]=ee($,v,w-g/2,y+k),Y=n==="semi"?12:g/2+10;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Se,{x:z,y:J+Y,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(u)}),(0,H.jsx)(Se,{x:_,y:U+Y,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(d)})]})})()}):null,Number.isFinite(m)&&r.showLabels&&n!=="ring"?(()=>{let[z,J]=ee($,v,w+14,y+k*f),_=Math.sin(y+k*f);return(0,H.jsx)(Se,{x:z,y:J,anchor:_>.2?"start":_<-.2?"end":"middle",size:10.5,weight:700,fill:o.paint("ink"),opacity:P.fade(600,300),children:`${A.target} ${r.fmt(m)}`})})():null]})}var gi=F(j(),1);var eo=F(I(),1);function Jr(e,t){return t===!1?e.map((n,r)=>r):rr(e)}function Zr(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ge(e,t,t,r,"max")}function Qr(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=G(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?G(e,"neutral"):Je(e,1-a/Math.max(1,o.length-1))),r}var de=F(I(),1);function to(e,t){let n=lt(e);return n?.type==="scatter"&&t?.size!==void 0?lt("bubble"):n}function pi(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function bi(e,t,n,r=!1){let o=to(e.type,e.encoding);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,c=new Set(!r&&Ot.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),l=u=>u.filter(d=>!c.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let u=xe(i.label,"label"),d=ye(i.value,"value"),h=o.type==="waffle",f=t.map((v,g)=>({r:v,label:u(v,g),value:h?d(v,g):Xr(d(v,g))})),{kept:p,other:k}=h?{kept:f,other:null}:Ur(f,a.other,(v,g)=>({r:{},label:Kr(V(n),v),value:g})),y=ge(s,p.map(v=>v.r),p.map(v=>v.label),p.map(v=>v.value),h?"first":"max"),w=k?[...p,k]:p,$=Oe(v=>h?le(v,w.length,y):Yr(v,w.length,y,a.colorMode));return w.map((v,g)=>({label:v.label,color:$[g]}))}if(o.type==="candlestick"){let u=Gr(Array.isArray(a.ma)?a.ma:void 0,t.length),d=Wr[V(n)];return[{label:d.up,color:a.upColor??"accent"},{label:d.down,color:a.downColor??"neutralStrong"},...u.map((h,f)=>({label:d.maLegend(h),color:en[f],shape:"line"}))]}if(o.type==="scatter"){if(typeof i.series!="string")return[];let u=xe(i.series,"series"),d=Ne(t.map((p,k)=>u(p,k)));if(d.length<2)return[];let h=Vr(s,t,d,u),f=Oe(p=>Cn(p,d.length,h));return l(d.map((p,k)=>({label:p,color:f[k],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(i.y))u=i.y;else if(typeof i.series=="string"){let $=xe(i.series,"series");u=Ne(t.map((v,g)=>$(v,g)))}let d=Bt(o.type,i,a);if(d.length){let $=ge(s,u,u,u.map(()=>0),"none"),v=Oe(N=>le(N,u.length,$)),g=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((N,P)=>({label:N,color:v[P]}));return[...l(g),...d.map((N,P)=>({label:N,color:jr(P),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?nr(u.length,Array.isArray(a.negative)?a.negative.map($=>u.indexOf(String($))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,p=f>=0?new Set([f]):ge(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return l(u.map(($,v)=>({label:$,color:p.has(v)?"accent":"neutralStrong",shape:"square"})));let k=a.colorMode,y=$=>le($,u.length,p);if((o.type==="line"||o.type==="area")&&(y=$=>Hr($,u.length,p,o.type==="area",k)),o.type==="stream"){let $=He(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),v=Jr($.values,a.reorder),g=Zr(s,$.series,$.values);y=N=>Qr(N,v,g)}let w=Oe(y);return l(u.map(($,v)=>({label:$,color:w[v],...o.type==="line"&&{shape:"line"}})))}return[]}function yi(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Xn.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function xi(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:c,description:l,...m}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:m,width:o,height:i,highlight:a,syncId:s,title:c,description:l}}function no(e,t){let{spec:n}=e,r=to(n.type,n.encoding),o=(0,Ge.useMemo)(()=>Dr(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Un(n,e.locale),s=Z(a),c=V(s),l=Cr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=Jn(n),u=(0,Ge.useMemo)(()=>m?Rr(m,s):void 0,[m,s]),d=n.options?.hidden,h=Array.isArray(d)?d.map(String):[],f=h.join(""),[p,k]=(0,Ge.useState)(null);if(!r)return(0,de.jsx)(It,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let y=o??l.data,w=t[r.type],$={...n.options??{}},v={...pi(r,n.encoding),...$,...u?{tooltip:u}:{},data:y,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:a},g=n.card?.legend==="toggle"&&qn(r.type,n.encoding??{},$),N=p&&p.base===f?p.hidden:h;g&&(v.hidden=N);let P=T=>k(C=>{let b=C&&C.base===f?C.hidden:h;return{base:f,hidden:b.includes(T)?b.filter(M=>M!==T):[...b,T]}}),D=v.height??220,L=yi(n,r.type),E=i&&!y.length&&(l.loading||l.error||l.empty)?(0,de.jsx)(It,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:D,locale:a}):L?(0,de.jsx)($r,{chart:w,...xi(r.type,L,v)}):(0,de.jsx)(w,{...v});if(n.card){let T=n.card,C=T.legend==="auto"||T.legend==="toggle"?bi(n,y,s,g):T.legend,b=C?.length?g?(0,de.jsx)(_t,{items:C,hidden:N,onToggle:P,locale:a}):C:void 0,M=T.download?(0,de.jsx)(Nr,{data:y,columns:Zn(n),filename:T.title??r.type,formats:Array.isArray(T.download)?T.download:void 0,locale:a}):void 0;E=(0,de.jsx)(jn,{number:T.number,title:T.title??Kn(r,c),subtitle:T.subtitle,legend:b,actions:M,source:T.source||void 0,note:T.note||void 0,accent:T.accent,takeaway:T.takeaway,level:T.level,sample:T.sample,replay:T.replay!==!1,className:e.className,locale:a,children:E})}let A=e.theme??n.theme;return A&&(E=(0,de.jsx)(rt,{theme:A,children:E})),E}function ki({cfg:e,components:t}){let n=Le();return no({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function oo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ro.hydrateRoot)(r,(0,rn.createElement)(rt,{theme:o.theme,cssVars:!0},(0,rn.createElement)(ki,{cfg:o,components:{[e]:t}})))}oo("gauge",nn);})();