ztd-charts-cli 0.7.0 → 0.8.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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/api.d.ts +11 -1
  3. package/dist/api.js +5 -1
  4. package/dist/{chunk-4WXNLD5P.js → chunk-FB5WHEJX.js} +38 -15
  5. package/dist/cli.js +5 -4
  6. package/dist/client/NOTICE.md +39 -0
  7. package/dist/client/area.js +10 -10
  8. package/dist/client/bar.js +10 -10
  9. package/dist/client/barRace.js +28 -0
  10. package/dist/client/beeswarm.js +10 -10
  11. package/dist/client/box.js +10 -10
  12. package/dist/client/bubble.js +10 -10
  13. package/dist/client/bullet.js +9 -9
  14. package/dist/client/bump.js +10 -10
  15. package/dist/client/calendar.js +9 -9
  16. package/dist/client/candlestick.js +9 -9
  17. package/dist/client/chord.js +10 -10
  18. package/dist/client/choropleth.js +28 -0
  19. package/dist/client/donut.js +10 -10
  20. package/dist/client/dumbbell.js +9 -9
  21. package/dist/client/flowMap.js +28 -0
  22. package/dist/client/funnel.js +10 -10
  23. package/dist/client/gauge.js +10 -10
  24. package/dist/client/geo-kr-sido.js +1 -0
  25. package/dist/client/geo-us-states.js +1 -0
  26. package/dist/client/geo-world.js +1 -0
  27. package/dist/client/heatmap.js +9 -9
  28. package/dist/client/histogram.js +6 -6
  29. package/dist/client/line.js +10 -10
  30. package/dist/client/lollipop.js +10 -10
  31. package/dist/client/marimekko.js +6 -6
  32. package/dist/client/network.js +28 -0
  33. package/dist/client/parallel.js +9 -9
  34. package/dist/client/pareto.js +10 -10
  35. package/dist/client/pie.js +10 -10
  36. package/dist/client/radar.js +10 -10
  37. package/dist/client/radialBar.js +10 -10
  38. package/dist/client/ridgeline.js +10 -10
  39. package/dist/client/sankey.js +10 -10
  40. package/dist/client/scatter.js +10 -10
  41. package/dist/client/segmented.js +9 -9
  42. package/dist/client/skyline.js +10 -10
  43. package/dist/client/slope.js +10 -10
  44. package/dist/client/sparkline.js +10 -10
  45. package/dist/client/stream.js +10 -10
  46. package/dist/client/sunburst.js +9 -9
  47. package/dist/client/symbolMap.js +28 -0
  48. package/dist/client/tileMap.js +10 -10
  49. package/dist/client/timeline.js +28 -0
  50. package/dist/client/tree.js +28 -0
  51. package/dist/client/treemap.js +9 -9
  52. package/dist/client/waffle.js +9 -9
  53. package/dist/client/waterfall.js +10 -10
  54. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- (()=>{var lo=Object.create;var an=Object.defineProperty;var co=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var mo=Object.getPrototypeOf,fo=Object.prototype.hasOwnProperty;var yt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ho=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of uo(t))!fo.call(e,o)&&o!==n&&an(e,o,{get:()=>t[o],enumerable:!(r=co(t,o))||r.enumerable});return e};var N=(e,t,n)=>(n=e!=null?lo(mo(e)):{},ho(t||!e||!e.__esModule?an(n,"default",{value:e,enumerable:!0}):n,e));var H=yt((Ci,sn)=>{sn.exports=globalThis.__ztdReact.react});var cn=yt((Ti,ln)=>{ln.exports=globalThis.__ztdReact["react-dom/client"]});var _=yt((zi,Bn)=>{Bn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var nn=N(H(),1),io=N(cn(),1);var Ke=N(H(),1);var at=N(H(),1);var un=N(H(),1),Ce=(0,un.createContext)(void 0);var hn=N(H(),1);var go=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],mn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',dn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',be={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:mn,monoFamily:dn,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:mn,monoFamily:dn,radius:18,radiusCode:14,radiusMark:4},kt={dark:be,light:xt};function Ue(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function wt(e){let t={};for(let n of go){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 vt(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 po=`
1
+ (()=>{var yo=Object.create;var un=Object.defineProperty;var xo=Object.getOwnPropertyDescriptor;var ko=Object.getOwnPropertyNames;var wo=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty;var wt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var $o=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ko(t))!vo.call(e,o)&&o!==n&&un(e,o,{get:()=>t[o],enumerable:!(r=xo(t,o))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?yo(wo(e)):{},$o(t||!e||!e.__esModule?un(n,"default",{value:e,enumerable:!0}):n,e));var H=wt((ja,mn)=>{mn.exports=globalThis.__ztdReact.react});var fn=wt((Ga,dn)=>{dn.exports=globalThis.__ztdReact["react-dom/client"]});var L=wt((rs,jn)=>{jn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var sn=A(H(),1),po=A(fn(),1);var Ue=A(H(),1);var at=A(H(),1);var hn=A(H(),1),Se=(0,hn.createContext)(void 0);var yn=A(H(),1);var Mo=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],gn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',pn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ye={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:gn,monoFamily:pn,radius:18,radiusCode:14,radiusMark:4},vt={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:gn,monoFamily:pn,radius:18,radiusCode:14,radiusMark:4},$t={dark:ye,light:vt};function Xe(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Mt(e){let t={};for(let n of Mo){let r=e[n];typeof r=="string"&&(t[Xe(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 Tt(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 To=`
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,${be.accent});outline-offset:3px;border-radius:6px}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ye.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,${be.accent});outline-offset:2px}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ye.accent});outline-offset:2px}
13
13
  .ztd-card{transition:border-color .16s ease}
