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