14
- .ztd-card:hover{border-color:var(--ztd-dim,${be.dim})}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${ye.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
- `;function gn(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 pn(e,t){let[n]=(0,hn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var fn=!1;function _e(){if(fn||typeof document>"u"||(fn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=po,document.head.appendChild(e)}var Xe=N(H(),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 j(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function de(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var bn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},yn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var bo=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],yo={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function xo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function ko(e){return xo(bo,e)}function xn(e,t){let n=ko(e);return{text:n?n[t]:e,...yo[n?.id??"basic"]}}var kn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Te(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),kn[t.toLowerCase()]&&(t=kn[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 $n(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 Mt(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 Se(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wn(e){return .2126*Se(e[0])+.7152*Se(e[1])+.0722*Se(e[2])}function Ct(e,t,n){let r=typeof e=="string"?Te(e):e,o=typeof t=="string"?Te(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Te(n):n:null;o[3]<1&&i&&(o=Mt(o,i));let a=r[3]<1?Mt(r,o):r,s=wn(a),l=wn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function wo(e){return[Se(e[0]),Se(e[1]),Se(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]=wo(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 vo([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=Te(e),o=Te(t);if(!r||!o)return e;let i=vn(r),a=vn(o),s=Math.max(0,Math.min(1,n));return $n(vo([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=Ct(i,e,n);a>o&&(o=a,r=i)}return r}function W(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 $o(e,t){let n=Tt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ct(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:$o(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]=W(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=W(e,"neutral");else if(s===0)r[a]=W(e,"ink");else if(s===i-1)r[a]=W(e,"neutral");else if(i===3)r[a]=W(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?W(e,"strong"):Je(e,1-l)}}),r}var St="mix:";function Ie(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 Mn(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 Tn(e,t,n,r="neutral"){let o=W(e,"accent"),i=W(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Sn(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=W(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=W(e,"neutral"):s===0?r[a]=W(e,"strong"):s===i-1?r[a]=W(e,"neutral"):r[a]=Je(e,1-s/(i-1))}),r}var oe=N(H(),1);var Qe=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),X="en-US",An=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=An.get(r);return o||(o=new Intl.NumberFormat(e,n),An.set(r,o)),o}function Ft(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ae(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;return Ft(At(n,r).format(e))}var Nt=e=>e!==0&&Math.abs(e)<.05,Rt=(e,t,n="")=>`${Ae(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??X,"%");let n=Math.abs(e);return`${Ae(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Pn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;if(j(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,l]=i[a],c=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**m)/10**m;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+Ae(u,{locale:n,...r,maximumFractionDigits:m})+l}}return Ft(At(n,{notation:"compact",...r}).format(e))}var Mo=(e,t=j(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function ve(e,t=X,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=At(t,o);return l=>Number.isFinite(l)?`${a}${Ft(s.format(l))}${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=>Pn(o,{locale:t});case"currency":return r(Mo(t));default:{let o=r({maximumFractionDigits:1});return i=>Nt(i)?Rt(i,t):o(i)}}}function Dn(e,t=X,n=0){return e!==void 0?ve(e,t):n>=1e5?r=>Nt(r)?Rt(r,t):Pn(r,{locale:t}):r=>Ae(r,{locale:t})}function Co(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,To=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,So=["january","february","march","april","may","june","july","august","september","october","november","december"],Fn=e=>{let t=e.toLowerCase();return t.length<3?0:So.findIndex(n=>n.startsWith(t))+1},Nn=e=>+e+(+e<30?2e3:1900);function Ln(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Ao=[/^(\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})일)?$/],En=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,_n=/\{([^{}]+)\}/g;function et(e,t){let n;for(let r of Ao)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?[Nn(n[3]),+n[2],+n[1],1]:[Nn(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=En.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=Fn(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=Fn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var In=e=>To.test(e)||et(e)!==null;function On(e){let t;for(let n of e){let r=typeof n=="string"?En.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 Co(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 Rn=new Map;function Oe(e,t={month:"short",day:"numeric"}){let n=tt(e);if(!n)return"-";let{locale:r=X,...o}=t,i=r+JSON.stringify(o),a=Rn.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Rn.set(i,a)),a.format(n)}var Dt=N(_(),1),nt=(0,oe.createContext)({theme:be,cssVars:!0});function Fo(e,t=be){return e?typeof e=="string"?kt[e]??t:vt(t,e):t}function rt(e){let t=(0,oe.useContext)(nt),n=e.base?kt[e.base]:t.theme,r=(0,oe.useMemo)(()=>Fo(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)(()=>wt(r),[r]),l=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:l,children:e.children})})}var No=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function zn(e){return No.has(e)}function Ro(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?zn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?zn(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=vt(t.theme,e);return Ro(n,t.cssVars)},[t.theme,t.cssVars,e])}function Z(e){let t=(0,oe.useContext)(nt);return e??t.locale??X}function Hn(e){return e?wt(e):{}}var ot=N(H(),1),Lt=(0,ot.createContext)(void 0);function jn(e){let t=(0,ot.useContext)(Lt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var F=N(_(),1),Po={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`},Do={en:Po,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Lo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Et=e=>Do[j(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),l=e.items.filter(m=>!s.has(m.label)).length,c=(0,F.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 f=!s.has(m.label),h=f&&l===1,d=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Eo,{p:t,item:m,off:!f}),(0,F.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,F.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,F.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"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:d}):d},u)})});return a?(0,F.jsxs)(F.Fragment,{children:[c,(0,F.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Lo,children:r?n.shown(l,e.items.length):""})]}):c}function Eo({p:e,item:t,off:n}){let r=Mn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,F.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,F.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,F.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,F.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 _o(e){let t=ae(e.theme),n=xn(e.level,j(Z(e.locale)));return(0,F.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 Io(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,F.jsxs)(F.Fragment,{children:[e.slice(0,r),(0,F.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Vn(e){let t=ae(e.theme),n=Et(e.locale),[r,o]=(0,at.useState)(0);se(()=>_e(),[]);let i=()=>{o(f=>f+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,F.jsx)(_t,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,F.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,F.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,F.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,F.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,F.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,F.jsx)(_o,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,F.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,F.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,F.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:l}):null,(0,F.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:Io(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,F.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,F.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,F.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,F.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,F.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,F.jsx)("span",{}),a]}):null]}),(0,F.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,F.jsx)(Lt.Provider,{value:r,children:(0,F.jsx)(Ce.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,F.jsxs)(F.Fragment,{children:[m,u]}):u]})}function It(e){let t=ae(e.theme),n=Et(e.locale),r=e.height??220;if(se(()=>_e(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,F.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,F.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,F.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,F.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,F.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,F.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,F.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,F.jsx)(F.Fragment,{children:e.children})}var De=N(H(),1);var Q=N(H(),1);var z=N(_(),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 Wn(e){let{c:t,events:n}=e,r=(0,Q.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,se(()=>{_e()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,Q.useContext)(Ce),c=e.ariaLabel??l??e.kind,m=(0,Q.useMemo)(()=>s?`${n.length}${n.slice(0,it).map(p=>`${p.label}${p.series??""}${p.formatted??p.value??""}`).join("")}`:"",[n,s]),u=(0,Q.useMemo)(()=>(0,z.jsx)(Oo,{label:c,events:n,t:t.t}),[c,m,t.t]),f=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let p=()=>{f.current=null};return window.addEventListener("scroll",p,{capture:!0,passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{window.removeEventListener("scroll",p,{capture:!0}),window.removeEventListener("resize",p)}},[]),(0,Q.useEffect)(()=>{f.current=null},[t.width,t.height]);let h=p=>{if(p.target!==p.currentTarget)return;if(e.onKey?.(p)){p.preventDefault();return}let C=t.active,P;switch(p.key){case"ArrowRight":case"ArrowDown":P=C===null?0:(C+1)%a;break;case"ArrowLeft":case"ArrowUp":P=C===null?a-1:(C-1+a)%a;break;case"Home":P=0;break;case"End":P=a-1;break;case"Escape":if(C===null)return;P=null;break;case"Enter":case" ":C!==null&&(p.preventDefault(),t.click(C));return;default:return}p.preventDefault(),t.setActive(P,"keyboard")},{via:d,node:g,setActive:w}=t;(0,Q.useEffect)(()=>{if(d!=="touch"||!g)return;let p=C=>{g.contains(C.target)||w(null)};return document.addEventListener("pointerdown",p),()=>document.removeEventListener("pointerdown",p)},[d,g,w]);let x=t.active!==null?n[t.active]:null,T=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,S=T&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,M=typeof e.renderTip=="function"&&x?e.renderTip(x):null,b=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${a})`:""),R;if(T){let p=T.x*S,C=t.width*S,P=`clamp(${(4-p).toFixed(1)}px, -50%, calc(${(C-p-4).toFixed(1)}px - 100%))`,L=T.y<64;R={position:"absolute",left:p,top:T.y*S,transform:`translate(${P}, ${L?"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*S-8)}}let D=p=>{f.current=null,p.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=p=>p?C=>{let P=f.current??(f.current=C.currentTarget.getBoundingClientRect());P.width&&p((C.clientX-P.left)/P.width*t.width,(C.clientY-P.top)/P.height*t.height,C)}:void 0,I=E(e.onPointerMove),y=E(e.onPointerDown),A=I||y?p=>{p.pointerType==="touch"&&I?.(p),y?.(p)}:void 0,$=E(e.onPointerUp),v=Hn(e.theme);return(0,z.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":c,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:p=>{t.via==="keyboard"&&!p.currentTarget.contains(p.relatedTarget)&&t.setActive(null)},onPointerLeave:D,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"),...v,...e.style},children:[t.pending?null:e.underlay,(0,z.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:I,onPointerDown:A,onPointerUp:$,onPointerCancel:$,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,z.jsx)("title",{id:o,children:c}),(0,z.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,z.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,T?(0,z.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:R,children:M??(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:T.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:T.title}),T.rows.map((p,C)=>(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,z.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(p.strong?"ink":"muted")},children:[p.color?(0,z.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:p.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,p.label]}),(0,z.jsx)("span",{style:{fontWeight:p.strong===!1?500:700},children:p.value})]},C))]})}):null,(0,z.jsx)("span",{className:"ztd-sr",style:st,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function Oo({label:e,events:t,t:n}){return(0,z.jsx)("div",{className:"ztd-sr",style:st,children:(0,z.jsxs)("table",{children:[(0,z.jsx)("caption",{children:n.table(e)}),(0,z.jsxs)("tbody",{children:[t.slice(0,it).map((r,o)=>(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,z.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>it?(0,z.jsx)("tr",{children:(0,z.jsx)("td",{colSpan:2,children:n.more(t.length-it)})}):null]})]})})}function Ot(e){let t=e.baseline??"central";return(0,z.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 k=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ie=k("label","string",!0,"Item name field"),U=k("value","number",!0,"Value field"),Bo=[ie,U],zo=[ie,U],Ho=[k("label","string",!0,"Stage name"),k("value","number",!0,"Users at the stage")],jo=[ie,U],Vo=[k("label","string",!0,"Leaf (lowest level) name"),U,k("group","string",!1,"Parent group field")],Wo=[k("label","string",!0,"Leaf name"),U,k("group","string",!1,"Parent group field")],Go=[ie,k("value","number",!0,"Change (total rows may omit it)"),k("type","string",!1,'"total" makes a total bar')],Ko=[ie,U],Uo=[k("x","string",!0,"Column field"),k("series","string",!0,"Stacked series field"),U],Xo=[k("x","string",!0,"Column field"),k("y","string",!0,"Row field"),U],Yo=[k("axis","string",!0,"Metric (axis) field"),k("value","number",!0,"Value field",{multi:!0}),k("series","string",!1,"Series field")],qo=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("size","number",!1,"Circle size"),k("label","string",!1,"Name")],Kn=k("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Jo=[k("x","any",!0,"x field (date, number or category)"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables)"),k("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Kn],Zo=[k("x","any",!0,"x field"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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}),Kn],Qo=[k("x","any",!0,"x field"),k("y","number",!0,"y field",{multi:!0}),k("series","string",!1,"Series field")],ea=[k("x","string",!0,"Category field"),k("y","number",!0,"Value field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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})],ta=[ie,U],na=[k("value","number",!0,"Value field",{prop:"valueKey"}),k("target","number",!1,"Target field",{prop:"targetKey"})],ra=[ie,k("value","number",!0,"Actual value field"),k("target","number",!1,"Target field")],oa=[k("x","any",!1,"x field"),k("y","number",!0,"y field")],aa=[ie,k("x","string",!1,"Period field (long tables)"),k("value","number",!1,"Value field (long tables)")],ia=[ie,k("start","number",!0,"Before value"),k("end","number",!0,"After value")],sa=[ie,U],la=[k("value","number",!0,"Value field"),k("group","string",!1,"Group (row) field"),k("label","string",!1,"Dot name")],ca=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],ua=[k("source","string",!0,"Source node"),k("target","string",!0,"Target node"),U],ma=[k("source","string",!0,"Sending group"),k("target","string",!0,"Receiving group"),U],da=[k("date","date",!0,"Date field"),U],fa=[k("x","any",!0,"Period field"),k("series","string",!0,"Item field"),k("rank","number",!1,"Rank field (1 is first)"),k("value","number",!1,"Value field (instead of rank, largest is first)")],ha=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],ga=[k("label","string",!1,"Row name field")],pa=[k("x","date",!0,"Date (period) field"),k("open","number",!0,"Open price field"),k("high","number",!0,"High price field"),k("low","number",!0,"Low price field"),k("close","number",!0,"Close price field"),k("volume","number",!1,"Volume field")],ba=[ie,U],ya=[k("x","any",!0,"Period field (date or category)"),k("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables, back row only)"),k("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],xa=[k("value","number",!1,"Sample value field (raw rows)"),k("group","string",!1,"Group field. Up to 2 groups overlap"),k("x0","number",!1,"Bin start (pre-binned rows)"),k("x1","number",!1,"Bin end (pre-binned rows)"),k("count","number",!1,"Samples in the bin (pre-binned rows)")],ka=[k("region","string",!0,"Region name or code, matched to a tile of options.map"),U],wa=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("series","string",!1,"Series field (one color per series)"),k("label","string",!1,"Name")],Gn={pie:Bo,donut:zo,funnel:Ho,waffle:jo,treemap:Vo,sunburst:Wo,waterfall:Go,pareto:Ko,marimekko:Uo,heatmap:Xo,radar:Yo,bubble:qo,line:Jo,area:Zo,stream:Qo,bar:ea,radialBar:ta,gauge:na,bullet:ra,sparkline:oa,slope:aa,dumbbell:ia,lollipop:sa,beeswarm:la,ridgeline:ca,sankey:ua,chord:ma,calendar:da,bump:fa,box:ha,parallel:ga,candlestick:pa,segmented:ba,skyline:ya,histogram:xa,scatter:wa,tileMap:ka},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:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"}};function Un(e,t){return t==="ko"?e.nameKo:e.name}function Xn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Yn=["line","area","bar","scatter"],qn=24,Bt=["line","area","bar","scatter"];function zt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Jn(e,t,n){return Bt.includes(e)&&!zt(e,t,n).length}function Zn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var va={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=Gn[e]?e:va[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:Gn[t]}}function Qn(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 er(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function $a(e,t){if(e==null||typeof e!="object")return;let n=e;if(er(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!er(r,o))return;r=r[o]}return r}}function fe(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 Ne(e,t){if(typeof e=="function")return e;let n=e??t;return r=>$a(r,n)}function Re(e,t){let n=Ne(e,t);return(r,o)=>fe(n(r,o))}function he(e,t){let n=Ne(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 ye(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Ma(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
- `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,i=[","," ",";","|"],a=",",s=0;for(let l of i){let c=o(l);c>s&&(s=c,a=l)}return a}var Ca=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function tr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Ca.test(t)||/^[-+]?\.\d+$/.test(t)){let n=fe(t);if(Number.isFinite(n))return n}return t}function $e(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??Ma(o),a=[],s=[],l="",c=!1;for(let d=0;d<o.length;d++){let g=o[d];c?g==='"'?o[d+1]==='"'?(l+='"',d++):c=!1:l+=g:g==='"'&&!l.trim()?(c=!0,l=""):g===i?(s.push(l),l=""):g===`
24
- `||g==="\r"?(g==="\r"&&o[d+1]===`
25
- `&&d++,s.push(l),a.push(s),s=[],l=""):l+=g}(l!==""||s.length)&&(s.push(l),a.push(s));let m=a.filter(d=>!(d.length===1&&d[0].trim()===""));if(!m.length)return[];let u=d=>n?tr(d):d;if(!r)return m.map(d=>Object.fromEntries(d.map((g,w)=>[String(w),u(g)])));let f=[],h=new Set;return m[0].forEach((d,g)=>{let w=d.trim()||`col${g+1}`,x=w;for(let T=2;h.has(x);T++)x=`${w}_${T}`;h.add(x),f.push(x)}),m.slice(1).map(d=>Object.fromEntries(f.map((g,w)=>[g,u(d[w]??"")])))}function Ht(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,l)=>[s,r&&typeof a[l]=="string"?tr(a[l]):a[l]??null])))}function Ta(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,l)=>Object.fromEntries(i.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function nr(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 xe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return xe(JSON.parse(t))}catch{}return $e(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Ht(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)?xe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Ht(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)?xe(t.rows):Array.isArray(t.values)?Ht(t.values):Array.isArray(t.items)?xe(t.items):Array.isArray(t.results)?xe(t.results):Ta(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 jt(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=(l,c)=>{let m=e[l][c];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let m=0,u=0;for(let f=0;f<n;f++){let h=a(f,c),d=h-a(f,c-1),g=0;for(let w=0;w<f;w++)g+=a(w,c)-a(w,c-1);m+=h,u+=(d/2+g)*h}m&&(l-=u/m),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,f=0;for(let h=0;h<n;h++){let d=e[h][l],g=Number.isFinite(d)?d:0;g>=0?(o[h][l]=u,u+=g,i[h][l]=u):(o[h][l]=f,f+=g,i[h][l]=f)}continue}let c=0;for(let u=0;u<n;u++)c+=a(u,l);let m=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let f=a(u,l);t==="expand"&&(f=c?f/c*100:0),o[u][l]=m,m+=f,i[u][l]=m}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,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 f=0;f<r;f++)o[u][f]-=m,i[u][f]-=m}return{y0:o,y1:i}}function rr(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 or(e){let t=e.length,n=e.map(c=>{let m=0,u=-1/0;return c.forEach((f,h)=>{f>u&&(u=f,m=h)}),m}),r=e.map(c=>c.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,m)=>m).sort((c,m)=>n[c]-n[m]),i=[],a=[],s=0,l=0;for(let c of o)s<l?(i.push(c),s+=r[c]):(a.push(c),l+=r[c]);return[...a.reverse(),...i]}var Sa=Math.PI*2;function ar(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ir(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function Be(e,t){if(!e.length)return NaN;let n=(e.length-1)*t,r=Math.floor(n),o=n-r;return e[r+1]!==void 0?e[r]+o*(e[r+1]-e[r]):e[r]}function sr(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function cr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function lr(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 ge(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 l=0;l<r.length;l++){let c=r.charCodeAt(l);cr(c)?a+=lr(c):s+=lr(c)}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(),ge(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let l=i+a+1>>1;ge(e.slice(0,l)+o,n,r)<=t?i=l:a=l-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(cr(s.charCodeAt(0))?2:3)?"":s+o}var mr=N(_(),1),Aa=e=>Array.isArray(e)&&e.length===2;function ur(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Aa(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var fr=N(_(),1),ze=10.5;function Fa(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=>Ae(a,{locale:n,maximumFractionDigits:i}))}function dr(e,t,n){let r=18;for(let o of Fa(e,t,n))r=Math.max(r,ge(o,ze));return Math.ceil(r+8)}function Wt(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 ke(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,l=Wt(a,n),c=[o,i];for(let m=0;m<4;m++){let u=Math.ceil(i/l-1e-9)*l,f=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-f<=l*.3?f:o-a*s,i===0?0:u-i<=l*.3?u:i+a*s];let h=Wt(c[1]-c[0],n);if(h===l)break;l=h}return c}function hr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=Wt(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let l=s,c=0;l<=o+i*1e-9&&c<200;l+=i,c++)a.push(Number((Math.round(l/i)*i).toPrecision(12)));return a}function He(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(l=>o+(l-n)*a);return s.domain=e,s.range=t,s.invert=l=>a===0?n:n+(l-o)/a,s.ticks=(l=4)=>hr(n,r,l),s}function Gt(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]=ke(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function Na(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(c,m=1)=>{let u=[];for(let f=Math.floor(r);f<=Math.ceil(o);f++)if(!(f%m))for(let h of c){let d=Number((h*10**f).toPrecision(12));d>=e*(1-1e-9)&&d<=t*(1+1e-9)&&u.push(d)}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 l=a([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:hr(e,t,3)}function gr(e,t){let n=He([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=()=>Na(e[0],e[1],Math.abs(t[1]-t[0])),r}function Me(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 Ra=864e5;function pr(e,t,n,r=X){let o=t-e;if(!(o>0))return[{t:e,label:Oe(e,{locale:r,month:"short",day:"numeric"})}];let i=o/Ra,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(m,u,f,h=!1)=>{let d=new Date(m),g=-1,w=0;for(;d.getTime()<=t&&w++<500;){if(d.getTime()>=e){let x=d.getFullYear(),T=h&&!l&&x!==g;a.push({t:d.getTime(),label:Oe(d,{locale:r,...f,...T?{year:"numeric"}:{}})}),g=x}u(d)}};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,f=new Date(s);f.setMinutes(0,0,0),c(f,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(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),c(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))),f=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(f>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,d=>d.setFullYear(d.getFullYear()+f/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),d=h.getMonth()%f;d&&h.setMonth(h.getMonth()+(f-d)),c(h,g=>g.setMonth(g.getMonth()+f),{month:"short"},!0)}}return a}function br(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 l=o(a);return l>=0?(r[l]||(i[l]=t(l),r[l]=1),i[l]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var Pa=(e,t,n)=>e==="date"?tt(t,n)?.getTime()??NaN:fe(t);function Da(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&In(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function je(e,t,n,r,o={}){let i=Ne(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:Ne(n,"y"),c=!a&&r!==void 0?Ne(r,"series"):null,m=e.map((v,p)=>i(v,p)),u=o.xType??Da(m),f=o.locale??X,h,d,g;if(u==="band"){let v=m.map(C=>String(C??""));h=ye(v);let p=new Map(h.map((C,P)=>[C,P]));d=h.map((C,P)=>P),g=Int32Array.from(v,C=>p.get(C)??-1)}else{let v=u==="date"?o.dayFirst??On(m):void 0,p=m.map(L=>Pa(u,L,v)),C=Array.from(new Set(p.filter(L=>Number.isFinite(L)))).sort((L,K)=>L-K),P=new Map(C.map((L,K)=>[L,K]));d=C,h=C.map(String),g=Int32Array.from(p,L=>P.get(L)??-1)}let w=o.dateFormat,x=v=>typeof v=="string"?et(v.trim())?.[3]:void 0,T=u==="date"&&m.length<5e3?x(m[0]):void 0,S=(T===2||T===3)&&m.every(v=>x(v)===T),M=S&&T===3;if(u==="date"&&!w){let v=d.length>1?d[d.length-1]-d[0]:0;w=S&&T===2||v>864e5*120?{month:"short"}:v<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},v>864e5*800&&(w={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(M&&!o.dateFormat){let v=j(f)==="ko";b=d.map(p=>{let C=new Date(p),P=Math.floor(C.getMonth()/3)+1;return v?`${C.getFullYear()}년 ${P}분기`:`Q${P} ${C.getFullYear()}`})}else{let v=d.every(Pt),p=u==="date"?new Intl.DateTimeFormat(f,w):new Intl.NumberFormat(f,v?{useGrouping:!1}:{maximumFractionDigits:6});b=d.length>1e3?br(d.length,C=>p.format(d[C])):d.map(C=>p.format(C))}let R=s?[...s]:c?ye(e.map((v,p)=>String(c(v,p)??""))):[""],D=new Map(R.map((v,p)=>[v,p])),E=R.map(()=>new Array(h.length).fill(NaN)),I=R.map(()=>new Array(h.length).fill(null)),y=o.aggregate??"sum",A=y==="mean"?R.map(()=>new Uint32Array(h.length)):null,$=(v,p,C,P)=>{let L=E[v][p];y==="last"?E[v][p]=C:y==="count"?E[v][p]=(Number.isFinite(L)?L:0)+1:y==="mean"?Number.isFinite(C)&&(E[v][p]=(Number.isFinite(L)?L:0)+C,A[v][p]++):E[v][p]=Number.isFinite(L)?L+(Number.isFinite(C)?C:0):C,I[v][p]=P};for(let v=0;v<e.length;v++){let p=g[v];if(p<0)continue;let C=e[v];if(s)for(let P=0;P<s.length;P++)$(P,p,fe(C[s[P]]),C);else{let P=c?D.get(String(c(C,v)??""))??0:0;$(P,p,fe(l(C,v)),C)}}if(A)for(let v=0;v<E.length;v++)for(let p=0;p<h.length;p++)A[v][p]>1&&(E[v][p]/=A[v][p]);return{type:u,keys:h,xnum:d,labels:b,series:R,values:E,rows:I}}var La=140,We=12,yr=14,Kt=20,xr=12.5;function Ea(e,t,n=qn){let r=he(t,t),o=new Map;e.forEach((a,s)=>{let l=r(a,s),c=o.get(l);c?c.push(a):o.set(l,[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 _a(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+We)/(La+We))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ia(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*We)/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 Ve=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=Re(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return Ve(n)}function kr(e,t,n,r,o,i){return je(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function Oa(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let b=t.flat(),R=r.refLines??{},[D,E]=Me([...mt(b,r.x??"x"),...Ve([Number(R.x)])]),[I,y]=Me([...mt(b,r.y??"y"),...Ve([Number(R.y)])].filter($=>!s||$>0)),A=r.zero??!1;return{y:c??(s?Gt(I,y,a):ke(I,y,a,{zero:A,pad:.08})),x:r.xDomain??ke(D,E,Math.max(2,Math.round(o/110)),{zero:A,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",f=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===f),d=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),g=r.xDomain??(!m&&d?Me(n.flatMap(b=>Ve(b.xnum))):void 0),w=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(w==="percent")return{x:g,sameKeys:h};if(c)return{y:c,x:g,sameKeys:h};let x=[];t.forEach((b,R)=>{let D=n[R];if(w==="stacked"||w==="auto"&&D.series.length>1){let I=jt(D.values,"zero");I.y0.forEach(y=>x.push(...y)),I.y1.forEach(y=>x.push(...y))}else D.values.forEach(I=>x.push(...I));m&&!u&&r.line!==void 0&&kr(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(I=>x.push(...I)),m||x.push(...mt(b,r.lower),...mt(b,r.upper))}),m&&x.push(0),u||x.push(...ur(r.annotations));for(let b of r.referenceLines??[])x.push(b.y);r.signColors&&x.push(Number(r.baseline??0));let[T,S]=Me(Ve(x).filter(b=>!s||b>0));return{y:s?Gt(T,S,a):m?ke(T,S,u?Math.max(2,Math.round(o/120)):a):ke(T,S,a,{zero:r.zero??e==="area"}),x:g,sameKeys:h}}function Ba(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=je(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?gr:He)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=dr(c,Dn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),f=r.endLabels??n.some(b=>b.series.length>1),h=m+6,d=i-(f?Math.min(i*.28,Math.max(...u.map(b=>ge(b,11,700)),20)+14):10),g=l.keys.length,[w,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,T=l.type==="number"?g>12:g>pr(w,x,Math.max(2,Math.floor((d-h)/64)),s).length;if(l.type==="band"||!g||T)return;let S=b=>h+(l.xnum[b]-w)/(x-w)*(d-h),M=b=>ge(l.labels[b],ze);for(let b=1;;b++){let R=Array.from({length:Math.ceil(g/b)},(D,E)=>E*b);if(b>=g||R.every((D,E)=>!E||S(D)-S(R[E-1])>=(M(D)+M(R[E-1]))/2+8))return R.map(D=>({value:l.xnum[D],label:l.labels[D]}))}}function za(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 Ha(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${za(`${e}|${t}|${o}|${ct(r)}`)}`}function ja(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 Va={en:{intro:(e,t)=>`${de(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 wr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=Ea(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=_a(s,a,e.columns),{pw:c,ph:m}=Ia(s,l,e.height),u=e.scale!=="free",f=t==="scatter"?[]:o.map(A=>kr(t,A,n,n.y,n.series,n.aggregate)),h=u?Oa(t,o,f,n,c,m):{sameKeys:!1},d=u?Ba(t,o,f,n,h,c,m,e.locale):void 0,g=t==="bar"&&n.orientation==="horizontal",w=u&&(!g||h.sameKeys),x=u&&(g||h.x!==void 0||h.sameKeys),T=new Set(ja(e.highlight,r)?[e.highlight].flat():[]),S=T.size>0,M=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??Ha(t,e.by,n,e.data),R=Qe(ve(n.format,e.locale),n.unit),D=Va[e.lang],E=[],I=r.map(A=>A===""?D.blank:A);return{panels:r.map((A,$)=>{let v=o[$],p=I[$],C=$%l,P;if(t!=="scatter"){let K=f[$],me=ne=>K.values.reduce((O,J)=>O+(Number.isFinite(J[ne])?J[ne]:0),0),B=K.keys.map((ne,O)=>O).filter(ne=>K.values.some(O=>Number.isFinite(O[ne]))),q=B[B.length-1];E.push({first:B.length?me(B[0]):NaN,last:B.length?me(q):NaN,total:B.reduce((ne,O)=>ne+me(O),0)}),t!=="bar"&&K.series.length===1&&q!==void 0&&(P=R(K.values[0][q]))}else E.push({first:NaN,last:NaN,total:v.length});let L={data:v,width:c,height:m,ariaLabel:e.title?`${e.title}, ${p}`:p,syncId:b,highlight:S?T.has(A)?M?()=>!0:void 0:"none":e.highlight,showYAxis:!w||C===0,showXAxis:!x||$+l>=a};return h.y&&(L.yDomain=h.y),h.x&&(L.xDomain=h.x),d&&(L.xTicks=d),{value:A,label:p,props:L,last:P,isPicked:T.has(A)}}),cols:l,pw:c,ph:m,isPanelPick:S,description:Wa(t,e.by,I,E,i,R,D)}}function Wa(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=c=>sr(r.map(m=>m[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=a.endHigh(n[c],i(r[c].last)));let m=n.filter((u,f)=>r[f].last<r[f].first);s+=m.length?a.falling(`${m.slice(0,5).join(", ")}${m.length>5?a.more:""}`):a.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?a.total(n[c],i(r[c].total)):a.points(n[c],r[c].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var ee=N(H(),1);function Ga(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ka(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Mr(e,t=!0){let[n,r]=(0,ee.useState)({visible:!t,near:!t});return(0,ee.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=Ka(a[a.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Ga(.25),rootMargin:"0px 0px -8% 0px"}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(l=>l.near===s.isIntersecting?l:{...l,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 vr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function dt(e){let[t,n]=(0,ee.useState)(null),[r,o]=(0,ee.useState)(e??null),i=(0,ee.useCallback)(a=>{n(a),a&&e===void 0&&o(vr(a))},[e]);return se(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=c=>o(m=>m!==null&&Math.abs(m-c)<.5?m:c),s=()=>a(vr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let m=c[c.length-1]?.contentRect;m?a(m.width>0?Math.round(m.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var Ua=()=>()=>{};function Pe(){return(0,ee.useSyncExternalStore)(Ua,()=>!0,()=>!1)}var $r="(prefers-reduced-motion: reduce)";function ft(e="auto"){let[t,n]=(0,ee.useState)(()=>re&&typeof window.matchMedia=="function"?window.matchMedia($r).matches:!1);return(0,ee.useEffect)(()=>{if(e!=="auto"||!re||typeof window.matchMedia!="function")return;let r=window.matchMedia($r),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ce=N(_(),1),Xa=60,Ya=420;function Cr(e){let t=ae(),n=e.chartProps??{},[,r,o]=dt(e.width),i=e.width??(o||480),a=Z(e.locale??n.locale),s=j(a),l=(0,De.useContext)(Ce),c=e.title??l,m=(0,De.useMemo)(()=>wr({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:c,locale:a,lang:s}),[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(w,x)=>typeof x=="function"?String(x):x),e.highlight,e.syncId,i,e.height,c,a,s]),u=`${(0,De.useId)().replace(/:/g,"")}fd`,f=ft(n.reducedMotion??"auto"),h=Pe(),d=pn({motion:{enabled:n.animate!==!1&&!f&&re},hydrated:h},{waiting:!1,generation:0}),g=e.chart;return(0,ce.jsxs)("div",{ref:r,role:"group","aria-label":c,"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:We,rowGap:yr},children:m.panels.map((w,x)=>{let T=t.paint(w.isPicked?"accentText":m.isPanelPick?"muted":"ink");return(0,ce.jsxs)("div",{"data-facet":w.value,style:{minWidth:0,...gn(d,!1,"fade",x*Xa,Ya)},children:[(0,ce.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Kt,fontSize:xr,fontWeight:700,lineHeight:`${Kt}px`,color:T},children:[(0,ce.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.label}),w.last!==void 0?(0,ce.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:w.last}):null]}),(0,ce.jsx)(g,{...n,...w.props})]},w.value)})})]})}function ue(e,t,n,r,o="max"){let i=new Set,a=n.length,s=c=>{if(a&&c!=="none"){if(c==="first")i.add(0);else if(c==="last")i.add(a-1);else if(c==="max"||c==="min"){let m=-1,u=c==="max"?-1/0:1/0;r.forEach((f,h)=>{Number.isFinite(f)&&(c==="max"?f>u:f<u)&&(u=f,m=h)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((c,m)=>{m<a&&c!==null&&c!==void 0&&e(c,m)&&i.add(m)}),i;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<a&&i.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((m,u)=>{m===c&&i.add(u)});return i}var te=N(H(),1);async function qa(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(j(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return $e(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 $e(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):$e(i)}async function Ja(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 qa(i,t.parse,o,t.locale)}return t.select&&(r=nr(r,t.select)),t.transform?t.transform(r):xe(r)}function Tr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,te.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,te.useState)(0),c=Z(t.locale),m=(0,te.useRef)(t);m.current={...t,locale:c};let u=(0,te.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],d=JSON.stringify(h.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),g=(0,te.useRef)(!1);(0,te.useEffect)(()=>{let x=u.current;if(!x||!r){a(M=>M.status==="loading"?{...M,status:"idle"}:M);return}let T=new AbortController,S=!0;return g.current=!0,a(M=>({...M,data:o?M.data:[],status:"loading",error:null})),Ja(x,{...m.current,signal:T.signal}).then(M=>{S&&a({data:M,status:"success",error:null,updatedAt:Date.now()})}).catch(M=>{!S||T.signal.aborted||a(b=>({...b,status:"error",error:M instanceof Error?M:new Error(String(M))}))}).finally(()=>{S&&(g.current=!1)}),()=>{S=!1,g.current=!1,T.abort()}},[f,r,s,d,o]),(0,te.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{g.current||l(T=>T+1)},n);return()=>clearInterval(x)},[n,r]);let w=(0,te.useCallback)(()=>l(x=>x+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:w}}var Xt=N(_(),1),Za=["csv","svg","png"],Qa=/^[=+\-@\t\r\n=+-@]/,ei=/var\(|color-mix\(/;function Sr(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?Ln(e.getTime()):String(e);return`"${(Qa.test(t)&&!Number.isFinite(fe(t))?`'${t}`:t).replace(/"/g,'""')}"`}function ti(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function ni(e,t){return`\uFEFF${[t.map(Sr),...e.map(r=>t.map(o=>Sr(r[o])))].map(r=>r.join(",")).join(`\r
22
+ `;function xn(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 kn(e,t){let[n]=(0,yn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var bn=!1;function Oe(){if(bn||typeof document>"u"||(bn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=To,document.head.appendChild(e)}var Ye=A(H(),1),ae=typeof window<"u"&&typeof document<"u",de=ae?Ye.useLayoutEffect:Ye.useEffect;function qe(){return typeof performance<"u"?performance.now():Date.now()}function j(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function ge(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var wn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},vn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Co=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],So={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Ao(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function No(e){return Ao(Co,e)}function $n(e,t){let n=No(e);return{text:n?n[t]:e,...So[n?.id??"basic"]}}var Mn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ae(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Mn[t.toLowerCase()]&&(t=Mn[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 Sn(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 St(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 Ne(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tn(e){return .2126*Ne(e[0])+.7152*Ne(e[1])+.0722*Ne(e[2])}function At(e,t,n){let r=typeof e=="string"?Ae(e):e,o=typeof t=="string"?Ae(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ae(n):n:null;o[3]<1&&a&&(o=St(o,a));let i=r[3]<1?St(r,o):r,s=Tn(i),l=Tn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Fo(e){return[Ne(e[0]),Ne(e[1]),Ne(e[2])]}function Ct(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 Cn(e){let[t,n,r]=Fo(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 Ro([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[Ct(4.0767416621*o-3.3077115913*a+.2309699292*i),Ct(-1.2684380046*o+2.6097574011*a-.3413193965*i),Ct(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Je(e,t,n){let r=Ae(e),o=Ae(t);if(!r||!o)return e;let a=Cn(r),i=Cn(o),s=Math.max(0,Math.min(1,n));return Sn(Ro([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)))}function Nt(e,t,n){let r=t[0],o=-1;for(let a of t){let i=At(a,e,n);i>o&&(o=i,r=a)}return r}function W(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 _o(e,t){let n=Nt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return At(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Nt(t,["#FFFFFF","#000000"])}function Ze(e,t){let n=Je(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:_o(e,n),raw:n}}function se(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=W(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=W(e,"neutral");else if(s===0)r[i]=W(e,"ink");else if(s===a-1)r[i]=W(e,"neutral");else if(a===3)r[i]=W(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?W(e,"strong"):Ze(e,1-l)}}),r}var Ft="mix:";function xe(e){return e({theme:vt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Ft}${o}`}).map(n=>n.fill)}function An(e,t){return t?.startsWith(Ft)?e.mix("neutralStrong","neutral",Number(t.slice(Ft.length))):e.color(t)}function Ie(e,t,n){return se(e,t+1,n).slice(0,t)}function Nn(e,t,n,r="neutral"){let o=W(e,"accent"),a=W(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function Fn(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=W(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=W(e,"neutral"):s===0?r[i]=W(e,"strong"):s===a-1?r[i]=W(e,"neutral"):r[i]=Ze(e,1-s/(a-1))}),r}var le=A(H(),1);var et=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),X="en-US",Rn=new Map;function Rt(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=Rn.get(r);return o||(o=new Intl.NumberFormat(e,n),Rn.set(r,o)),o}function _t(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Fe(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;return _t(Rt(n,r).format(e))}var Pt=e=>e!==0&&Math.abs(e)<.05,Dt=(e,t,n="")=>`${Fe(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Qe(e,t={}){if(!Number.isFinite(e))return"-";if(Pt(e)&&t.maximumFractionDigits===void 0)return Dt(e,t.locale??X,"%");let n=Math.abs(e);return`${Fe(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Ln(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;if(j(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,l]=a[i],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Fe(u,{locale:n,...r,maximumFractionDigits:d})+l}}return _t(Rt(n,{notation:"compact",...r}).format(e))}var Po=(e,t=j(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function $e(e,t=X,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Rt(t,o);return l=>Number.isFinite(l)?`${i}${_t(s.format(l))}${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=>Qe(o,{locale:t});case"ratio":return o=>Qe(o*100,{locale:t});case"compact":return o=>Ln(o,{locale:t});case"currency":return r(Po(t));default:{let o=r({maximumFractionDigits:1});return a=>Pt(a)?Dt(a,t):o(a)}}}function En(e,t=X,n=0){return e!==void 0?$e(e,t):n>=1e5?r=>Pt(r)?Dt(r,t):Ln(r,{locale:t}):r=>Fe(r,{locale:t})}function Do(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Lt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Lo=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Eo=["january","february","march","april","may","june","july","august","september","october","november","december"],_n=e=>{let t=e.toLowerCase();return t.length<3?0:Eo.findIndex(n=>n.startsWith(t))+1},Pn=e=>+e+(+e<30?2e3:1900);function On(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Oo=[/^(\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})일)?$/],In=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,zn=/\{([^{}]+)\}/g;function tt(e,t){let n;for(let r of Oo)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?[Pn(n[3]),+n[2],+n[1],1]:[Pn(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=In.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=_n(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=_n(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Bn=e=>Lo.test(e)||tt(e)!==null;function Hn(e){let t;for(let n of e){let r=typeof n=="string"?In.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function nt(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(Lt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return nt(`${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=tt(n,t);if(r)return Do(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 Dn=new Map;function ze(e,t={month:"short",day:"numeric"}){let n=nt(e);if(!n)return"-";let{locale:r=X,...o}=t,a=r+JSON.stringify(o),i=Dn.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Dn.set(a,i)),i.format(n)}var Et=A(L(),1),rt=(0,le.createContext)({theme:ye,cssVars:!0});function Io(e,t=ye){return e?typeof e=="string"?$t[e]??t:Tt(t,e):t}function ot(e){let t=(0,le.useContext)(rt),n=e.base?$t[e.base]:t.theme,r=(0,le.useMemo)(()=>Io(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,le.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,le.useMemo)(()=>Mt(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Et.jsx)(rt.Provider,{value:i,children:(0,Et.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var zo=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Gn(e){return zo.has(e)}function Bo(e,t){let n=r=>t?`var(${Xe(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Gn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Gn(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)})`:Je(e[r],e[o],a)}}}function ce(e){let t=(0,le.useContext)(rt);return(0,le.useMemo)(()=>{let n=Tt(t.theme,e);return Bo(n,t.cssVars)},[t.theme,t.cssVars,e])}function Z(e){let t=(0,le.useContext)(rt);return e??t.locale??X}function Wn(e){return e?Mt(e):{}}var it=A(H(),1),Ot=(0,it.createContext)(void 0);function Vn(e){let t=(0,it.useContext)(Ot);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var N=A(L(),1),Ho={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`},jo={en:Ho,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Go={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},It=e=>jo[j(Z(e))];function zt(e){let t=ce(e.theme),n=It(e.locale),[r,o]=(0,at.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(0,N.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((d,u)=>{let f=!s.has(d.label),h=f&&l===1,m=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Wo,{p:t,item:d,off:!f}),(0,N.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,N.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,N.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":h||void 0,onClick:()=>{h||(i(d.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:m}):m},u)})});return i?(0,N.jsxs)(N.Fragment,{children:[c,(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Go,children:r?n.shown(l,e.items.length):""})]}):c}function Wo({p:e,item:t,off:n}){let r=An(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,N.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,N.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,N.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,N.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 Vo(e){let t=ce(e.theme),n=$n(e.level,j(Z(e.locale)));return(0,N.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 Ko(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,N.jsxs)(N.Fragment,{children:[e.slice(0,r),(0,N.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Kn(e){let t=ce(e.theme),n=It(e.locale),[r,o]=(0,at.useState)(0);de(()=>Oe(),[]);let a=()=>{o(f=>f+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,N.jsx)(zt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=e.source!==void 0||e.note!==void 0?(0,N.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,N.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,N.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,N.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,N.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,N.jsx)(Vo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,N.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,N.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,N.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:l}):null,(0,N.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:Ko(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,N.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,N.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,N.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,N.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,N.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,N.jsx)("span",{}),i]}):null]}),(0,N.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,N.jsx)(Ot.Provider,{value:r,children:(0,N.jsx)(Se.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,N.jsxs)(N.Fragment,{children:[d,u]}):u]})}function Bt(e){let t=ce(e.theme),n=It(e.locale),r=e.height??220;if(de(()=>Oe(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,N.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,N.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,N.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,N.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,N.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,N.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,N.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,N.jsx)(N.Fragment,{children:e.children})}var De=A(H(),1);var Q=A(H(),1);var B=A(L(),1),st=60;var lt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Un(e){let{c:t,events:n}=e,r=(0,Q.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,de(()=>{Oe()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,Q.useContext)(Se),c=e.ariaLabel??l??e.kind,d=(0,Q.useMemo)(()=>s?`${n.length}${n.slice(0,st).map(y=>`${y.label}${y.series??""}${y.formatted??y.value??""}`).join("")}`:"",[n,s]),u=(0,Q.useMemo)(()=>(0,B.jsx)(Uo,{label:c,events:n,t:t.t}),[c,d,t.t]),f=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let y=()=>{f.current=null};return window.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{window.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[]),(0,Q.useEffect)(()=>{f.current=null},[t.width,t.height]);let h=y=>{if(y.target!==y.currentTarget)return;if(e.onKey?.(y)){y.preventDefault();return}let T=t.active,_;switch(y.key){case"ArrowRight":case"ArrowDown":_=T===null?0:(T+1)%i;break;case"ArrowLeft":case"ArrowUp":_=T===null?i-1:(T-1+i)%i;break;case"Home":_=0;break;case"End":_=i-1;break;case"Escape":if(T===null)return;_=null;break;case"Enter":case" ":T!==null&&(y.preventDefault(),t.click(T));return;default:return}y.preventDefault(),t.setActive(_,"keyboard")},{via:m,node:g,setActive:v}=t;(0,Q.useEffect)(()=>{if(m!=="touch"||!g)return;let y=T=>{g.contains(T.target)||v(null)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},[m,g,v]);let x=t.active!==null?n[t.active]:null,M=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,C=M&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,R=typeof e.renderTip=="function"&&x?e.renderTip(x):null,b=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),F;if(M){let y=M.x*C,T=t.width*C,_=`clamp(${(4-y).toFixed(1)}px, -50%, calc(${(T-y-4).toFixed(1)}px - 100%))`,D=M.y<64;F={position:"absolute",left:y,top:M.y*C,transform:`translate(${_}, ${D?"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*C-8)}}let P=y=>{f.current=null,y.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=y=>y?T=>{let _=f.current??(f.current=T.currentTarget.getBoundingClientRect());_.width&&y((T.clientX-_.left)/_.width*t.width,(T.clientY-_.top)/_.height*t.height,T)}:void 0,O=E(e.onPointerMove),k=E(e.onPointerDown),S=O||k?y=>{y.pointerType==="touch"&&O?.(y),k?.(y)}:void 0,$=E(e.onPointerUp),w=Wn(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":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:y=>{t.via==="keyboard"&&!y.currentTarget.contains(y.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"),...w,...e.style},children:[t.pending?null:e.underlay,(0,B.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:O,onPointerDown:S,onPointerUp:$,onPointerCancel:$,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,B.jsx)("title",{id:o,children:c}),(0,B.jsx)("desc",{id:a,children:i||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,M?(0,B.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:F,children:R??(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:M.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:M.title}),M.rows.map((y,T)=>(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(y.strong?"ink":"muted")},children:[y.color?(0,B.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:y.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,y.label]}),(0,B.jsx)("span",{style:{fontWeight:y.strong===!1?500:700},children:y.value})]},T))]})}):null,(0,B.jsx)("span",{className:"ztd-sr",style:lt,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function Uo({label:e,events:t,t:n}){return(0,B.jsx)("div",{className:"ztd-sr",style:lt,children:(0,B.jsxs)("table",{children:[(0,B.jsx)("caption",{children:n.table(e)}),(0,B.jsxs)("tbody",{children:[t.slice(0,st).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>st?(0,B.jsx)("tr",{children:(0,B.jsx)("td",{colSpan:2,children:n.more(t.length-st)})}):null]})]})})}function Ht(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 p=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ne=p("label","string",!0,"Item name field"),K=p("value","number",!0,"Value field"),Xo=[ne,K],Yo=[ne,K],qo=[p("label","string",!0,"Stage name"),p("value","number",!0,"Users at the stage")],Jo=[ne,K],Zo=[p("label","string",!0,"Leaf (lowest level) name"),K,p("group","string",!1,"Parent group field")],Qo=[p("label","string",!0,"Leaf name"),K,p("group","string",!1,"Parent group field")],ei=[ne,p("value","number",!0,"Change (total rows may omit it)"),p("type","string",!1,'"total" makes a total bar')],ti=[ne,K],ni=[p("x","string",!0,"Column field"),p("series","string",!0,"Stacked series field"),K],ri=[p("x","string",!0,"Column field"),p("y","string",!0,"Row field"),K],oi=[p("axis","string",!0,"Metric (axis) field"),p("value","number",!0,"Value field",{multi:!0}),p("series","string",!1,"Series field")],ii=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("size","number",!1,"Circle size"),p("label","string",!1,"Name")],Yn=p("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ai=[p("x","any",!0,"x field (date, number or category)"),p("y","number",!0,"y field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field (long tables)"),p("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Yn],si=[p("x","any",!0,"x field"),p("y","number",!0,"y field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field"),p("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}),Yn],li=[p("x","any",!0,"x field"),p("y","number",!0,"y field",{multi:!0}),p("series","string",!1,"Series field")],ci=[p("x","string",!0,"Category field"),p("y","number",!0,"Value field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field"),p("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})],ui=[ne,K],mi=[p("value","number",!0,"Value field",{prop:"valueKey"}),p("target","number",!1,"Target field",{prop:"targetKey"})],di=[ne,p("value","number",!0,"Actual value field"),p("target","number",!1,"Target field")],fi=[p("x","any",!1,"x field"),p("y","number",!0,"y field")],hi=[ne,p("x","string",!1,"Period field (long tables)"),p("value","number",!1,"Value field (long tables)")],gi=[ne,p("start","number",!0,"Before value"),p("end","number",!0,"After value")],pi=[ne,K],bi=[p("value","number",!0,"Value field"),p("group","string",!1,"Group (row) field"),p("label","string",!1,"Dot name")],yi=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],xi=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),K],ki=[p("source","string",!0,"Sending group"),p("target","string",!0,"Receiving group"),K],wi=[p("date","date",!0,"Date field"),K],vi=[p("x","any",!0,"Period field"),p("series","string",!0,"Item field"),p("rank","number",!1,"Rank field (1 is first)"),p("value","number",!1,"Value field (instead of rank, largest is first)")],$i=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],Mi=[p("label","string",!1,"Row name field")],Ti=[p("x","date",!0,"Date (period) field"),p("open","number",!0,"Open price field"),p("high","number",!0,"High price field"),p("low","number",!0,"Low price field"),p("close","number",!0,"Close price field"),p("volume","number",!1,"Volume field")],Ci=[ne,K],Si=[p("x","any",!0,"Period field (date or category)"),p("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field (long tables, back row only)"),p("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Ai=[p("value","number",!1,"Sample value field (raw rows)"),p("group","string",!1,"Group field. Up to 2 groups overlap"),p("x0","number",!1,"Bin start (pre-binned rows)"),p("x1","number",!1,"Bin end (pre-binned rows)"),p("count","number",!1,"Samples in the bin (pre-binned rows)")],Ni=[p("region","string",!0,"Region name or code, matched to a tile of options.map"),K],Fi=[ne,K,p("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Ri=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),p("value","number",!1,"Link weight. Without it every row counts 1")],_i=[p("label","string",!0,"Row name. Items with the same name share a row"),p("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),p("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),p("group","string",!1,"Group field (one color per group, and the legend)"),p("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Pi=[p("label","string",!0,"Node name field"),p("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),p("group","string",!1,"Parent group field (flat rows, as in the treemap)"),p("id","string",!1,"Row id for id/parent rows. Defaults to the label"),p("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Di=[p("region","string",!0,"Region name or code, matched to a region of options.map"),K],Li=[p("lon","number",!1,"Longitude (degrees)"),p("lat","number",!1,"Latitude (degrees)"),p("size","number",!1,"Value (circle area). Without it all circles match"),p("label","string",!1,"Place name"),p("region","string",!1,"Region of options.map, for rows without lon and lat"),p("group","string",!1,"Group field (one color per group)")],Ei=[p("source","string",!0,"Start: a name in options.places or a region"),p("target","string",!0,"End"),p("value","number",!1,"Amount. Without it each row counts 1")],Oi=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("series","string",!1,"Series field (one color per series)"),p("label","string",!1,"Name")],Xn={pie:Xo,donut:Yo,funnel:qo,waffle:Jo,treemap:Zo,sunburst:Qo,waterfall:ei,pareto:ti,marimekko:ni,heatmap:ri,radar:oi,bubble:ii,line:ai,area:si,stream:li,bar:ci,radialBar:ui,gauge:mi,bullet:di,sparkline:fi,slope:hi,dumbbell:gi,lollipop:pi,beeswarm:bi,ridgeline:yi,sankey:xi,chord:ki,calendar:wi,bump:vi,box:$i,parallel:Mi,candlestick:Ti,segmented:Ci,skyline:Si,histogram:Ai,scatter:Oi,tileMap:Ni,barRace:Fi,network:Ri,timeline:_i,tree:Pi,choropleth:Di,symbolMap:Li,flowMap:Ei},Re={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:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function qn(e,t){return t==="ko"?e.nameKo:e.name}function Jn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Zn=["line","area","bar","scatter"],Qn=24,jt=["line","area","bar","scatter","timeline"];function Gt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function er(e,t,n){return jt.includes(e)&&!Gt(e,t,n).length&&!(e==="scatter"&&ct(n))}function ct(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function tr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Ii={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",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function ut(e){let t=Xn[e]?e:Ii[e]??Object.keys(Re).find(n=>n.toLowerCase()===e.toLowerCase()||Re[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Re[t]))return{type:t,component:Re[t].component,name:Re[t].name,nameKo:Re[t].nameKo,encoding:Xn[t]}}function nr(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 ut(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]}function rr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function zi(e,t){if(e==null||typeof e!="object")return;let n=e;if(rr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!rr(r,o))return;r=r[o]}return r}}function fe(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 Me(e,t){if(typeof e=="function")return e;let n=e??t;return r=>zi(r,n)}function _e(e,t){let n=Me(e,t);return(r,o)=>fe(n(r,o))}function re(e,t){let n=Me(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 ee(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Bi(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
+ `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var Hi=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function or(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Hi.test(t)||/^[-+]?\.\d+$/.test(t)){let n=fe(t);if(Number.isFinite(n))return n}return t}function Te(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Bi(o),i=[],s=[],l="",c=!1;for(let m=0;m<o.length;m++){let g=o[m];c?g==='"'?o[m+1]==='"'?(l+='"',m++):c=!1:l+=g:g==='"'&&!l.trim()?(c=!0,l=""):g===a?(s.push(l),l=""):g===`
24
+ `||g==="\r"?(g==="\r"&&o[m+1]===`
25
+ `&&m++,s.push(l),i.push(s),s=[],l=""):l+=g}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(m=>!(m.length===1&&m[0].trim()===""));if(!d.length)return[];let u=m=>n?or(m):m;if(!r)return d.map(m=>Object.fromEntries(m.map((g,v)=>[String(v),u(g)])));let f=[],h=new Set;return d[0].forEach((m,g)=>{let v=m.trim()||`col${g+1}`,x=v;for(let M=2;h.has(x);M++)x=`${v}_${M}`;h.add(x),f.push(x)}),d.slice(1).map(m=>Object.fromEntries(f.map((g,v)=>[g,u(m[v]??"")])))}function Wt(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,l)=>[s,r&&typeof i[l]=="string"?or(i[l]):i[l]??null])))}function ji(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,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function ir(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 ke(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ke(JSON.parse(t))}catch{}return Te(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Wt(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)?ke(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Wt(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)?ke(t.rows):Array.isArray(t.values)?Wt(t.values):Array.isArray(t.items)?ke(t.items):Array.isArray(t.results)?ke(t.results):ji(t)}return[]}function mt(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)}`}function Vt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let f=0;f<n;f++){let h=i(f,c),m=h-i(f,c-1),g=0;for(let v=0;v<f;v++)g+=i(v,c)-i(v,c-1);d+=h,u+=(m/2+g)*h}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,f=0;for(let h=0;h<n;h++){let m=e[h][l],g=Number.isFinite(m)?m:0;g>=0?(o[h][l]=u,u+=g,a[h][l]=u):(o[h][l]=f,f+=g,a[h][l]=f)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let f=i(u,l);t==="expand"&&(f=c?f/c*100:0),o[u][l]=d,d+=f,a[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let f=0;f<r;f++)o[u][f]-=d,a[u][f]-=d}return{y0:o,y1:a}}function ar(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 sr(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((f,h)=>{f>u&&(u=f,d=h)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var Gi=Math.PI*2;function lr(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function cr(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function Be(e,t){if(!e.length)return NaN;let n=(e.length-1)*t,r=Math.floor(n),o=n-r;return e[r+1]!==void 0?e[r]+o*(e[r+1]-e[r]):e[r]}function ur(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function dr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function mr(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 dt=new Map;function pe(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=dt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);dr(c)?i+=mr(c):s+=mr(c)}a=i+s*(n>=600?1.07:1),dt.size>5e3&&dt.clear(),dt.set(o,a)}return a*t}function Kt(e,t,n,r=400){if(e=e.trim(),pe(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;pe(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(dr(s.charCodeAt(0))?2:3)?"":s+o}var hr=A(L(),1),Wi=e=>Array.isArray(e)&&e.length===2;function fr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Wi(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var pr=A(L(),1),He=10.5;function Vi(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>Fe(i,{locale:n,maximumFractionDigits:a}))}function gr(e,t,n){let r=18;for(let o of Vi(e,t,n))r=Math.max(r,pe(o,He));return Math.ceil(r+8)}function Ut(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 we(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=Ut(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,f=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-f<=l*.3?f:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let h=Ut(c[1]-c[0],n);if(h===l)break;l=h}return c}function br(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Ut(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function je(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>br(n,r,l),s}function Xt(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[a,i]=we(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function Ki(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,d=1)=>{let u=[];for(let f=Math.floor(r);f<=Math.ceil(o);f++)if(!(f%d))for(let h of c){let m=Number((h*10**f).toPrecision(12));m>=e*(1-1e-9)&&m<=t*(1+1e-9)&&u.push(m)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:br(e,t,3)}function yr(e,t){let n=je([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=()=>Ki(e[0],e[1],Math.abs(t[1]-t[0])),r}function Ce(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 Ui=864e5;function xr(e,t,n,r=X){let o=t-e;if(!(o>0))return[{t:e,label:ze(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ui,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,f,h=!1)=>{let m=new Date(d),g=-1,v=0;for(;m.getTime()<=t&&v++<500;){if(m.getTime()>=e){let x=m.getFullYear(),M=h&&!l&&x!==g;i.push({t:m.getTime(),label:ze(m,{locale:r,...f,...M?{year:"numeric"}:{}})}),g=x}u(m)}};if(a<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=d)??12,f=new Date(s);f.setMinutes(0,0,0),c(f,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=a/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),f=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(f>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,m=>m.setFullYear(m.getFullYear()+f/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),m=h.getMonth()%f;m&&h.setMonth(h.getMonth()+(f-m)),c(h,g=>g.setMonth(g.getMonth()+f),{month:"short"},!0)}}return i}function kr(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var Xi=(e,t,n)=>e==="date"?nt(t,n)?.getTime()??NaN:fe(t);function Yi(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Bn(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Ge(e,t,n,r,o={}){let a=Me(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:Me(n,"y"),c=!i&&r!==void 0?Me(r,"series"):null,d=e.map((w,y)=>a(w,y)),u=o.xType??Yi(d),f=o.locale??X,h,m,g;if(u==="band"){let w=d.map(T=>String(T??""));h=ee(w);let y=new Map(h.map((T,_)=>[T,_]));m=h.map((T,_)=>_),g=Int32Array.from(w,T=>y.get(T)??-1)}else{let w=u==="date"?o.dayFirst??Hn(d):void 0,y=d.map(D=>Xi(u,D,w)),T=Array.from(new Set(y.filter(D=>Number.isFinite(D)))).sort((D,U)=>D-U),_=new Map(T.map((D,U)=>[D,U]));m=T,h=T.map(String),g=Int32Array.from(y,D=>_.get(D)??-1)}let v=o.dateFormat,x=w=>typeof w=="string"?tt(w.trim())?.[3]:void 0,M=u==="date"&&d.length<5e3?x(d[0]):void 0,C=(M===2||M===3)&&d.every(w=>x(w)===M),R=C&&M===3;if(u==="date"&&!v){let w=m.length>1?m[m.length-1]-m[0]:0;v=C&&M===2||w>864e5*120?{month:"short"}:w<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},w>864e5*800&&(v={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(R&&!o.dateFormat){let w=j(f)==="ko";b=m.map(y=>{let T=new Date(y),_=Math.floor(T.getMonth()/3)+1;return w?`${T.getFullYear()}년 ${_}분기`:`Q${_} ${T.getFullYear()}`})}else{let w=m.every(Lt),y=u==="date"?new Intl.DateTimeFormat(f,v):new Intl.NumberFormat(f,w?{useGrouping:!1}:{maximumFractionDigits:6});b=m.length>1e3?kr(m.length,T=>y.format(m[T])):m.map(T=>y.format(T))}let F=s?[...s]:c?ee(e.map((w,y)=>String(c(w,y)??""))):[""],P=new Map(F.map((w,y)=>[w,y])),E=F.map(()=>new Array(h.length).fill(NaN)),O=F.map(()=>new Array(h.length).fill(null)),k=o.aggregate??"sum",S=k==="mean"?F.map(()=>new Uint32Array(h.length)):null,$=(w,y,T,_)=>{let D=E[w][y];k==="last"?E[w][y]=T:k==="count"?E[w][y]=(Number.isFinite(D)?D:0)+1:k==="mean"?Number.isFinite(T)&&(E[w][y]=(Number.isFinite(D)?D:0)+T,S[w][y]++):E[w][y]=Number.isFinite(D)?D+(Number.isFinite(T)?T:0):T,O[w][y]=_};for(let w=0;w<e.length;w++){let y=g[w];if(y<0)continue;let T=e[w];if(s)for(let _=0;_<s.length;_++)$(_,y,fe(T[s[_]]),T);else{let _=c?P.get(String(c(T,w)??""))??0:0;$(_,y,fe(l(T,w)),T)}}if(S)for(let w=0;w<E.length;w++)for(let y=0;y<h.length;y++)S[w][y]>1&&(E[w][y]/=S[w][y]);return{type:u,keys:h,xnum:m,labels:b,series:F,values:E,rows:O}}var qi=140,Ve=12,wr=14,Yt=20,vr=12.5;function Ji(e,t,n=Qn){let r=re(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function Zi(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Ve)/(qi+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 Qi(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 We=e=>e.filter(Number.isFinite);function ft(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=_e(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return We(n)}function $r(e,t,n,r,o,a){return Ge(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function ea(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let b=t.flat(),F=r.refLines??{},[P,E]=Ce([...ft(b,r.x??"x"),...We([Number(F.x)])]),[O,k]=Ce([...ft(b,r.y??"y"),...We([Number(F.y)])].filter($=>!s||$>0)),S=r.zero??!1;return{y:c??(s?Xt(O,k,i):we(O,k,i,{zero:S,pad:.08})),x:r.xDomain??we(P,E,Math.max(2,Math.round(o/110)),{zero:S,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",f=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===f),m=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),g=r.xDomain??(!d&&m?Ce(n.flatMap(b=>We(b.xnum))):void 0),v=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(v==="percent")return{x:g,sameKeys:h};if(c)return{y:c,x:g,sameKeys:h};let x=[];t.forEach((b,F)=>{let P=n[F];if(v==="stacked"||v==="auto"&&P.series.length>1){let O=Vt(P.values,"zero");O.y0.forEach(k=>x.push(...k)),O.y1.forEach(k=>x.push(...k))}else P.values.forEach(O=>x.push(...O));d&&!u&&r.line!==void 0&&$r(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(O=>x.push(...O)),d||x.push(...ft(b,r.lower),...ft(b,r.upper))}),d&&x.push(0),u||x.push(...fr(r.annotations));for(let b of r.referenceLines??[])x.push(b.y);r.signColors&&x.push(Number(r.baseline??0));let[M,C]=Ce(We(x).filter(b=>!s||b>0));return{y:s?Xt(M,C,i):d?we(M,C,u?Math.max(2,Math.round(o/120)):i):we(M,C,i,{zero:r.zero??e==="area"}),x:g,sameKeys:h}}function ta(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Ge(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?yr:je)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=gr(c,En(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),f=r.endLabels??n.some(b=>b.series.length>1),h=d+6,m=a-(f?Math.min(a*.28,Math.max(...u.map(b=>pe(b,11,700)),20)+14):10),g=l.keys.length,[v,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,M=l.type==="number"?g>12:g>xr(v,x,Math.max(2,Math.floor((m-h)/64)),s).length;if(l.type==="band"||!g||M)return;let C=b=>h+(l.xnum[b]-v)/(x-v)*(m-h),R=b=>pe(l.labels[b],He);for(let b=1;;b++){let F=Array.from({length:Math.ceil(g/b)},(P,E)=>E*b);if(b>=g||F.every((P,E)=>!E||C(P)-C(F[E-1])>=(R(P)+R(F[E-1]))/2+8))return F.map(P=>({value:l.xnum[P],label:l.labels[P]}))}}function na(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 ra(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${na(`${e}|${t}|${o}|${mt(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 ia={en:{intro:(e,t)=>`${ge(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:"(빈 값)"}},qt=18;function Mr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Ji(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Zi(s,i,e.columns),{pw:c,ph:d}=Qi(s,l,e.height),u=e.scale!=="free",f=t==="scatter"?[]:o.map(S=>$r(t,S,n,n.y,n.series,n.aggregate)),h=u?ea(t,o,f,n,c,d):{sameKeys:!1},m=u?ta(t,o,f,n,h,c,d,e.locale):void 0,g=t==="bar"&&n.orientation==="horizontal",v=u&&(!g||h.sameKeys),x=u&&(g||h.x!==void 0||h.sameKeys),M=new Set(oa(e.highlight,r)?[e.highlight].flat():[]),C=M.size>0,R=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??ra(t,e.by,n,e.data),F=et($e(n.format,e.locale),n.unit),P=ia[e.lang],E=[],O=r.map(S=>S===""?P.blank:S);return{panels:r.map((S,$)=>{let w=o[$],y=O[$],T=$%l,_;if(t!=="scatter"){let U=f[$],he=ie=>U.values.reduce((I,J)=>I+(Number.isFinite(J[ie])?J[ie]:0),0),z=U.keys.map((ie,I)=>I).filter(ie=>U.values.some(I=>Number.isFinite(I[ie]))),q=z[z.length-1];E.push({first:z.length?he(z[0]):NaN,last:z.length?he(q):NaN,total:z.reduce((ie,I)=>ie+he(I),0)}),t!=="bar"&&U.series.length===1&&q!==void 0&&(_=F(U.values[0][q]))}else E.push({first:NaN,last:NaN,total:w.length});let D={data:w,width:c,height:d,ariaLabel:e.title?`${e.title}, ${y}`:y,syncId:b,highlight:C?M.has(S)?R?()=>!0:void 0:"none":e.highlight,showYAxis:!v||T===0,showXAxis:!x||$+l>=i};return h.y&&(D.yDomain=h.y),h.x&&(D.xDomain=h.x),m&&(D.xTicks=m),{value:S,label:y,props:D,last:_,isPicked:M.has(S)}}),cols:l,pw:c,ph:d,isPanelPick:C,description:aa(t,e.by,O,E,a,F,P)}}function aa(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>ur(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let d=n.filter((u,f)=>r[f].last<r[f].first);s+=d.length?i.falling(`${d.slice(0,5).join(", ")}${d.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var te=A(H(),1);function sa(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function la(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var ht={threshold:.25,enoughPx:96,rootMargin:"0px"};function Sr(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(i=>{let s=la(i[i.length-1],ht.threshold,ht.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:sa(ht.threshold),rootMargin:ht.rootMargin}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,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 Tr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function gt(e){let[t,n]=(0,te.useState)(null),[r,o]=(0,te.useState)(e??null),a=(0,te.useCallback)(i=>{n(i),i&&e===void 0&&o(Tr(i))},[e]);return de(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>i(Tr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?i(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var ca=()=>()=>{};function Pe(){return(0,te.useSyncExternalStore)(ca,()=>!0,()=>!1)}var Cr="(prefers-reduced-motion: reduce)";function pt(e="auto"){let[t,n]=(0,te.useState)(()=>ae&&typeof window.matchMedia=="function"?window.matchMedia(Cr).matches:!1);return(0,te.useEffect)(()=>{if(e!=="auto"||!ae||typeof window.matchMedia!="function")return;let r=window.matchMedia(Cr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ue=A(L(),1),ua=60,ma=420;function Ar(e){let t=ce(),n=e.chartProps??{},[,r,o]=gt(e.width),a=e.width??(o||480),i=Z(e.locale??n.locale),s=j(i),l=(0,De.useContext)(Se),c=e.title??l,d=e.chart.facetPlan,u=(0,De.useMemo)(()=>{let x=Mr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return d?d(x,n,i):x},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(x,M)=>typeof M=="function"?String(M):M),e.highlight,e.syncId,a,e.height,c,i,s,d]),f=`${(0,De.useId)().replace(/:/g,"")}fd`,h=pt(n.reducedMotion??"auto"),m=Pe(),g=kn({motion:{enabled:n.animate!==!1&&!h&&ae},hydrated:m},{waiting:!1,generation:0}),v=e.chart;return(0,ue.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":f,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,ue.jsx)("p",{id:f,style:lt,children:e.description??u.description}),(0,ue.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:Ve,rowGap:wr,...u.legend?{marginTop:qt}:null},children:u.panels.map((x,M)=>{let C=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,ue.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...xn(g,!1,"fade",M*ua,ma)},children:[(0,ue.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Yt,fontSize:vr,fontWeight:700,lineHeight:`${Yt}px`,color:C},children:[(0,ue.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,ue.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,ue.jsx)(v,{...n,...x.props})]},x.value)})}),u.legend?(0,ue.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:qt},children:u.legend}):null]})}var Nr=["max","min","first","last","none"];function me(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((f,h)=>{Number.isFinite(f)&&(c==="max"?f>u:f<u)&&(u=f,d=h)}),d>=0&&a.add(d)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,d)=>{d<i&&c!==null&&c!==void 0&&e(c,d)&&a.add(d)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&a.add(u)});return a}var oe=A(H(),1);async function da(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(j(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Te(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 Te(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Te(a)}async function fa(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 da(a,t.parse,o,t.locale)}return t.select&&(r=ir(r,t.select)),t.transform?t.transform(r):ke(r)}function Fr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,oe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,oe.useState)(0),c=Z(t.locale),d=(0,oe.useRef)(t);d.current={...t,locale:c};let u=(0,oe.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],m=JSON.stringify(h.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),g=(0,oe.useRef)(!1);(0,oe.useEffect)(()=>{let x=u.current;if(!x||!r){i(R=>R.status==="loading"?{...R,status:"idle"}:R);return}let M=new AbortController,C=!0;return g.current=!0,i(R=>({...R,data:o?R.data:[],status:"loading",error:null})),fa(x,{...d.current,signal:M.signal}).then(R=>{C&&i({data:R,status:"success",error:null,updatedAt:Date.now()})}).catch(R=>{!C||M.signal.aborted||i(b=>({...b,status:"error",error:R instanceof Error?R:new Error(String(R))}))}).finally(()=>{C&&(g.current=!1)}),()=>{C=!1,g.current=!1,M.abort()}},[f,r,s,m,o]),(0,oe.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{g.current||l(M=>M+1)},n);return()=>clearInterval(x)},[n,r]);let v=(0,oe.useCallback)(()=>l(x=>x+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:v}}var Zt=A(L(),1),ha=["csv","svg","png"],ga=/^[=+\-@\t\r\n=+-@]/,pa=/var\(|color-mix\(/;function Rr(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?On(e.getTime()):String(e);return`"${(ga.test(t)&&!Number.isFinite(fe(t))?`'${t}`:t).replace(/"/g,'""')}"`}function ba(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function ya(e,t){return`\uFEFF${[t.map(Rr),...e.map(r=>t.map(o=>Rr(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function ri(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Ut(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Ar=2,we=16;function Fr(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 Nr(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 Rr(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,l]=[i+we*2,a+we*2],c=o.cloneNode(!0),m=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,g)=>{let w;for(let x of Array.from(d.attributes)){if(!ei.test(x.value))continue;let T=(w??(w=getComputedStyle(d))).getPropertyValue(x.name);T&&m[g].setAttribute(x.name,Fr(T,u))}}),c.removeAttribute("style");for(let[d,g]of Object.entries({viewBox:`${-we} ${-we} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(d,String(g));let f=Fr(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Nr("rect",{x:-we,y:-we,width:s,height:l,fill:f}),d),h&&c.insertBefore(Nr("image",{href:h.toDataURL(),width:i,height:a}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:i,vh:a,bg:f,canvas:h}}function oi(e,t){let n=Rr(e,Ar,!1);if(!n)return;let r=Ar,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,we*r,we*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(l=>l&&Ut(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Pr(e){let t=ae(e.theme),n=j(Z(e.locale))==="ko",r=ri(e.filename),o=(i,a)=>{if(i==="csv")return Ut(new Blob([ni(e.data,e.columns?.length?e.columns:ti(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return oi(a,r);let s=Rr(a,1,!0);s&&Ut(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Xt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Za.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,Xt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(i,l.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 Lr=N(_(),1);function Dr(e,t=X){let n=ve(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?Oe(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,c=s.replace(_n,(m,u)=>o(i,u.trim())??(l=!0,""));l||a.push(c)}return a.length?a.map((s,l)=>(0,Lr.jsx)("div",{children:s},l)):null}}function Er(e,t,n){let r=e.filter(d=>Number.isFinite(d)),o=r.length;if(!o)return t.map(()=>0);let i=r.reduce((d,g)=>d+g,0)/o,a=t.length>1?Math.abs(t[t.length-1]-t[0]):0,s=a>0?a/40:Math.abs(i)*.05||1,l=Math.sqrt(r.reduce((d,g)=>d+(g-i)**2,0)/o)||s,c=[...r].sort((d,g)=>d-g),m=Be(c,.75)-Be(c,.25),u=Math.min(l,m>0?m/1.34:l)||l,f=n??Math.max(1e-9,.9*u*Math.pow(o,-.2)),h=1/(Math.sqrt(2*Math.PI)*f*o);if(o>2e3){let g=c[0],x=(c[o-1]-g)/512||1,T=new Array(513).fill(0);for(let S of r)T[Math.min(512,Math.floor((S-g)/x))]++;return t.map(S=>{let M=0;for(let b=0;b<=512;b++){if(!T[b])continue;let R=(S-(g+b*x))/f;R>6||R<-6||(M+=T[b]*Math.exp(-.5*R*R))}return M*h})}return t.map(d=>{let g=0;for(let w of r){let x=(d-w)/f;x>6||x<-6||(g+=Math.exp(-.5*x*x))}return g*h})}function _r(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 $e(t.csv)}return null}var Vr=N(H(),1);var G=N(H(),1);function Ir(e,t){let n=ae(e.theme),[r,o,i]=dt(e.width),a=Pe(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,m=ft(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&re,f=Mr(r,e.animateOnView!==!1&&u),h=Z(e.locale),d=j(h),g=(0,G.useMemo)(()=>ve(e.format,h,t.format),[e.format,h,t.format]),w=(0,G.useCallback)(B=>Ze(B,{locale:h}),[h]),x=(0,G.useMemo)(()=>Qe(g,e.unit),[g,e.unit]),T=(0,G.useMemo)(()=>ct(e.data),[e.data]),[S,M]=(0,G.useState)(null),[b,R]=(0,G.useState)(null),D=(0,G.useRef)([]),E=(0,G.useRef)(e.onHover);E.current=e.onHover;let I=(0,G.useRef)(e.onClick);I.current=e.onClick;let y=(0,G.useRef)(null),A=(0,G.useRef)(null),$=(0,G.useRef)(null),v=(0,G.useCallback)((B,q="pointer")=>{if($.current!==B){$.current=B;let ne=B===null?null:D.current[B]??null;queueMicrotask(()=>E.current?.(ne)),A.current?.(B)}y.current=B===null?null:q,M(B),R(y.current)},[]),p=(0,G.useCallback)(B=>{y.current!=="keyboard"&&(y.current=B===null?null:"sync",M(B),R(y.current))},[]),C=(0,G.useCallback)(B=>{let q=D.current[B];q&&I.current?.(q)},[]),P=jn(e.replayKey),L=e.width!==void 0||(i??0)>0,K={enabled:u,active:f.visible&&L,near:f.near,replayKey:P,dataKey:T,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},me=(0,G.useCallback)((B,q=1)=>S===null||S===B?q:q*.38,[S]);return{p:n,width:s,height:c,measured:L,responsive:e.width===void 0,pending:re&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:K,fv:x,fmt:g,pct:w,locale:h,lang:d,t:d==="ko"?yn:bn,active:S,via:b,setActive:v,click:C,events:D,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:me,sig:T,description:e.description,reduced:m,publish:A,applySync:p}}var V=N(H(),1);function ai(e){return 1-Math.pow(1-e,3)}function ii(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function si(e){return e==="easeInOut"?ii:e==="linear"?t=>t:ai}function li(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 Le(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 Or(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 Br(e,t,n,r){if(!t||!n||t.length!==n.length)return Le(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 l of Le(s,n[a]))o.push(l)}return o.length===r?o:Le(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),Or(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),l=r>0?Math.min(i*r,240):0;if(s){let c=a.to.length;s.from=Br(s.cur,s.parts,a.parts,c),s.vel=Br(s.curVel,s.parts,a.parts,c),s.parts=a.parts,s.to=a.to.slice(),Or(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):l),s.done=ht(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let c=this.make(a,a.enter??a.from??a.to,n+l,0);c.done=ht(c.from,c.to),this.tracks.set(a.key,c)}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=Le(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=si(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=Le(s.from,c)),s.vel.length!==c&&(s.vel=Le(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;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*l),f=i*l>=8&&i*l<20,h=0;for(let d=0;d<c;d++){let g=s.from[d]-s.to[d],w=s.vel[d]+i*g;s.cur[d]=s.to[d]+(g+w*l)*u,s.curVel[d]=(s.vel[d]-i*w*l)*u,f&&h<.15&&(h=Math.max(h,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/i)))}m=i*l>=20||f&&h<.15,s.progress=Math.min(1,1-(1+i*l)*u)}else{let u=Math.min(1,l/o),f=r(u),h=li(this.easing,u)/o;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*f,s.curVel[d]=(s.to[d]-s.from[d])*h;m=u>=1,s.progress=f}if(m){for(let u=0;u<c;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}},Ge=new Set,pt=0;function zr(e){pt=0;let t=Array.from(Ge);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ge.delete(n)}Ge.size&&typeof requestAnimationFrame<"u"&&(pt=requestAnimationFrame(zr))}function Hr(e){return Ge.add(e),!pt&&typeof requestAnimationFrame<"u"&&(pt=requestAnimationFrame(zr)),()=>{Ge.delete(e)}}function ci(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 jr(e,t){let n=(0,V.useMemo)(()=>ci(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:c=900,stagger:m=0}=t,u=(0,V.useRef)(null),f=(0,V.useRef)("init"),h=(0,V.useRef)(null),d=(0,V.useRef)(s),g=(0,V.useRef)(a),w=(0,V.useRef)(!1),x=(0,V.useRef)(0),[,T]=(0,V.useState)(0),S=(0,V.useRef)(null),M=(0,V.useRef)(!0);u.current||(u.current=new gt,u.current.configure(l,c),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(l,c),h.current!==n){let A=f.current,$=!Object.is(d.current,s);b.sameTargets(n)?b.refreshData(n):!r||A==="init"?b.snap(n):A==="idle"?b.hold(n):A==="running"||$?b.update(n,Ye(),m):b.snap(n),h.current=n,d.current=s}let R=(0,V.useRef)(()=>!1);R.current=A=>{if(!M.current)return!1;let $=b.step(A);return!$&&f.current==="running"&&(f.current="done"),T(v=>(v+1)%1e9),$||(S.current=null),$};let D=(0,V.useCallback)(()=>{if(!re||S.current||!b.animating)return;let A=$=>R.current($);S.current=Hr(A)},[b]);se(()=>{let A=!Object.is(g.current,a);if(g.current=a,!r){(f.current!=="done"||b.animating)&&(b.snap(h.current??n),f.current="done",T($=>$+1));return}f.current==="init"||A&&i?(b.hold(h.current??n),f.current="idle",w.current=!1,T($=>$+1)):A&&(w.current=!0)},[r,a]),se(()=>{!r||!i||!w.current||(w.current=!1,b.hold(h.current??n),f.current="idle",T(A=>A+1))},[i,r]),(0,V.useEffect)(()=>{r&&o&&f.current==="idle"&&(b.start(Ye()),x.current+=1,f.current="running",D(),T(A=>A+1))},[r,o,a,b,D]),(0,V.useEffect)(()=>{b.animating&&D()}),(0,V.useEffect)(()=>(M.current=!0,()=>{M.current=!1,S.current?.(),S.current=null}),[]);let E=Ye(),I=b.elapsed(E),y=r&&f.current==="idle";return{items:b.items(),get:A=>b.get(A),elapsed:y?0:I,fade:(A,$=320)=>y?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-A)/$)):1,waiting:y,animating:b.animating,generation:x.current}}var Yt=N(_(),1);function Wr(e,t,n,r,o){if(r)return o==="categorical"?le(e,t,n):Sn(e,t,n);if(o==="categorical")return le(e,t,n);let i=W(e,"strong"),a=W(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var ui=N(H(),1);var qt=N(_(),1);var Gr=e=>e?"neutralStrong":"accent";var Jt=N(_(),1);function Kr(e,t,n,r){if(typeof e!="function")return ue(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 l=o.get(r(a,s));l!==void 0&&e(a,s)&&i.add(l)}),i}var mi=N(H(),1);var Qt=N(_(),1),di={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}, ${de(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Ur={en:di,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}일 이동평균`}},Zt=["ink","muted","dim"];function Xr(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Zt.length)}var fi=N(H(),1);var Qr=N(_(),1),hi={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${de(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},gi={en:hi,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Yr=(e,t)=>gi[e].other(t);function qr(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,ar(o.map(i=>i.value)))}}var Jr=e=>Number.isFinite(e)&&e>0?e:0;function Zr(e,t,n,r){return r==="emphasis"?Tn(e,t,n):le(e,t,n)}var bt=N(H(),1);var Y=N(_(),1),pi={kind:"Ridgeline",med:"Median",n:"Sample size",count:e=>`${e}`,summary:(e,t)=>`median ${e} (${de(t,"value")})`,median:(e,t)=>`${e} median ${t}`,groups:e=>de(e,"group")},bi={en:pi,ko:{kind:"릿지라인",med:"중앙값",n:"표본",count:e=>`${e}개`,summary:(e,t)=>`중앙값 ${e}(${t}개)`,median:(e,t)=>`${e} 중앙값 ${t}`,groups:e=>`그룹 ${e}개`}},en=72;function tn(e){let t=(0,bt.useMemo)(()=>ye(e.data.map((y,A)=>he(e.group,"group")(y,A))),[e.data,e.group]),n=Ir(e,{height:()=>Math.max(180,Math.min(380,t.length*36+60)),duration:900,stagger:90}),{p:r,width:o,height:i}=n,a=bi[n.lang],s=(0,bt.useMemo)(()=>{let y=he(e.group,"group"),A=Re(e.value,"value"),$=new Map;e.data.forEach((O,J)=>{let Ee=A(O,J);if(!Number.isFinite(Ee))return;let rn=y(O,J),on=$.get(rn);on?on.push(Ee):$.set(rn,[Ee])});let v=t.filter(O=>$.has(O)),p=[...$.values()].flat(),[C,P]=Me(p),L=ke(C,P,4,{zero:!1,pad:.06}),K=Array.from({length:en},(O,J)=>L[0]+(L[1]-L[0])*J/(en-1)),me=new Map(v.map(O=>[O,Be([...$.get(O)].sort((J,Ee)=>J-Ee),.5)]));e.sort==="median"&&(v=[...v].sort((O,J)=>me.get(O)-me.get(J)));let B=v.map((O,J)=>({g:J,name:O,dens:Er($.get(O),K,e.bandwidth),median:me.get(O),n:$.get(O).length,hi:!1,datum:null})),q=ue(e.highlight,v,v,B.map(O=>O.median),"max");B.forEach(O=>O.hi=q.has(O.g));let ne=Math.max(...B.flatMap(O=>O.dens),1e-9);return{ridges:B,dom:L,xsv:K,peak:ne}},[e.data,e.group,e.value,e.bandwidth,e.sort,e.highlight,t]),l=Math.min(o*.26,Math.max(...s.ridges.map(y=>ge(y.name,11.5,700)),20)+10),c=20,m=8,u=Math.max(1,s.ridges.length),f=Math.max(1e-6,e.overlap??1.5),h=(i-m-c)/(u-1+f),d=h*f,g=He(s.dom,[l+8,o-8]),w=y=>m+d+h*y,x=n.motion.stagger??90,T=(0,bt.useMemo)(()=>s.ridges.map((y,A)=>({key:`r:${y.name}`,to:y.dens.map($=>$/s.peak*d),from:y.dens.map(()=>0),enter:y.dens.map(()=>0),delay:A*x,data:y})),[s,d,x]),S=jr(T,n.motion),M=W(r,"accent"),b=s.ridges.map(y=>({datum:null,index:y.g,key:y.name,label:y.name,value:y.median,formatted:a.summary(n.fv(y.median),y.n)})),R=null;if(n.active!==null&&s.ridges[n.active]){let y=s.ridges[n.active];R={x:g(y.median),y:w(y.g)-d*.6,title:y.name,rows:[{label:a.med,value:n.fv(y.median),color:y.hi?M.fill:r.paint("neutralStrong")},{label:a.n,value:a.count(y.n)}]}}let D=g.ticks(Math.max(2,Math.round(o/110))),E=n.motion.duration??900,I=e.description??`${a.kind}. ${a.groups(u)}: ${s.ridges.map(y=>a.median(y.name,n.fv(y.median))).join(", ")}.`;return(0,Y.jsxs)(Wn,{c:n,kind:a.kind,ariaLabel:e.ariaLabel,description:I,events:b,tip:R,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(y,A,$)=>{let v=ir(s.xsv,g.invert(y)),p=-1;for(let C=s.ridges.length-1;C>=0;C--){let P=w(C),L=(s.ridges[C].dens[v]??0)/s.peak*d;if(A<=P+1&&A>=P-L-1){p=C;break}}p<0&&(p=Math.max(0,Math.min(u-1,Math.ceil((A-m-d)/h)))),p!==n.active&&n.setActive(p,$.pointerType==="touch"?"touch":"pointer")},children:[(0,Y.jsx)("g",{"aria-hidden":"true",children:D.map(y=>(0,Y.jsxs)("g",{children:[(0,Y.jsx)("line",{x1:g(y),x2:g(y),y1:m,y2:i-c,stroke:r.paint("line")}),(0,Y.jsx)(Ot,{x:g(y),y:i-c+11,anchor:"middle",size:ze,fill:r.paint("muted"),children:n.fmt(y)})]},y))}),S.items.map(y=>{let A=y.data,$=w(A.g),v=y.v.map((L,K)=>`${g(s.xsv[K]).toFixed(2)},${($-L).toFixed(2)}`),p=`M${g(s.xsv[0]).toFixed(2)},${$}L${v.join("L")}L${g(s.xsv[en-1]).toFixed(2)},${$}Z`,C=`M${v.join("L")}`,P=n.active===A.g;return(0,Y.jsxs)("g",{className:"ztd-mark",opacity:y.exiting?.4:n.dim(A.g),children:[(0,Y.jsx)("path",{d:p,fill:A.hi?M.fill:r.paint("neutral"),fillOpacity:A.hi?.88:.92}),(0,Y.jsx)("path",{d:C,fill:"none",stroke:A.hi?M.fill:P?r.paint("ink"):r.paint("neutralStrong"),strokeWidth:A.hi||P?1.8:1.2,strokeLinejoin:"round"}),(0,Y.jsx)("line",{x1:l+8,x2:o-8,y1:$,y2:$,stroke:r.paint("line2")})]},y.key)}),s.ridges.map(y=>(0,Y.jsxs)("g",{pointerEvents:"none",children:[(0,Y.jsx)(Ot,{x:l,y:w(y.g)-6,anchor:"end",size:11.5,weight:y.hi?800:600,fill:r.paint(y.hi?"ink":"muted"),children:Vt(y.name,l-4,11.5,700)}),(0,Y.jsx)("line",{x1:g(y.median),x2:g(y.median),y1:w(y.g)-5,y2:w(y.g),stroke:r.paint(y.hi?"onAccent":"ink"),strokeWidth:1.6,opacity:S.fade(y.g*x+E*.6,260)})]},y.name))]})}var yi=N(H(),1);var ro=N(_(),1);function eo(e,t){return t===!1?e.map((n,r)=>r):or(e)}function to(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ue(e,t,t,r,"max")}function no(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]=W(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?W(e,"neutral"):Je(e,1-a/Math.max(1,o.length-1))),r}var pe=N(_(),1);function oo(e,t){let n=lt(e);return n?.type==="scatter"&&t?.size!==void 0?lt("bubble"):n}function xi(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 ki(e,t,n,r=!1){let o=oo(e.type,e.encoding);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&Bt.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),c=u=>u.filter(f=>!l.has(f.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let u=he(i.label,"label"),f=Re(i.value,"value"),h=o.type==="waffle",d=t.map((M,b)=>({r:M,label:u(M,b),value:h?f(M,b):Jr(f(M,b))})),{kept:g,other:w}=h?{kept:d,other:null}:qr(d,a.other,(M,b)=>({r:{},label:Yr(j(n),M),value:b})),x=ue(s,g.map(M=>M.r),g.map(M=>M.label),g.map(M=>M.value),h?"first":"max"),T=w?[...g,w]:g,S=Ie(M=>h?le(M,T.length,x):Zr(M,T.length,x,a.colorMode));return T.map((M,b)=>({label:M.label,color:S[b]}))}if(o.type==="candlestick"){let u=Xr(Array.isArray(a.ma)?a.ma:void 0,t.length),f=Ur[j(n)];return[{label:f.up,color:a.upColor??"accent"},{label:f.down,color:a.downColor??"neutralStrong"},...u.map((h,d)=>({label:f.maLegend(h),color:Zt[d],shape:"line"}))]}if(o.type==="scatter"){if(typeof i.series!="string")return[];let u=he(i.series,"series"),f=ye(t.map((g,w)=>u(g,w)));if(f.length<2)return[];let h=Kr(s,t,f,u),d=Ie(g=>Cn(g,f.length,h));return c(f.map((g,w)=>({label:g,color:d[w],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 S=he(i.series,"series");u=ye(t.map((M,b)=>S(M,b)))}let f=zt(o.type,i,a);if(f.length){let S=ue(s,u,u,u.map(()=>0),"none"),M=Ie(R=>le(R,u.length,S)),b=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((R,D)=>({label:R,color:M[D]}));return[...c(b),...f.map((R,D)=>({label:R,color:Gr(D),shape:"line"}))]}if(u.length<2)return[];let d=o.type==="bar"&&a.layout==="diverging"&&s===void 0?rr(u.length,Array.isArray(a.negative)?a.negative.map(S=>u.indexOf(String(S))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,g=d>=0?new Set([d]):ue(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((S,M)=>({label:S,color:g.has(M)?"accent":"neutralStrong",shape:"square"})));let w=a.colorMode,x=S=>le(S,u.length,g);if((o.type==="line"||o.type==="area")&&(x=S=>Wr(S,u.length,g,o.type==="area",w)),o.type==="stream"){let S=je(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),M=eo(S.values,a.reorder),b=to(s,S.series,S.values);x=R=>no(R,M,b)}let T=Ie(x);return c(u.map((S,M)=>({label:S,color:T[M],...o.type==="line"&&{shape:"line"}})))}return[]}function wi(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Yn.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function vi(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:c,...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:l,description:c}}function ao(e,t){let{spec:n}=e,r=oo(n.type,n.encoding),o=(0,Ke.useMemo)(()=>_r(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Xn(n,e.locale),s=Z(a),l=j(s),c=Tr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=Zn(n),u=(0,Ke.useMemo)(()=>m?Dr(m,s):void 0,[m,s]),f=n.options?.hidden,h=Array.isArray(f)?f.map(String):[],d=h.join(""),[g,w]=(0,Ke.useState)(null);if(!r)return(0,pe.jsx)(It,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let x=o??c.data,T=t[r.type],S={...n.options??{}},M={...xi(r,n.encoding),...S,...u?{tooltip:u}:{},data:x,...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},b=n.card?.legend==="toggle"&&Jn(r.type,n.encoding??{},S),R=g&&g.base===d?g.hidden:h;b&&(M.hidden=R);let D=$=>w(v=>{let p=v&&v.base===d?v.hidden:h;return{base:d,hidden:p.includes($)?p.filter(C=>C!==$):[...p,$]}}),E=M.height??220,I=wi(n,r.type),y=i&&!x.length&&(c.loading||c.error||c.empty)?(0,pe.jsx)(It,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:E,locale:a}):I?(0,pe.jsx)(Cr,{chart:T,...vi(r.type,I,M)}):(0,pe.jsx)(T,{...M});if(n.card){let $=n.card,v=$.legend==="auto"||$.legend==="toggle"?ki(n,x,s,b):$.legend,p=v?.length?b?(0,pe.jsx)(_t,{items:v,hidden:R,onToggle:D,locale:a}):v:void 0,C=$.download?(0,pe.jsx)(Pr,{data:x,columns:Qn(n),filename:$.title??r.type,formats:Array.isArray($.download)?$.download:void 0,locale:a}):void 0;y=(0,pe.jsx)(Vn,{number:$.number,title:$.title??Un(r,l),subtitle:$.subtitle,legend:p,actions:C,source:$.source||void 0,note:$.note||void 0,accent:$.accent,takeaway:$.takeaway,level:$.level,sample:$.sample,replay:$.replay!==!1,className:e.className,locale:a,children:y})}let A=e.theme??n.theme;return A&&(y=(0,pe.jsx)(rt,{theme:A,children:y})),y}function $i({cfg:e,components:t}){let n=Pe();return ao({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function so(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,io.hydrateRoot)(r,(0,nn.createElement)(rt,{theme:o.theme,cssVars:!0},(0,nn.createElement)($i,{cfg:o,components:{[e]:t}})))}so("ridgeline",tn);})();
27
+ `}function xa(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Jt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var _r=2,ve=16;function Pr(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 Dr(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 Lr(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,l]=[a+ve*2,i+ve*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((m,g)=>{let v;for(let x of Array.from(m.attributes)){if(!pa.test(x.value))continue;let M=(v??(v=getComputedStyle(m))).getPropertyValue(x.name);M&&d[g].setAttribute(x.name,Pr(M,u))}}),c.removeAttribute("style");for(let[m,g]of Object.entries({viewBox:`${-ve} ${-ve} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(m,String(g));let f=Pr(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let m=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Dr("rect",{x:-ve,y:-ve,width:s,height:l,fill:f}),m),h&&c.insertBefore(Dr("image",{href:h.toDataURL(),width:a,height:i}),m)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:f,canvas:h}}function ka(e,t){let n=Lr(e,_r,!1);if(!n)return;let r=_r,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,ve*r,ve*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(l=>l&&Jt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Er(e){let t=ce(e.theme),n=j(Z(e.locale))==="ko",r=xa(e.filename),o=(a,i)=>{if(a==="csv")return Jt(new Blob([ya(e.data,e.columns?.length?e.columns:ba(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return ka(i,r);let s=Lr(i,1,!0);s&&Jt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Zt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:ha.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Zt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,l.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 Ir=A(L(),1);function Or(e,t=X){let n=$e(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?ze(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(zn,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Ir.jsx)("div",{children:s},l)):null}}function zr(e,t,n){let r=e.filter(m=>Number.isFinite(m)),o=r.length;if(!o)return t.map(()=>0);let a=r.reduce((m,g)=>m+g,0)/o,i=t.length>1?Math.abs(t[t.length-1]-t[0]):0,s=i>0?i/40:Math.abs(a)*.05||1,l=Math.sqrt(r.reduce((m,g)=>m+(g-a)**2,0)/o)||s,c=[...r].sort((m,g)=>m-g),d=Be(c,.75)-Be(c,.25),u=Math.min(l,d>0?d/1.34:l)||l,f=n??Math.max(1e-9,.9*u*Math.pow(o,-.2)),h=1/(Math.sqrt(2*Math.PI)*f*o);if(o>2e3){let g=c[0],x=(c[o-1]-g)/512||1,M=new Array(513).fill(0);for(let C of r)M[Math.min(512,Math.floor((C-g)/x))]++;return t.map(C=>{let R=0;for(let b=0;b<=512;b++){if(!M[b])continue;let F=(C-(g+b*x))/f;F>6||F<-6||(R+=M[b]*Math.exp(-.5*F*F))}return R*h})}return t.map(m=>{let g=0;for(let v of r){let x=(m-v)/f;x>6||x<-6||(g+=Math.exp(-.5*x*x))}return g*h})}function Br(e,t,n=!1){let r=re(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=ee(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}function Hr(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 Te(t.csv)}return null}var Xr=A(H(),1);var V=A(H(),1);function jr(e,t){let n=ce(e.theme),[r,o,a]=gt(e.width),i=Pe(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=pt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&ae,f=Sr(r,e.animateOnView!==!1&&u),h=Z(e.locale),m=j(h),g=(0,V.useMemo)(()=>$e(e.format,h,t.format),[e.format,h,t.format]),v=(0,V.useCallback)(z=>Qe(z,{locale:h}),[h]),x=(0,V.useMemo)(()=>et(g,e.unit),[g,e.unit]),M=(0,V.useMemo)(()=>mt(e.data),[e.data]),[C,R]=(0,V.useState)(null),[b,F]=(0,V.useState)(null),P=(0,V.useRef)([]),E=(0,V.useRef)(e.onHover);E.current=e.onHover;let O=(0,V.useRef)(e.onClick);O.current=e.onClick;let k=(0,V.useRef)(null),S=(0,V.useRef)(null),$=(0,V.useRef)(null),w=(0,V.useCallback)((z,q="pointer")=>{if($.current!==z){$.current=z;let ie=z===null?null:P.current[z]??null;queueMicrotask(()=>E.current?.(ie)),S.current?.(z)}k.current=z===null?null:q,R(z),F(k.current)},[]),y=(0,V.useCallback)(z=>{k.current!=="keyboard"&&(k.current=z===null?null:"sync",R(z),F(k.current))},[]),T=(0,V.useCallback)(z=>{let q=P.current[z];q&&O.current?.(q)},[]),_=Vn(e.replayKey),D=e.width!==void 0||(a??0)>0,U={enabled:u,active:f.visible&&D,near:f.near,replayKey:_,dataKey:M,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},he=(0,V.useCallback)((z,q=1)=>C===null||C===z?q:q*.38,[C]);return{p:n,width:s,height:c,measured:D,responsive:e.width===void 0,pending:ae&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:U,fv:x,fmt:g,pct:v,locale:h,lang:m,t:m==="ko"?vn:wn,active:C,via:b,setActive:w,click:T,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:he,sig:M,description:e.description,reduced:d,publish:S,applySync:y}}var G=A(H(),1);function wa(e){return 1-Math.pow(1-e,3)}function va(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function $a(e){return e==="easeInOut"?va:e==="linear"?t=>t:wa}function Ma(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 Le(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 bt(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 Gr(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 Wr(e,t,n,r){if(!t||!n||t.length!==n.length)return Le(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 l of Le(s,n[i]))o.push(l)}return o.length===r?o:Le(e,r)}var yt=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||!bt(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),Gr(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=bt(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),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=Wr(s.cur,s.parts,i.parts,c),s.vel=Wr(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),Gr(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):l),s.done=bt(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=bt(c.from,c.to),this.tracks.set(i.key,c)}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=Le(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=$a(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=Le(s.from,c)),s.vel.length!==c&&(s.vel=Le(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-a*l),f=a*l>=8&&a*l<20,h=0;for(let m=0;m<c;m++){let g=s.from[m]-s.to[m],v=s.vel[m]+a*g;s.cur[m]=s.to[m]+(g+v*l)*u,s.curVel[m]=(s.vel[m]-a*v*l)*u,f&&h<.15&&(h=Math.max(h,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/a)))}d=a*l>=20||f&&h<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),f=r(u),h=Ma(this.easing,u)/o;for(let m=0;m<c;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*f,s.curVel[m]=(s.to[m]-s.from[m])*h;d=u>=1,s.progress=f}if(d){for(let u=0;u<c;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}},Ke=new Set,xt=0;function Vr(e){xt=0;let t=Array.from(Ke);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ke.delete(n)}Ke.size&&typeof requestAnimationFrame<"u"&&(xt=requestAnimationFrame(Vr))}function Kr(e){return Ke.add(e),!xt&&typeof requestAnimationFrame<"u"&&(xt=requestAnimationFrame(Vr)),()=>{Ke.delete(e)}}function Ta(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 Ur(e,t){let n=(0,G.useMemo)(()=>Ta(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,G.useRef)(null),f=(0,G.useRef)("init"),h=(0,G.useRef)(null),m=(0,G.useRef)(s),g=(0,G.useRef)(i),v=(0,G.useRef)(!1),x=(0,G.useRef)(0),[,M]=(0,G.useState)(0),C=(0,G.useRef)(null),R=(0,G.useRef)(!0);u.current||(u.current=new yt,u.current.configure(l,c),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(l,c),h.current!==n){let S=f.current,$=!Object.is(m.current,s);b.sameTargets(n)?b.refreshData(n):!r||S==="init"?b.snap(n):S==="idle"?b.hold(n):S==="running"||$?b.update(n,qe(),d):b.snap(n),h.current=n,m.current=s}let F=(0,G.useRef)(()=>!1);F.current=S=>{if(!R.current)return!1;let $=b.step(S);return!$&&f.current==="running"&&(f.current="done"),M(w=>(w+1)%1e9),$||(C.current=null),$};let P=(0,G.useCallback)(()=>{if(!ae||C.current||!b.animating)return;let S=$=>F.current($);C.current=Kr(S)},[b]);de(()=>{let S=!Object.is(g.current,i);if(g.current=i,!r){(f.current!=="done"||b.animating)&&(b.snap(h.current??n),f.current="done",M($=>$+1));return}f.current==="init"||S&&a?(b.hold(h.current??n),f.current="idle",v.current=!1,M($=>$+1)):S&&(v.current=!0)},[r,i]),de(()=>{!r||!a||!v.current||(v.current=!1,b.hold(h.current??n),f.current="idle",M(S=>S+1))},[a,r]),(0,G.useEffect)(()=>{r&&o&&f.current==="idle"&&(b.start(qe()),x.current+=1,f.current="running",P(),M(S=>S+1))},[r,o,i,b,P]),(0,G.useEffect)(()=>{b.animating&&P()}),(0,G.useEffect)(()=>(R.current=!0,()=>{R.current=!1,C.current?.(),C.current=null}),[]);let E=qe(),O=b.elapsed(E),k=r&&f.current==="idle";return{items:b.items(),get:S=>b.get(S),elapsed:k?0:O,fade:(S,$=320)=>k?0:Number.isFinite(O)?Math.max(0,Math.min(1,(O-S)/$)):1,waiting:k,animating:b.animating,generation:x.current}}var Qt=A(L(),1);function Yr(e,t,n,r,o){if(r)return o==="categorical"?se(e,t,n):Fn(e,t,n);if(o==="categorical")return se(e,t,n);let a=W(e,"strong"),i=W(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var Ca=A(H(),1);var en=A(L(),1);var qr=e=>e?"neutralStrong":"accent";var tn=A(L(),1);function Jr(e,t,n,r){if(typeof e!="function")return me(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 l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var Sa=A(H(),1);var rn=A(L(),1),Aa={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}, ${ge(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Zr={en:Aa,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}일 이동평균`}},nn=["ink","muted","dim"];function Qr(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,nn.length)}var Na=A(H(),1);var oo=A(L(),1),Fa={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${ge(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ra={en:Fa,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},eo=(e,t)=>Ra[e].other(t);function to(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,lr(o.map(a=>a.value)))}}var no=e=>Number.isFinite(e)&&e>0?e:0;function ro(e,t,n,r){return r==="emphasis"?Nn(e,t,n):se(e,t,n)}var kt=A(H(),1);var Y=A(L(),1),_a={kind:"Ridgeline",med:"Median",n:"Sample size",count:e=>`${e}`,summary:(e,t)=>`median ${e} (${ge(t,"value")})`,median:(e,t)=>`${e} median ${t}`,groups:e=>ge(e,"group")},Pa={en:_a,ko:{kind:"릿지라인",med:"중앙값",n:"표본",count:e=>`${e}개`,summary:(e,t)=>`중앙값 ${e}(${t}개)`,median:(e,t)=>`${e} 중앙값 ${t}`,groups:e=>`그룹 ${e}개`}},on=72;function an(e){let t=(0,kt.useMemo)(()=>ee(e.data.map((k,S)=>re(e.group,"group")(k,S))),[e.data,e.group]),n=jr(e,{height:()=>Math.max(180,Math.min(380,t.length*36+60)),duration:900,stagger:90}),{p:r,width:o,height:a}=n,i=Pa[n.lang],s=(0,kt.useMemo)(()=>{let k=re(e.group,"group"),S=_e(e.value,"value"),$=new Map;e.data.forEach((I,J)=>{let Ee=S(I,J);if(!Number.isFinite(Ee))return;let ln=k(I,J),cn=$.get(ln);cn?cn.push(Ee):$.set(ln,[Ee])});let w=t.filter(I=>$.has(I)),y=[...$.values()].flat(),[T,_]=Ce(y),D=we(T,_,4,{zero:!1,pad:.06}),U=Array.from({length:on},(I,J)=>D[0]+(D[1]-D[0])*J/(on-1)),he=new Map(w.map(I=>[I,Be([...$.get(I)].sort((J,Ee)=>J-Ee),.5)]));e.sort==="median"&&(w=[...w].sort((I,J)=>he.get(I)-he.get(J)));let z=w.map((I,J)=>({g:J,name:I,dens:zr($.get(I),U,e.bandwidth),median:he.get(I),n:$.get(I).length,hi:!1,datum:null})),q=me(e.highlight,w,w,z.map(I=>I.median),"max");z.forEach(I=>I.hi=q.has(I.g));let ie=Math.max(...z.flatMap(I=>I.dens),1e-9);return{ridges:z,dom:D,xsv:U,peak:ie}},[e.data,e.group,e.value,e.bandwidth,e.sort,e.highlight,t]),l=Math.min(o*.26,Math.max(...s.ridges.map(k=>pe(k.name,11.5,700)),20)+10),c=20,d=8,u=Math.max(1,s.ridges.length),f=Math.max(1e-6,e.overlap??1.5),h=(a-d-c)/(u-1+f),m=h*f,g=je(s.dom,[l+8,o-8]),v=k=>d+m+h*k,x=n.motion.stagger??90,M=(0,kt.useMemo)(()=>s.ridges.map((k,S)=>({key:`r:${k.name}`,to:k.dens.map($=>$/s.peak*m),from:k.dens.map(()=>0),enter:k.dens.map(()=>0),delay:S*x,data:k})),[s,m,x]),C=Ur(M,n.motion),R=W(r,"accent"),b=s.ridges.map(k=>({datum:null,index:k.g,key:k.name,label:k.name,value:k.median,formatted:i.summary(n.fv(k.median),k.n)})),F=null;if(n.active!==null&&s.ridges[n.active]){let k=s.ridges[n.active];F={x:g(k.median),y:v(k.g)-m*.6,title:k.name,rows:[{label:i.med,value:n.fv(k.median),color:k.hi?R.fill:r.paint("neutralStrong")},{label:i.n,value:i.count(k.n)}]}}let P=g.ticks(Math.max(2,Math.round(o/110))),E=n.motion.duration??900,O=e.description??`${i.kind}. ${i.groups(u)}: ${s.ridges.map(k=>i.median(k.name,n.fv(k.median))).join(", ")}.`;return(0,Y.jsxs)(Un,{c:n,kind:i.kind,ariaLabel:e.ariaLabel,description:O,events:b,tip:F,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(k,S,$)=>{let w=cr(s.xsv,g.invert(k)),y=-1;for(let T=s.ridges.length-1;T>=0;T--){let _=v(T),D=(s.ridges[T].dens[w]??0)/s.peak*m;if(S<=_+1&&S>=_-D-1){y=T;break}}y<0&&(y=Math.max(0,Math.min(u-1,Math.ceil((S-d-m)/h)))),y!==n.active&&n.setActive(y,$.pointerType==="touch"?"touch":"pointer")},children:[(0,Y.jsx)("g",{"aria-hidden":"true",children:P.map(k=>(0,Y.jsxs)("g",{children:[(0,Y.jsx)("line",{x1:g(k),x2:g(k),y1:d,y2:a-c,stroke:r.paint("line")}),(0,Y.jsx)(Ht,{x:g(k),y:a-c+11,anchor:"middle",size:He,fill:r.paint("muted"),children:n.fmt(k)})]},k))}),C.items.map(k=>{let S=k.data,$=v(S.g),w=k.v.map((D,U)=>`${g(s.xsv[U]).toFixed(2)},${($-D).toFixed(2)}`),y=`M${g(s.xsv[0]).toFixed(2)},${$}L${w.join("L")}L${g(s.xsv[on-1]).toFixed(2)},${$}Z`,T=`M${w.join("L")}`,_=n.active===S.g;return(0,Y.jsxs)("g",{className:"ztd-mark",opacity:k.exiting?.4:n.dim(S.g),children:[(0,Y.jsx)("path",{d:y,fill:S.hi?R.fill:r.paint("neutral"),fillOpacity:S.hi?.88:.92}),(0,Y.jsx)("path",{d:T,fill:"none",stroke:S.hi?R.fill:_?r.paint("ink"):r.paint("neutralStrong"),strokeWidth:S.hi||_?1.8:1.2,strokeLinejoin:"round"}),(0,Y.jsx)("line",{x1:l+8,x2:o-8,y1:$,y2:$,stroke:r.paint("line2")})]},k.key)}),s.ridges.map(k=>(0,Y.jsxs)("g",{pointerEvents:"none",children:[(0,Y.jsx)(Ht,{x:l,y:v(k.g)-6,anchor:"end",size:11.5,weight:k.hi?800:600,fill:r.paint(k.hi?"ink":"muted"),children:Kt(k.name,l-4,11.5,700)}),(0,Y.jsx)("line",{x1:g(k.median),x2:g(k.median),y1:v(k.g)-5,y2:v(k.g),stroke:r.paint(k.hi?"onAccent":"ink"),strokeWidth:1.6,opacity:C.fade(k.g*x+E*.6,260)})]},k.name))]})}var Da=A(H(),1);var lo=A(L(),1);function io(e,t){return t===!1?e.map((n,r)=>r):sr(e)}function ao(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return me(e,t,t,r,"max")}function so(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=W(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?W(e,"neutral"):Ze(e,1-i/Math.max(1,o.length-1))),r}function co(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ee(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function uo(e,t){return Ie(e,t+1,new Set)}var La=A(H(),1);var fo=A(L(),1);function mo(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Nr.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var be=A(L(),1);function ho(e,t,n){let r=ut(e);return r?.type==="scatter"&&t?.size!==void 0&&!ct(n)?ut("bubble"):r}function Ea(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 Oa(e,t,n,r=!1){let o=ho(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&jt.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(f=>!l.has(f.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=re(a.label,"label"),f=_e(a.value,"value"),h=o.type==="waffle",m=t.map((b,F)=>({r:b,label:u(b,F),value:h?f(b,F):no(f(b,F))})),{kept:g,other:v}=h?{kept:m,other:null}:to(m,i.other,(b,F)=>({r:{},label:eo(j(n),b),value:F})),x=me(s,g.map(b=>b.r),g.map(b=>b.label),g.map(b=>b.value),h?"first":"max"),M=v?[...g,v]:g,C=xe(b=>h?se(b,M.length,x):ro(b,M.length,x,i.colorMode)),R=h&&i.shape==="arc";return M.map((b,F)=>({label:b.label,color:C[F],...R&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Qr(Array.isArray(i.ma)?i.ma:void 0,t.length),f=Zr[j(n)];return[{label:f.up,color:i.upColor??"accent"},{label:f.down,color:i.downColor??"neutralStrong"},...u.map((h,m)=>({label:f.maLegend(h),color:nn[m],shape:"line"}))]}if(o.type==="network"){let u=co(i.groups);if(u.length<2)return[];let f=xe(h=>uo(h,u.length));return u.map((h,m)=>({label:h,color:f[m],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=re(a.group,"group"),f=ee(t.map((m,g)=>u(m,g)).filter(Boolean));if(f.length<2)return[];let h=xe(m=>Ie(m,f.length,new Set));return f.map((m,g)=>({label:m,color:h[g],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||ct(i))return[];let u=re(a.series,"series"),f=ee(t.map((g,v)=>u(g,v)));if(f.length<2)return[];let h=Jr(s,t,f,u),m=xe(g=>Ie(g,f.length,h));return c(f.map((g,v)=>({label:g,color:m[v],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",f=u?a.status:a.group;if(typeof f!="string")return[];let h=Br(t,f,u),m=xe(g=>se(g,h.length,mo(s,h)));return c(h.map((g,v)=>({label:g,color:m[v],shape:"square"})))}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 C=re(a.series,"series");u=ee(t.map((R,b)=>C(R,b)))}let f=Gt(o.type,a,i);if(f.length){let C=me(s,u,u,u.map(()=>0),"none"),R=xe(F=>se(F,u.length,C)),b=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((F,P)=>({label:F,color:R[P]}));return[...c(b),...f.map((F,P)=>({label:F,color:qr(P),shape:"line"}))]}if(u.length<2)return[];let m=o.type==="bar"&&i.layout==="diverging"&&s===void 0?ar(u.length,Array.isArray(i.negative)?i.negative.map(C=>u.indexOf(String(C))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,g=m>=0?new Set([m]):me(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((C,R)=>({label:C,color:g.has(R)?"accent":"neutralStrong",shape:"square"})));let v=i.colorMode,x=C=>se(C,u.length,g);if((o.type==="line"||o.type==="area")&&(x=C=>Yr(C,u.length,g,o.type==="area",v)),o.type==="stream"){let C=Ge(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),R=io(C.values,i.reorder),b=ao(s,C.series,C.values);x=F=>so(F,R,b)}let M=xe(x);return c(u.map((C,R)=>({label:C,color:M[R],...o.type==="line"&&{shape:"line"}})))}return[]}function Ia(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Zn.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function za(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function go(e,t){let{spec:n}=e,r=ho(n.type,n.encoding,n.options),o=(0,Ue.useMemo)(()=>Hr(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Jn(n,e.locale),s=Z(i),l=j(s),c=Fr(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=tr(n),u=(0,Ue.useMemo)(()=>d?Or(d,s):void 0,[d,s]),f=n.options?.hidden,h=Array.isArray(f)?f.map(String):[],m=h.join(""),[g,v]=(0,Ue.useState)(null);if(!r)return(0,be.jsx)(Bt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=o??c.data,M=t[r.type],C={...n.options??{}},R={...Ea(r,n.encoding),...C,...u?{tooltip:u}:{},data:x,...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},b=n.card?.legend==="toggle"&&er(r.type,n.encoding??{},C),F=g&&g.base===m?g.hidden:h;b&&(R.hidden=F);let P=$=>v(w=>{let y=w&&w.base===m?w.hidden:h;return{base:m,hidden:y.includes($)?y.filter(T=>T!==$):[...y,$]}}),E=R.height??220,O=Ia(n,r.type),k=a&&!x.length&&(c.loading||c.error||c.empty)?(0,be.jsx)(Bt,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:E,locale:i}):O?(0,be.jsx)(Ar,{chart:M,...za(r.type,O,R)}):(0,be.jsx)(M,{...R});if(n.card){let $=n.card,w=$.legend==="auto"||$.legend==="toggle"?Oa(n,x,s,b):$.legend,y=w?.length?b?(0,be.jsx)(zt,{items:w,hidden:F,onToggle:P,locale:i}):w:void 0,T=$.download?(0,be.jsx)(Er,{data:x,columns:nr(n),filename:$.title??r.type,formats:Array.isArray($.download)?$.download:void 0,locale:i}):void 0;k=(0,be.jsx)(Kn,{number:$.number,title:$.title??qn(r,l),subtitle:$.subtitle,legend:y,actions:T,source:$.source||void 0,note:$.note||void 0,accent:$.accent,takeaway:$.takeaway,level:$.level,sample:$.sample,replay:$.replay!==!1,className:e.className,locale:i,children:k})}let S=e.theme??n.theme;return S&&(k=(0,be.jsx)(ot,{theme:S,children:k})),k}function Ba({cfg:e,components:t}){let n=Pe();return go({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function bo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,po.hydrateRoot)(r,(0,sn.createElement)(ot,{theme:o.theme,cssVars:!0},(0,sn.createElement)(Ba,{cfg:o,components:{[e]:t}})))}bo("ridgeline",an);})();