ztd-charts-cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/api.d.ts +23 -1
  2. package/dist/api.js +5 -1
  3. package/dist/{chunk-LVCEIXBR.js → chunk-4K4P2AWW.js} +50 -19
  4. package/dist/cli.js +2 -1
  5. package/dist/client/area.js +28 -0
  6. package/dist/client/bar.js +28 -0
  7. package/dist/client/beeswarm.js +28 -0
  8. package/dist/client/box.js +28 -0
  9. package/dist/client/bubble.js +28 -0
  10. package/dist/client/bullet.js +28 -0
  11. package/dist/client/bump.js +28 -0
  12. package/dist/client/calendar.js +28 -0
  13. package/dist/client/candlestick.js +28 -0
  14. package/dist/client/chord.js +28 -0
  15. package/dist/client/donut.js +28 -0
  16. package/dist/client/dumbbell.js +28 -0
  17. package/dist/client/funnel.js +28 -0
  18. package/dist/client/gauge.js +28 -0
  19. package/dist/client/heatmap.js +28 -0
  20. package/dist/client/histogram.js +28 -0
  21. package/dist/client/line.js +28 -0
  22. package/dist/client/lollipop.js +28 -0
  23. package/dist/client/marimekko.js +28 -0
  24. package/dist/client/parallel.js +28 -0
  25. package/dist/client/pareto.js +28 -0
  26. package/dist/client/pie.js +28 -0
  27. package/dist/client/radar.js +28 -0
  28. package/dist/client/radialBar.js +28 -0
  29. package/dist/client/react.js +66 -0
  30. package/dist/client/ridgeline.js +28 -0
  31. package/dist/client/sankey.js +28 -0
  32. package/dist/client/scatter.js +28 -0
  33. package/dist/client/segmented.js +28 -0
  34. package/dist/client/skyline.js +28 -0
  35. package/dist/client/slope.js +28 -0
  36. package/dist/client/sparkline.js +28 -0
  37. package/dist/client/stream.js +28 -0
  38. package/dist/client/sunburst.js +28 -0
  39. package/dist/client/treemap.js +28 -0
  40. package/dist/client/waffle.js +28 -0
  41. package/dist/client/waterfall.js +28 -0
  42. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ (()=>{var Qn=Object.create;var bt=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty;var Ke=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var or=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tr(t))!rr.call(e,o)&&o!==n&&bt(e,o,{get:()=>t[o],enumerable:!(r=er(t,o))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?Qn(nr(e)):{},or(t||!e||!e.__esModule?bt(n,"default",{value:e,enumerable:!0}):n,e));var j=Ke((Qo,yt)=>{yt.exports=globalThis.__ztdReact.react});var kt=Ke((ea,xt)=>{xt.exports=globalThis.__ztdReact["react-dom/client"]});var L=Ke((ma,Wt)=>{Wt.exports=globalThis.__ztdReact["react/jsx-runtime"]});var pt=A(j(),1),Xn=A(kt(),1);var Ce=A(j(),1);var Ee=A(j(),1);var vt=A(j(),1),$e=(0,vt.createContext)(void 0);var sr=A(j(),1);var ar=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],wt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Ct='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ie={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},ir={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},We={dark:ie,light:ir};function Ge(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Ue(e){let t={};for(let n of ar){let r=e[n];typeof r=="string"&&(t[Ge(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function Ye(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var lr=`
2
+ .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
+ .ztd-root:focus{outline:none}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ie.accent});outline-offset:3px;border-radius:6px}
5
+ .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
+ .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
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)}
8
+ .ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
9
+ .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
+ .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
+ .ztd-btn:focus{outline:none}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ie.accent});outline-offset:2px}
13
+ .ztd-card{transition:border-color .16s ease}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${ie.dim})}
15
+ @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
+ @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
+ @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
18
+ .ztd-pop{transform-box:fill-box;transform-origin:center}
19
+ @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
+ .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
+ @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
+ `;var $t=!1;function ke(){if($t||typeof document>"u"||($t=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=lr,document.head.appendChild(e)}var Te=A(j(),1),re=typeof window<"u"&&typeof document<"u",te=re?Te.useLayoutEffect:Te.useEffect;function Se(){return typeof performance<"u"?performance.now():Date.now()}function H(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function de(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Tt={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},St={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ur=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],cr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function mr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function dr(e){return mr(ur,e)}function Mt(e,t){let n=dr(e);return{text:n?n[t]:e,...cr[n?.id??"basic"]}}var Z=A(j(),1);var Dt=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),X="en-US",At=new Map;function qe(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=At.get(r);return o||(o=new Intl.NumberFormat(e,n),At.set(r,o)),o}function Xe(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ze(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;return Xe(qe(n,r).format(e))}var Pt=e=>e!==0&&Math.abs(e)<.05,Lt=(e,t,n="")=>`${Ze(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Me(e,t={}){if(!Number.isFinite(e))return"-";if(Pt(e)&&t.maximumFractionDigits===void 0)return Lt(e,t.locale??X,"%");let n=Math.abs(e);return`${Ze(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function fr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;if(H(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,c]=a[i],u=o/s,y=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),f=Math.round(u*10**y)/10**y;if(i>0&&f>=a[i-1][0]/s){i--;continue}return(e<0&&f!==0?"-":"")+Ze(f,{locale:n,...r,maximumFractionDigits:y})+c}}return Xe(qe(n,{notation:"compact",...r}).format(e))}var hr=(e,t=H(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ae(e,t=X,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=qe(t,o);return c=>Number.isFinite(c)?`${i}${Xe(s.format(c))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Me(o,{locale:t});case"ratio":return o=>Me(o*100,{locale:t});case"compact":return o=>fr(o,{locale:t});case"currency":return r(hr(t));default:{let o=r({maximumFractionDigits:1});return a=>Pt(a)?Lt(a,t):o(a)}}}function gr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Je=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,pr=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,br=["january","february","march","april","may","june","july","august","september","october","november","december"],Rt=e=>{let t=e.toLowerCase();return t.length<3?0:br.findIndex(n=>n.startsWith(t))+1},Nt=e=>+e+(+e<30?2e3:1900);function Et(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var yr=[/^(\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})일)?$/],_t=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Ot=/\{([^{}]+)\}/g;function Re(e,t){let n;for(let r of yr)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[Nt(n[3]),+n[2],+n[1],1]:[Nt(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=_t.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Rt(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=Rt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var It=e=>pr.test(e)||Re(e)!==null;function Bt(e){let t;for(let n of e){let r=typeof n=="string"?_t.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Ne(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(Je(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Ne(`${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=Re(n,t);if(r)return gr(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 Ft=new Map;function zt(e,t={month:"short",day:"numeric"}){let n=Ne(e);if(!n)return"-";let{locale:r=X,...o}=t,a=r+JSON.stringify(o),i=Ft.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Ft.set(a,i)),i.format(n)}var Ht={white:"#ffffff",black:"#000000",transparent:"#00000000"};function jt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Ht[t.toLowerCase()]&&(t=Ht[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function xr(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Qe(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kr(e){return[Qe(e[0]),Qe(e[1]),Qe(e[2])]}function et(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 Vt(e){let[t,n,r]=kr(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function vr([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[et(4.0767416621*o-3.3077115913*a+.2309699292*i),et(-1.2684380046*o+2.6097574011*a-.3413193965*i),et(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Kt(e,t,n){let r=jt(e),o=jt(t);if(!r||!o)return e;let a=Vt(r),i=Vt(o),s=Math.max(0,Math.min(1,n));return xr(vr([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}var tt=A(L(),1),Fe=(0,Z.createContext)({theme:ie,cssVars:!0});function wr(e,t=ie){return e?typeof e=="string"?We[e]??t:Ye(t,e):t}function Pe(e){let t=(0,Z.useContext)(Fe),n=e.base?We[e.base]:t.theme,r=(0,Z.useMemo)(()=>wr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,Z.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,Z.useMemo)(()=>Ue(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,tt.jsx)(Fe.Provider,{value:i,children:(0,tt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var Cr=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function De(e){return Cr.has(e)}function $r(e,t){let n=r=>t?`var(${Ge(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?De(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?De(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:Kt(e[r],e[o],a)}}}function oe(e){let t=(0,Z.useContext)(Fe);return(0,Z.useMemo)(()=>{let n=Ye(t.theme,e);return $r(n,t.cssVars)},[t.theme,t.cssVars,e])}function J(e){let t=(0,Z.useContext)(Fe);return e??t.locale??X}function Gt(e){return e?Ue(e):{}}var Le=A(j(),1),nt=(0,Le.createContext)(void 0);function Ut(e){let t=(0,Le.useContext)(nt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var k=A(L(),1),Tr={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},Sr={en:Tr,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Mr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},rt=e=>Sr[H(J(e))];function ot(e){let t=oe(e.theme),n=rt(e.locale),[r,o]=(0,Ee.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),c=e.items.filter(y=>!s.has(y.label)).length,u=(0,k.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((y,f)=>{let p=!s.has(y.label),x=p&&c===1,m=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ar,{p:t,item:y,off:!p}),(0,k.jsx)("span",{style:p?void 0:{textDecoration:"line-through"},children:y.label})]});return(0,k.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,k.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":p,"aria-disabled":x||void 0,onClick:()=>{x||(i(y.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:x?"default":void 0},children:m}):m},f)})});return i?(0,k.jsxs)(k.Fragment,{children:[u,(0,k.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Mr,children:r?n.shown(c,e.items.length):""})]}):u}function Ar({p:e,item:t,off:n}){let r=t.color?De(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,k.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,k.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,k.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,k.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function Rr(e){let t=oe(e.theme),n=Mt(e.level,H(J(e.locale)));return(0,k.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Nr(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,k.jsxs)(k.Fragment,{children:[e.slice(0,r),(0,k.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Yt(e){let t=oe(e.theme),n=rt(e.locale),[r,o]=(0,Ee.useState)(0);te(()=>ke(),[]);let a=()=>{o(p=>p+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,k.jsx)(ot,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,u=e.replay||e.onReplay,y=e.source!==void 0||e.note!==void 0?(0,k.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,f=e.takeaway!==void 0||e.level||e.sample?(0,k.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,k.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,k.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,k.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,k.jsx)(Rr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,k.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,k.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,k.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,k.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Nr(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,k.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,k.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,k.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,k.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,k.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,k.jsx)("span",{}),i]}):null]}),(0,k.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,k.jsx)(nt.Provider,{value:r,children:(0,k.jsx)($e.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),y?(0,k.jsxs)(k.Fragment,{children:[y,f]}):f]})}function at(e){let t=oe(e.theme),n=rt(e.locale),r=e.height??220;if(te(()=>ke(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,k.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,k.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,k.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,k.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,k.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,k.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,k.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,k.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,k.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,k.jsx)(k.Fragment,{children:e.children})}function se(e,t,n,r,o="max"){let a=new Set,i=n.length,s=u=>{if(i&&u!=="none"){if(u==="first")a.add(0);else if(u==="last")a.add(i-1);else if(u==="max"||u==="min"){let y=-1,f=u==="max"?-1/0:1/0;r.forEach((p,x)=>{Number.isFinite(p)&&(u==="max"?p>f:p<f)&&(f=p,y=x)}),y>=0&&a.add(y)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((u,y)=>{y<i&&u!==null&&u!==void 0&&e(u,y)&&a.add(y)}),a;let c=Array.isArray(e)?e:[e];for(let u of c)typeof u=="number"?u>=0&&u<i&&a.add(u):u==="max"||u==="min"||u==="first"||u==="last"||u==="none"?s(u):n.forEach((y,f)=>{y===u&&a.add(f)});return a}function qt(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 ve(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function Xt(e,t){return ve(e+1,t).slice(0,e)}function Zt(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Fr(e,t){if(e==null||typeof e!="object")return;let n=e;if(Zt(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Zt(r,o))return;r=r[o]}return r}}function ae(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 he(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Fr(r,n)}function Jt(e,t){let n=he(e,t);return(r,o)=>ae(n(r,o))}function _e(e,t){let n=he(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function ge(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var Y=A(j(),1);function Dr(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let u=e[c];if(u==='"')n=!n;else if(!n&&(u===`
23
+ `||u==="\r"))break;t.push(n?"":u)}let r=t.join(""),o=c=>r.split(c).length-1,a=[","," ",";","|"],i=",",s=0;for(let c of a){let u=o(c);u>s&&(s=u,i=c)}return i}var Pr=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Qt(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Pr.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ae(t);if(Number.isFinite(n))return n}return t}function fe(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Dr(o),i=[],s=[],c="",u=!1;for(let m=0;m<o.length;m++){let b=o[m];u?b==='"'?o[m+1]==='"'?(c+='"',m++):u=!1:c+=b:b==='"'&&!c.trim()?(u=!0,c=""):b===a?(s.push(c),c=""):b===`
24
+ `||b==="\r"?(b==="\r"&&o[m+1]===`
25
+ `&&m++,s.push(c),i.push(s),s=[],c=""):c+=b}(c!==""||s.length)&&(s.push(c),i.push(s));let y=i.filter(m=>!(m.length===1&&m[0].trim()===""));if(!y.length)return[];let f=m=>n?Qt(m):m;if(!r)return y.map(m=>Object.fromEntries(m.map((b,$)=>[String($),f(b)])));let p=[],x=new Set;return y[0].forEach((m,b)=>{let $=m.trim()||`col${b+1}`,v=$;for(let T=2;x.has(v);T++)v=`${$}_${T}`;x.add(v),p.push(v)}),y.slice(1).map(m=>Object.fromEntries(p.map((b,$)=>[b,f(m[$]??"")])))}function it(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof i[c]=="string"?Qt(i[c]):i[c]??null])))}function Lr(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,c)=>Object.fromEntries(a.map(u=>[u,e[u][c]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function en(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 le(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return le(JSON.parse(t))}catch{}return fe(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?it(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?le(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?it(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?le(t.rows):Array.isArray(t.values)?it(t.values):Array.isArray(t.items)?le(t.items):Array.isArray(t.results)?le(t.results):Lr(t)}return[]}function tn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}async function Er(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(H(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return fe(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return fe(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):fe(a)}async function _r(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await Er(a,t.parse,o,t.locale)}return t.select&&(r=en(r,t.select)),t.transform?t.transform(r):le(r)}function nn(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Y.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,Y.useState)(0),u=J(t.locale),y=(0,Y.useRef)(t);y.current={...t,locale:u};let f=(0,Y.useRef)(e);f.current=e;let p=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",x=t.deps??[],m=JSON.stringify(x.map(v=>typeof v=="object"?JSON.stringify(v):String(v))),b=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{let v=f.current;if(!v||!r){i(M=>M.status==="loading"?{...M,status:"idle"}:M);return}let T=new AbortController,F=!0;return b.current=!0,i(M=>({...M,data:o?M.data:[],status:"loading",error:null})),_r(v,{...y.current,signal:T.signal}).then(M=>{F&&i({data:M,status:"success",error:null,updatedAt:Date.now()})}).catch(M=>{!F||T.signal.aborted||i(S=>({...S,status:"error",error:M instanceof Error?M:new Error(String(M))}))}).finally(()=>{F&&(b.current=!1)}),()=>{F=!1,b.current=!1,T.abort()}},[p,r,s,m,o]),(0,Y.useEffect)(()=>{if(!n||!r)return;let v=setInterval(()=>{b.current||c(T=>T+1)},n);return()=>clearInterval(v)},[n,r]);let $=(0,Y.useCallback)(()=>c(v=>v+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:$}}var lt=A(L(),1),Or=["csv","svg","png"],Ir=/^[=+\-@\t\r\n=+-@]/,Br=/var\(|color-mix\(/;function rn(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Et(e.getTime()):String(e);return`"${(Ir.test(t)&&!Number.isFinite(ae(t))?`'${t}`:t).replace(/"/g,'""')}"`}function zr(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Hr(e,t){return`\uFEFF${[t.map(rn),...e.map(r=>t.map(o=>rn(r[o])))].map(r=>r.join(",")).join(`\r
26
+ `)}\r
27
+ `}function jr(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function st(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var on=2,ue=16;function an(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function sn(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 ln(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,c]=[a+ue*2,i+ue*2],u=o.cloneNode(!0),y=u.querySelectorAll("*"),f=new Map;o.querySelectorAll("*").forEach((m,b)=>{let $;for(let v of Array.from(m.attributes)){if(!Br.test(v.value))continue;let T=($??($=getComputedStyle(m))).getPropertyValue(v.name);T&&y[b].setAttribute(v.name,an(T,f))}}),u.removeAttribute("style");for(let[m,b]of Object.entries({viewBox:`${-ue} ${-ue} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(m,String(b));let p=an(getComputedStyle(r).backgroundColor,f),x=o.parentElement?.querySelector("canvas")??null;if(n){let m=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(sn("rect",{x:-ue,y:-ue,width:s,height:c,fill:p}),m),x&&u.insertBefore(sn("image",{href:x.toDataURL(),width:a,height:i}),m)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:c,vw:a,vh:i,bg:p,canvas:x}}function Vr(e,t){let n=ln(e,on,!1);if(!n)return;let r=on,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,ue*r,ue*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(c=>c&&st(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function un(e){let t=oe(e.theme),n=H(J(e.locale))==="ko",r=jr(e.filename),o=(a,i)=>{if(a==="csv")return st(new Blob([Hr(e.data,e.columns?.length?e.columns:zr(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Vr(i,r);let s=ln(i,1,!0);s&&st(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,lt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Or.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,lt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(a,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var mn=A(L(),1);function cn(e,t=X){let n=Ae(void 0,t),r=e.split(`
28
+ `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?zt(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let c=!1,u=s.replace(Ot,(y,f)=>o(a,f.trim())??(c=!0,""));c||i.push(u)}return i.length?i.map((s,c)=>(0,mn.jsx)("div",{children:s},c)):null}}var h=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Q=h("label","string",!0,"Item name field"),W=h("value","number",!0,"Value field"),Kr=[Q,W],Wr=[Q,W],Gr=[h("label","string",!0,"Stage name"),h("value","number",!0,"Users at the stage")],Ur=[Q,W],Yr=[h("label","string",!0,"Leaf (lowest level) name"),W,h("group","string",!1,"Parent group field")],qr=[h("label","string",!0,"Leaf name"),W,h("group","string",!1,"Parent group field")],Xr=[Q,h("value","number",!0,"Change (total rows may omit it)"),h("type","string",!1,'"total" makes a total bar')],Zr=[Q,W],Jr=[h("x","string",!0,"Column field"),h("series","string",!0,"Stacked series field"),W],Qr=[h("x","string",!0,"Column field"),h("y","string",!0,"Row field"),W],eo=[h("axis","string",!0,"Metric (axis) field"),h("value","number",!0,"Value field",{multi:!0}),h("series","string",!1,"Series field")],to=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("size","number",!1,"Circle size"),h("label","string",!1,"Name")],fn=h("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),no=[h("x","any",!0,"x field (date, number or category)"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables)"),h("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),fn],ro=[h("x","any",!0,"x field"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("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}),fn],oo=[h("x","any",!0,"x field"),h("y","number",!0,"y field",{multi:!0}),h("series","string",!1,"Series field")],ao=[h("x","string",!0,"Category field"),h("y","number",!0,"Value field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],io=[Q,W],so=[h("value","number",!0,"Value field",{prop:"valueKey"}),h("target","number",!1,"Target field",{prop:"targetKey"})],lo=[Q,h("value","number",!0,"Actual value field"),h("target","number",!1,"Target field")],uo=[h("x","any",!1,"x field"),h("y","number",!0,"y field")],co=[Q,h("x","string",!1,"Period field (long tables)"),h("value","number",!1,"Value field (long tables)")],mo=[Q,h("start","number",!0,"Before value"),h("end","number",!0,"After value")],fo=[Q,W],ho=[h("value","number",!0,"Value field"),h("group","string",!1,"Group (row) field"),h("label","string",!1,"Dot name")],go=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],po=[h("source","string",!0,"Source node"),h("target","string",!0,"Target node"),W],bo=[h("source","string",!0,"Sending group"),h("target","string",!0,"Receiving group"),W],yo=[h("date","date",!0,"Date field"),W],xo=[h("x","any",!0,"Period field"),h("series","string",!0,"Item field"),h("rank","number",!1,"Rank field (1 is first)"),h("value","number",!1,"Value field (instead of rank, largest is first)")],ko=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],vo=[h("label","string",!1,"Row name field")],wo=[h("x","date",!0,"Date (period) field"),h("open","number",!0,"Open price field"),h("high","number",!0,"High price field"),h("low","number",!0,"Low price field"),h("close","number",!0,"Close price field"),h("volume","number",!1,"Volume field")],Co=[Q,W],$o=[h("x","any",!0,"Period field (date or category)"),h("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables, back row only)"),h("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],To=[h("value","number",!1,"Sample value field (raw rows)"),h("group","string",!1,"Group field. Up to 2 groups overlap"),h("x0","number",!1,"Bin start (pre-binned rows)"),h("x1","number",!1,"Bin end (pre-binned rows)"),h("count","number",!1,"Samples in the bin (pre-binned rows)")],So=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("series","string",!1,"Series field (one color per series)"),h("label","string",!1,"Name")],dn={pie:Kr,donut:Wr,funnel:Gr,waffle:Ur,treemap:Yr,sunburst:qr,waterfall:Xr,pareto:Zr,marimekko:Jr,heatmap:Qr,radar:eo,bubble:to,line:no,area:ro,stream:oo,bar:ao,radialBar:io,gauge:so,bullet:lo,sparkline:uo,slope:co,dumbbell:mo,lollipop:fo,beeswarm:ho,ridgeline:go,sankey:po,chord:bo,calendar:yo,bump:xo,box:ko,parallel:vo,candlestick:wo,segmented:Co,skyline:$o,histogram:To,scatter:So},pe={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 hn(e,t){return t==="ko"?e.nameKo:e.name}function gn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var ut=["line","area","bar","scatter"];function ct(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function pn(e,t,n){return ut.includes(e)&&!ct(e,t,n).length}function bn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Mo={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram"};function Oe(e){let t=dn[e]?e:Mo[e]??Object.keys(pe).find(n=>n.toLowerCase()===e.toLowerCase()||pe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!pe[t]))return{type:t,component:pe[t].component,name:pe[t].name,nameKo:pe[t].nameKo,encoding:dn[t]}}function yn(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of Oe(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}var be=Math.PI*2;function xn(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ce(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function kn(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 fe(t.csv)}return null}var G=A(j(),1);var D=A(L(),1),Ie=60;var vn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function wn(e){let{c:t,events:n}=e,r=(0,G.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,te(()=>{ke()},[]);let i=n.length,s=!e.noNav&&i>0,c=(0,G.useContext)($e),u=e.ariaLabel??c??e.kind,y=(0,G.useMemo)(()=>s?`${n.length}${n.slice(0,Ie).map(l=>`${l.label}${l.series??""}${l.formatted??l.value??""}`).join("")}`:"",[n,s]),f=(0,G.useMemo)(()=>(0,D.jsx)(Ao,{label:u,events:n,t:t.t}),[u,y,t.t]),p=(0,G.useRef)(null);(0,G.useEffect)(()=>{let l=()=>{p.current=null};return window.addEventListener("scroll",l,{capture:!0,passive:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("scroll",l,{capture:!0}),window.removeEventListener("resize",l)}},[]),(0,G.useEffect)(()=>{p.current=null},[t.width,t.height]);let x=l=>{if(l.target!==l.currentTarget)return;if(e.onKey?.(l)){l.preventDefault();return}let g=t.active,C;switch(l.key){case"ArrowRight":case"ArrowDown":C=g===null?0:(g+1)%i;break;case"ArrowLeft":case"ArrowUp":C=g===null?i-1:(g-1+i)%i;break;case"Home":C=0;break;case"End":C=i-1;break;case"Escape":if(g===null)return;C=null;break;case"Enter":case" ":g!==null&&(l.preventDefault(),t.click(g));return;default:return}l.preventDefault(),t.setActive(C,"keyboard")},{via:m,node:b,setActive:$}=t;(0,G.useEffect)(()=>{if(m!=="touch"||!b)return;let l=g=>{b.contains(g.target)||$(null)};return document.addEventListener("pointerdown",l),()=>document.removeEventListener("pointerdown",l)},[m,b,$]);let v=t.active!==null?n[t.active]:null,T=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,F=T&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,M=typeof e.renderTip=="function"&&v?e.renderTip(v):null,S=e.announce??(t.via==="keyboard"&&v?`${v.label}${v.series?` ${v.series}`:""}: ${v.formatted??v.value??""} (${(t.active??0)+1}/${i})`:""),O;if(T){let l=T.x*F,g=t.width*F,C=`clamp(${(4-l).toFixed(1)}px, -50%, calc(${(g-l-4).toFixed(1)}px - 100%))`,R=T.y<64;O={position:"absolute",left:l,top:T.y*F,transform:`translate(${C}, ${R?"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*F-8)}}let K=l=>{p.current=null,l.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=l=>l?g=>{let C=p.current??(p.current=g.currentTarget.getBoundingClientRect());C.width&&l((g.clientX-C.left)/C.width*t.width,(g.clientY-C.top)/C.height*t.height,g)}:void 0,I=E(e.onPointerMove),_=E(e.onPointerDown),w=I||_?l=>{l.pointerType==="touch"&&I?.(l),_?.(l)}:void 0,N=E(e.onPointerUp),d=Gt(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":u,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?x:void 0,onBlur:l=>{t.via==="keyboard"&&!l.currentTarget.contains(l.relatedTarget)&&t.setActive(null)},onPointerLeave:K,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"),...d,...e.style},children:[t.pending?null:e.underlay,(0,D.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:I,onPointerDown:w,onPointerUp:N,onPointerCancel:N,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,D.jsx)("title",{id:o,children:u}),(0,D.jsx)("desc",{id:a,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,T?(0,D.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:O,children:M??(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:T.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:T.title}),T.rows.map((l,g)=>(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(l.strong?"ink":"muted")},children:[l.color?(0,D.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:l.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,l.label]}),(0,D.jsx)("span",{style:{fontWeight:l.strong===!1?500:700},children:l.value})]},g))]})}):null,(0,D.jsx)("span",{className:"ztd-sr",style:vn,"aria-live":"polite","aria-atomic":"true",children:S}),s&&!t.pending?f:null]})}function Ao({label:e,events:t,t:n}){return(0,D.jsx)("div",{className:"ztd-sr",style:vn,children:(0,D.jsxs)("table",{children:[(0,D.jsx)("caption",{children:n.table(e)}),(0,D.jsxs)("tbody",{children:[t.slice(0,Ie).map((r,o)=>(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??""})]},o)),t.length>Ie?(0,D.jsx)("tr",{children:(0,D.jsx)("td",{colSpan:2,children:n.more(t.length-Ie)})}):null]})]})})}function mt(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 Ro(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Cn(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 Be=new Map;function $n(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=Be.get(o);if(a===void 0){let i=0,s=0;for(let c=0;c<r.length;c++){let u=r.charCodeAt(c);Ro(u)?i+=Cn(u):s+=Cn(u)}a=i+s*(n>=600?1.07:1),Be.size>5e3&&Be.clear(),Be.set(o,a)}return a*t}function No(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 Tn(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.25]:[o*1.25,0];let i=No(a-o,n);return[Math.floor(o/i+1e-9)*i,Math.ceil(a/i-1e-9)*i]}function Sn(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let c=o(i);return c>=0?(r[c]||(a[c]=t(c),r[c]=1),a[c]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var Fo=(e,t,n)=>e==="date"?Ne(t,n)?.getTime()??NaN:ae(t);function Do(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&It(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Mn(e,t,n,r,o={}){let a=he(t,"x"),i=Array.isArray(n),s=i?n:null,c=i?null:he(n,"y"),u=!i&&r!==void 0?he(r,"series"):null,y=e.map((d,l)=>a(d,l)),f=o.xType??Do(y),p=o.locale??X,x,m,b;if(f==="band"){let d=y.map(g=>String(g??""));x=ge(d);let l=new Map(x.map((g,C)=>[g,C]));m=x.map((g,C)=>C),b=Int32Array.from(d,g=>l.get(g)??-1)}else{let d=f==="date"?o.dayFirst??Bt(y):void 0,l=y.map(R=>Fo(f,R,d)),g=Array.from(new Set(l.filter(R=>Number.isFinite(R)))).sort((R,V)=>R-V),C=new Map(g.map((R,V)=>[R,V]));m=g,x=g.map(String),b=Int32Array.from(l,R=>C.get(R)??-1)}let $=o.dateFormat,v=d=>typeof d=="string"?Re(d.trim())?.[3]:void 0,T=f==="date"&&y.length<5e3?v(y[0]):void 0,F=(T===2||T===3)&&y.every(d=>v(d)===T),M=F&&T===3;if(f==="date"&&!$){let d=m.length>1?m[m.length-1]-m[0]:0;$=F&&T===2||d>864e5*120?{month:"short"}:d<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},d>864e5*800&&($={year:"numeric",month:"short"})}let S;if(f==="band")S=x;else if(M&&!o.dateFormat){let d=H(p)==="ko";S=m.map(l=>{let g=new Date(l),C=Math.floor(g.getMonth()/3)+1;return d?`${g.getFullYear()}년 ${C}분기`:`Q${C} ${g.getFullYear()}`})}else{let d=m.every(Je),l=f==="date"?new Intl.DateTimeFormat(p,$):new Intl.NumberFormat(p,d?{useGrouping:!1}:{maximumFractionDigits:6});S=m.length>1e3?Sn(m.length,g=>l.format(m[g])):m.map(g=>l.format(g))}let O=s?[...s]:u?ge(e.map((d,l)=>String(u(d,l)??""))):[""],K=new Map(O.map((d,l)=>[d,l])),E=O.map(()=>new Array(x.length).fill(NaN)),I=O.map(()=>new Array(x.length).fill(null)),_=o.aggregate??"sum",w=_==="mean"?O.map(()=>new Uint32Array(x.length)):null,N=(d,l,g,C)=>{let R=E[d][l];_==="last"?E[d][l]=g:_==="count"?E[d][l]=(Number.isFinite(R)?R:0)+1:_==="mean"?Number.isFinite(g)&&(E[d][l]=(Number.isFinite(R)?R:0)+g,w[d][l]++):E[d][l]=Number.isFinite(R)?R+(Number.isFinite(g)?g:0):g,I[d][l]=C};for(let d=0;d<e.length;d++){let l=b[d];if(l<0)continue;let g=e[d];if(s)for(let C=0;C<s.length;C++)N(C,l,ae(g[s[C]]),g);else{let C=u?K.get(String(u(g,d)??""))??0:0;N(C,l,ae(c(g,d)),g)}}if(w)for(let d=0;d<E.length;d++)for(let l=0;l<x.length;l++)w[d][l]>1&&(E[d][l]/=w[d][l]);return{type:f,keys:x,xnum:m,labels:S,series:O,values:E,rows:I}}var z=A(j(),1);var U=A(j(),1);function Po(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Lo(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Nn(e,t=!0){let[n,r]=(0,U.useState)({visible:!t,near:!t});return(0,U.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=Lo(i[i.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Po(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function An(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Fn(e){let[t,n]=(0,U.useState)(null),[r,o]=(0,U.useState)(e??null),a=(0,U.useCallback)(i=>{n(i),i&&e===void 0&&o(An(i))},[e]);return te(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=u=>o(y=>y!==null&&Math.abs(y-u)<.5?y:u),s=()=>i(An(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(u=>{let y=u[u.length-1]?.contentRect;y?i(y.width>0?Math.round(y.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,a,r]}var Eo=()=>()=>{};function ze(){return(0,U.useSyncExternalStore)(Eo,()=>!0,()=>!1)}var Rn="(prefers-reduced-motion: reduce)";function Dn(e="auto"){let[t,n]=(0,U.useState)(()=>re&&typeof window.matchMedia=="function"?window.matchMedia(Rn).matches:!1);return(0,U.useEffect)(()=>{if(e!=="auto"||!re||typeof window.matchMedia!="function")return;let r=window.matchMedia(Rn),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function Pn(e,t){let n=oe(e.theme),[r,o,a]=Fn(e.width),i=ze(),s=e.width??(a||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,u=e.height??c,y=Dn(e.reducedMotion??"auto"),f=e.animate!==!1&&!y&&re,p=Nn(r,e.animateOnView!==!1&&f),x=J(e.locale),m=H(x),b=(0,z.useMemo)(()=>Ae(e.format,x,t.format),[e.format,x,t.format]),$=(0,z.useCallback)(P=>Me(P,{locale:x}),[x]),v=(0,z.useMemo)(()=>Dt(b,e.unit),[b,e.unit]),T=(0,z.useMemo)(()=>tn(e.data),[e.data]),[F,M]=(0,z.useState)(null),[S,O]=(0,z.useState)(null),K=(0,z.useRef)([]),E=(0,z.useRef)(e.onHover);E.current=e.onHover;let I=(0,z.useRef)(e.onClick);I.current=e.onClick;let _=(0,z.useRef)(null),w=(0,z.useRef)(null),N=(0,z.useRef)(null),d=(0,z.useCallback)((P,ee="pointer")=>{if(N.current!==P){N.current=P;let Jn=P===null?null:K.current[P]??null;queueMicrotask(()=>E.current?.(Jn)),w.current?.(P)}_.current=P===null?null:ee,M(P),O(_.current)},[]),l=(0,z.useCallback)(P=>{_.current!=="keyboard"&&(_.current=P===null?null:"sync",M(P),O(_.current))},[]),g=(0,z.useCallback)(P=>{let ee=K.current[P];ee&&I.current?.(ee)},[]),C=Ut(e.replayKey),R=e.width!==void 0||(a??0)>0,V={enabled:f,active:p.visible&&R,near:p.near,replayKey:C,dataKey:T,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},ne=(0,z.useCallback)((P,ee=1)=>F===null||F===P?ee:ee*.38,[F]);return{p:n,width:s,height:u,measured:R,responsive:e.width===void 0,pending:re&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:V,fv:v,fmt:b,pct:$,locale:x,lang:m,t:m==="ko"?St:Tt,active:F,via:S,setActive:d,click:g,events:K,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:ne,sig:T,description:e.description,reduced:y,publish:w,applySync:l}}var B=A(j(),1);function _o(e){return 1-Math.pow(1-e,3)}function Oo(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Io(e){return e==="easeInOut"?Oo:e==="linear"?t=>t:_o}function Bo(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 ye(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function He(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 Ln(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 En(e,t,n,r){if(!t||!n||t.length!==n.length)return ye(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let c of ye(s,n[i]))o.push(c)}return o.length===r?o:ye(e,r)}var je=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||!He(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Ln(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=He(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),c=r>0?Math.min(a*r,240):0;if(s){let u=i.to.length;s.from=En(s.cur,s.parts,i.parts,u),s.vel=En(s.curVel,s.parts,i.parts,u),s.parts=i.parts,s.to=i.to.slice(),Ln(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=He(s.from,s.to)&&s.vel.every(y=>Math.abs(y)<1e-6),s.progress=s.done?1:0}else{let u=this.make(i,i.enter??i.from??i.to,n+c,0);u.done=He(u.from,u.to),this.tracks.set(i.key,u)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=ye(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=Io(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,u=s.to.length;if(s.from.length!==u&&(s.from=ye(s.from,u)),s.vel.length!==u&&(s.vel=ye(s.vel,u)),s.cur.length!==u&&(s.cur=new Array(u).fill(0),s.curVel=new Array(u).fill(0)),!(c>0)){for(let f=0;f<u;f++)s.cur[f]=s.from[f],s.curVel[f]=0;s.progress=0,n=!0;continue}let y;if(this.easing==="spring"){let f=Math.exp(-a*c),p=a*c>=8&&a*c<20,x=0;for(let m=0;m<u;m++){let b=s.from[m]-s.to[m],$=s.vel[m]+a*b;s.cur[m]=s.to[m]+(b+$*c)*f,s.curVel[m]=(s.vel[m]-a*$*c)*f,p&&x<.15&&(x=Math.max(x,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/a)))}y=a*c>=20||p&&x<.15,s.progress=Math.min(1,1-(1+a*c)*f)}else{let f=Math.min(1,c/o),p=r(f),x=Bo(this.easing,f)/o;for(let m=0;m<u;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*p,s.curVel[m]=(s.to[m]-s.from[m])*x;y=f>=1,s.progress=p}if(y){for(let f=0;f<u;f++)s.cur[f]=s.to[f],s.curVel[f]=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}},we=new Set,Ve=0;function _n(e){Ve=0;let t=Array.from(we);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||we.delete(n)}we.size&&typeof requestAnimationFrame<"u"&&(Ve=requestAnimationFrame(_n))}function On(e){return we.add(e),!Ve&&typeof requestAnimationFrame<"u"&&(Ve=requestAnimationFrame(_n)),()=>{we.delete(e)}}function zo(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 In(e,t){let n=(0,B.useMemo)(()=>zo(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:c="spring",duration:u=900,stagger:y=0}=t,f=(0,B.useRef)(null),p=(0,B.useRef)("init"),x=(0,B.useRef)(null),m=(0,B.useRef)(s),b=(0,B.useRef)(i),$=(0,B.useRef)(!1),v=(0,B.useRef)(0),[,T]=(0,B.useState)(0),F=(0,B.useRef)(null),M=(0,B.useRef)(!0);f.current||(f.current=new je,f.current.configure(c,u),f.current.snap(n),x.current=n);let S=f.current;if(S.configure(c,u),x.current!==n){let w=p.current,N=!Object.is(m.current,s);S.sameTargets(n)?S.refreshData(n):!r||w==="init"?S.snap(n):w==="idle"?S.hold(n):w==="running"||N?S.update(n,Se(),y):S.snap(n),x.current=n,m.current=s}let O=(0,B.useRef)(()=>!1);O.current=w=>{if(!M.current)return!1;let N=S.step(w);return!N&&p.current==="running"&&(p.current="done"),T(d=>(d+1)%1e9),N||(F.current=null),N};let K=(0,B.useCallback)(()=>{if(!re||F.current||!S.animating)return;let w=N=>O.current(N);F.current=On(w)},[S]);te(()=>{let w=!Object.is(b.current,i);if(b.current=i,!r){(p.current!=="done"||S.animating)&&(S.snap(x.current??n),p.current="done",T(N=>N+1));return}p.current==="init"||w&&a?(S.hold(x.current??n),p.current="idle",$.current=!1,T(N=>N+1)):w&&($.current=!0)},[r,i]),te(()=>{!r||!a||!$.current||($.current=!1,S.hold(x.current??n),p.current="idle",T(w=>w+1))},[a,r]),(0,B.useEffect)(()=>{r&&o&&p.current==="idle"&&(S.start(Se()),v.current+=1,p.current="running",K(),T(w=>w+1))},[r,o,i,S,K]),(0,B.useEffect)(()=>{S.animating&&K()}),(0,B.useEffect)(()=>(M.current=!0,()=>{M.current=!1,F.current?.(),F.current=null}),[]);let E=Se(),I=S.elapsed(E),_=r&&p.current==="idle";return{items:S.items(),get:w=>S.get(w),elapsed:_?0:I,fade:(w,N=320)=>_?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-w)/N)):1,waiting:_,animating:S.animating,generation:v.current}}var Ho=A(j(),1);var zn=A(L(),1);var Bn=e=>e?"neutralStrong":"accent";var dt=A(L(),1);function Hn(e,t,n,r){if(typeof e!="function")return se(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let c=o.get(r(i,s));c!==void 0&&e(i,s)&&a.add(c)}),a}var jo=A(j(),1);var ht=A(L(),1),Vo={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${de(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},jn={en:Vo,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},ft=["ink","muted","dim"];function Vn(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,ft.length)}var Ko=A(j(),1);var Un=A(L(),1),Wo={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${de(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Go={en:Wo,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Kn=(e,t)=>Go[e].other(t);function Wn(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,xn(o.map(a=>a.value)))}}var Gn=e=>Number.isFinite(e)&&e>0?e:0;var xe=A(j(),1);var q=A(L(),1),Uo={kind:"Radar chart",desc:(e,t,n)=>`${de(e,"metric")} (${t}), ${de(n,"series","series")}`},Yo={en:Uo,ko:{kind:"레이더 차트",desc:(e,t,n)=>`지표 ${e}개(${t}), 계열 ${n}개`}};function gt(e){let t=Pn(e,{height:d=>Math.max(220,Math.min(300,d*.66)),duration:900,stagger:160}),{p:n,width:r,height:o}=t,a=(0,xe.useMemo)(()=>Mn(e.data,e.axis??"axis",e.value,e.series,{xType:"band",locale:t.locale}),[e.data,e.axis,e.value,e.series,t.locale]),i=a.labels,s=i.length,c=(0,xe.useMemo)(()=>se(e.highlight,a.series,a.series,a.series.map(()=>0),"first"),[a,e.highlight]),u=Math.max(0,...a.values.flat().filter(Number.isFinite)),y=e.max??Tn(0,u,e.levels??4)[1],f=e.levels??4,p=Math.max(...i.map(d=>$n(d,11.5,600)),20)+10,x=Math.max(30,Math.min(r/2-p,o/2-22)),m=r/2,b=o/2+2,$=d=>d/Math.max(1,s)*be,v=(0,xe.useMemo)(()=>a.series.map((d,l)=>({s:l,name:d,r:a.values[l].map(g=>Number.isFinite(g)?Math.max(0,g)/y*x:0),hi:c.has(l)})),[a,y,x,c]),T=t.motion.stagger??160,F=(0,xe.useMemo)(()=>[...v].sort((d,l)=>Number(d.hi)-Number(l.hi)),[v]),M=(0,xe.useMemo)(()=>F.map((d,l)=>({key:`r:${d.name}`,to:d.r,from:d.r.map(()=>0),enter:d.r.map(()=>0),delay:l*T,data:d})),[F,T]),S=In(M,t.motion),O=qt(n,"accent"),K=i.map((d,l)=>({datum:null,index:l,key:d,label:d,value:a.values[[...c][0]??0]?.[l]??null,formatted:a.series.map((g,C)=>`${g||t.t.value} ${t.fv(a.values[C][l])}`).join(", ")})),E=null;if(t.active!==null&&i[t.active]!==void 0){let d=t.active,l=Math.max(...v.map(R=>R.r[d]??0)),[g,C]=ce(m,b,l,$(d));E={x:g,y:C,title:i[d],rows:v.map(R=>({label:R.name||t.t.value,value:t.fv(a.values[R.s][d]),color:R.hi?O.fill:n.paint("neutralStrong"),strong:R.hi}))}}let I=d=>e.circular?`M${m-d},${b}a${d},${d} 0 1 0 ${d*2},0a${d},${d} 0 1 0 ${-d*2},0`:i.map((l,g)=>{let[C,R]=ce(m,b,d,$(g));return`${g?"L":"M"}${C.toFixed(2)},${R.toFixed(2)}`}).join("")+"Z",_=t.motion.duration??900,w=Yo[t.lang],N=e.description??`${w.kind}. ${w.desc(s,i.join(", "),a.series.length)}.`;return(0,q.jsxs)(wn,{c:t,kind:w.kind,ariaLabel:e.ariaLabel,description:N,events:K,tip:E,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(d,l,g)=>{let C=Math.atan2(d-m,-(l-b)),R=Math.round((C+be)%be/be*s)%s,V=Math.hypot(d-m,l-b);t.setActive(V<x+30?R:null,g.pointerType==="touch"?"touch":"pointer")},children:[(0,q.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:f},(d,l)=>(0,q.jsx)("path",{d:I(x*(l+1)/f),fill:"none",stroke:n.paint("line"),strokeWidth:1},l)),i.map((d,l)=>{let[g,C]=ce(m,b,x,$(l));return(0,q.jsx)("line",{x1:m,y1:b,x2:g,y2:C,stroke:n.paint(t.active===l?"dim":"line"),strokeWidth:1},l)}),Array.from({length:f},(d,l)=>{let g=y*(l+1)/f,[C,R]=ce(m,b,x*(l+1)/f,0);return(0,q.jsx)(mt,{x:C+4,y:R+1,size:9.5,fill:n.paint("ink"),children:t.fmt(g)},l)})]}),S.items.map(d=>{let l=d.data,g=d.v.map((V,ne)=>ce(m,b,V,$(ne))),C=g.map(([V,ne],P)=>`${P?"L":"M"}${V.toFixed(2)},${ne.toFixed(2)}`).join("")+"Z",R=l.hi?O.fill:n.paint("neutralStrong");return(0,q.jsxs)("g",{opacity:d.exiting?.4:1,pointerEvents:"none",children:[(0,q.jsx)("path",{d:C,fill:l.hi?O.fill:n.paint("neutral"),fillOpacity:l.hi?.2:.22,stroke:R,strokeWidth:l.hi?2.2:1.4,strokeLinejoin:"round"}),l.hi?g.map(([V,ne],P)=>(0,q.jsx)("circle",{cx:V,cy:ne,r:t.active===P?4.5:3,fill:R,stroke:n.paint("panel"),strokeWidth:1.5},P)):null]},d.key)}),(0,q.jsx)("g",{"aria-hidden":"true",children:i.map((d,l)=>{let g=$(l),[C,R]=ce(m,b,x+12,g),V=Math.sin(g),ne=V>.15?"start":V<-.15?"end":"middle",P=Math.cos(g)>.9?-4:Math.cos(g)<-.9?4:0,ee=t.active===l;return(0,q.jsx)(mt,{x:C,y:R+P,anchor:ne,size:11.5,weight:ee?800:600,fill:n.paint(ee?"ink":"muted"),opacity:S.fade(_*.4,300),children:d},l)})})]})}var me=A(L(),1);function Yn(e,t){let n=Oe(e);return n?.type==="scatter"&&t?.size!==void 0?Oe("bubble"):n}function qo(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 Xo(e,t,n,r=!1){let o=Yn(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,c=new Set(!r&&ut.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),u=f=>f.filter(p=>!c.has(p.label)),y=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(y.includes(o.type)){let f=_e(a.label,"label"),p=Jt(a.value,"value"),x=o.type==="waffle",m=t.map((M,S)=>({r:M,label:f(M,S),value:x?p(M,S):Gn(p(M,S))})),{kept:b,other:$}=x?{kept:m,other:null}:Wn(m,i.other,(M,S)=>({r:{},label:Kn(H(n),M),value:S})),v=se(s,b.map(M=>M.r),b.map(M=>M.label),b.map(M=>M.value),x?"first":"max"),T=$?[...b,$]:b,F=ve(T.length,v);return T.map((M,S)=>({label:M.label,color:F[S]}))}if(o.type==="candlestick"){let f=Vn(Array.isArray(i.ma)?i.ma:void 0,t.length),p=jn[H(n)];return[{label:p.up,color:i.upColor??"accent"},{label:p.down,color:i.downColor??"neutralStrong"},...f.map((x,m)=>({label:p.maLegend(x),color:ft[m],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let f=_e(a.series,"series"),p=ge(t.map((m,b)=>f(m,b)));if(p.length<2)return[];let x=Xt(p.length,Hn(s,t,p,f));return u(p.map((m,b)=>({label:m,color:x[b],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let f=[];if(Array.isArray(a.y))f=a.y;else if(typeof a.series=="string"){let b=_e(a.series,"series");f=ge(t.map(($,v)=>b($,v)))}let p=ct(o.type,a,i);if(p.length){let b=ve(f.length,se(s,f,f,f.map(()=>0),"none")),$=f.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:f.map((v,T)=>({label:v,color:b[T]}));return[...u($),...p.map((v,T)=>({label:v,color:Bn(T),shape:"line"}))]}if(f.length<2)return[];let x=se(s,f,f,f.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return u(f.map((b,$)=>({label:b,color:x.has($)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let m=ve(f.length,x);return u(f.map((b,$)=>({label:b,color:m[$]})))}return[]}function qn(e,t){let{spec:n}=e,r=Yn(n.type,n.encoding),o=(0,Ce.useMemo)(()=>kn(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=gn(n,e.locale),s=J(i),c=H(s),u=nn(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),y=bn(n),f=(0,Ce.useMemo)(()=>y?cn(y,s):void 0,[y,s]),p=n.options?.hidden,x=Array.isArray(p)?p.map(String):[],m=x.join(""),[b,$]=(0,Ce.useState)(null);if(!r)return(0,me.jsx)(at,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let v=o??u.data,T=t[r.type],F={...n.options??{}},M={...qo(r,n.encoding),...F,...f?{tooltip:f}:{},data:v,...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},S=n.card?.legend==="toggle"&&pn(r.type,n.encoding??{},F),O=b&&b.base===m?b.hidden:x;S&&(M.hidden=O);let K=w=>$(N=>{let d=N&&N.base===m?N.hidden:x;return{base:m,hidden:d.includes(w)?d.filter(l=>l!==w):[...d,w]}}),E=M.height??220,I=a&&!v.length&&(u.loading||u.error||u.empty)?(0,me.jsx)(at,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:E,locale:i}):(0,me.jsx)(T,{...M});if(n.card){let w=n.card,N=w.legend==="auto"||w.legend==="toggle"?Xo(n,v,s,S):w.legend,d=N?.length?S?(0,me.jsx)(ot,{items:N,hidden:O,onToggle:K,locale:i}):N:void 0,l=w.download?(0,me.jsx)(un,{data:v,columns:yn(n),filename:w.title??r.type,formats:Array.isArray(w.download)?w.download:void 0,locale:i}):void 0;I=(0,me.jsx)(Yt,{number:w.number,title:w.title??hn(r,c),subtitle:w.subtitle,legend:d,actions:l,source:w.source||void 0,note:w.note||void 0,accent:w.accent,takeaway:w.takeaway,level:w.level,sample:w.sample,replay:w.replay!==!1,className:e.className,locale:i,children:I})}let _=e.theme??n.theme;return _&&(I=(0,me.jsx)(Pe,{theme:_,children:I})),I}function Zo({cfg:e,components:t}){let n=ze();return qn({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Zn(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Xn.hydrateRoot)(r,(0,pt.createElement)(Pe,{theme:o.theme,cssVars:!0},(0,pt.createElement)(Zo,{cfg:o,components:{[e]:t}})))}Zn("radar",gt);})();
@@ -0,0 +1,28 @@
1
+ (()=>{var qn=Object.create;var gt=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Jn=Object.getOwnPropertyNames;var Zn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty;var He=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var er=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jn(t))!Qn.call(e,o)&&o!==n&&gt(e,o,{get:()=>t[o],enumerable:!(r=Xn(t,o))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?qn(Zn(e)):{},er(t||!e||!e.__esModule?gt(n,"default",{value:e,enumerable:!0}):n,e));var _=He((Uo,pt)=>{pt.exports=globalThis.__ztdReact.react});var yt=He((Yo,bt)=>{bt.exports=globalThis.__ztdReact["react-dom/client"]});var L=He((aa,Ht)=>{Ht.exports=globalThis.__ztdReact["react/jsx-runtime"]});var ht=S(_(),1),Kn=S(yt(),1);var xe=S(_(),1);var Ne=S(_(),1);var xt=S(_(),1),ke=(0,xt.createContext)(void 0);var rr=S(_(),1);var tr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],kt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',vt='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ne={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:kt,monoFamily:vt,radius:18,radiusCode:14,radiusMark:4},nr={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:kt,monoFamily:vt,radius:18,radiusCode:14,radiusMark:4},je={dark:ne,light:nr};function Ve(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function We(e){let t={};for(let n of tr){let r=e[n];typeof r=="string"&&(t[Ve(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 Ke(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 or=`
2
+ .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
+ .ztd-root:focus{outline:none}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ne.accent});outline-offset:3px;border-radius:6px}
5
+ .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
+ .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
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)}
8
+ .ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
9
+ .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
+ .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
+ .ztd-btn:focus{outline:none}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ne.accent});outline-offset:2px}
13
+ .ztd-card{transition:border-color .16s ease}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${ne.dim})}
15
+ @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
+ @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
+ @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
18
+ .ztd-pop{transform-box:fill-box;transform-origin:center}
19
+ @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
+ .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
+ @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
+ `;var wt=!1;function ge(){if(wt||typeof document>"u"||(wt=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=or,document.head.appendChild(e)}var ve=S(_(),1),Q=typeof window<"u"&&typeof document<"u",J=Q?ve.useLayoutEffect:ve.useEffect;function we(){return typeof performance<"u"?performance.now():Date.now()}function I(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ce(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Ct={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},$t={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ar=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],ir={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function sr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function lr(e){return sr(ar,e)}function Tt(e,t){let n=lr(e);return{text:n?n[t]:e,...ir[n?.id??"basic"]}}var Y=S(_(),1);var Nt=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ee="en-US",St=new Map;function Ge(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=St.get(r);return o||(o=new Intl.NumberFormat(e,n),St.set(r,o)),o}function Ue(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ye(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ee,...r}=t;return Ue(Ge(n,r).format(e))}var Pt=e=>e!==0&&Math.abs(e)<.05,Lt=(e,t,n="")=>`${Ye(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function $e(e,t={}){if(!Number.isFinite(e))return"-";if(Pt(e)&&t.maximumFractionDigits===void 0)return Lt(e,t.locale??ee,"%");let n=Math.abs(e);return`${Ye(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function cr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ee,...r}=t;if(I(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,c]=a[i],l=o/s,g=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**g)/10**g;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Ye(u,{locale:n,...r,maximumFractionDigits:g})+c}}return Ue(Ge(n,{notation:"compact",...r}).format(e))}var ur=(e,t=I(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Te(e,t=ee,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Ge(t,o);return c=>Number.isFinite(c)?`${i}${Ue(s.format(c))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>$e(o,{locale:t});case"ratio":return o=>$e(o*100,{locale:t});case"compact":return o=>cr(o,{locale:t});case"currency":return r(ur(t));default:{let o=r({maximumFractionDigits:1});return a=>Pt(a)?Lt(a,t):o(a)}}}function mr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var dr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var fr=["january","february","march","april","may","june","july","august","september","october","november","december"],Mt=e=>{let t=e.toLowerCase();return t.length<3?0:fr.findIndex(n=>n.startsWith(t))+1},At=e=>+e+(+e<30?2e3:1900);function Ft(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var hr=[/^(\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})일)?$/],gr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Dt=/\{([^{}]+)\}/g;function pr(e,t){let n;for(let r of hr)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?[At(n[3]),+n[2],+n[1],1]:[At(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=gr.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Mt(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=Mt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function Et(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(dr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Et(`${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=pr(n,t);if(r)return mr(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 Rt=new Map;function _t(e,t={month:"short",day:"numeric"}){let n=Et(e);if(!n)return"-";let{locale:r=ee,...o}=t,a=r+JSON.stringify(o),i=Rt.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Rt.set(a,i)),i.format(n)}var Ot={white:"#ffffff",black:"#000000",transparent:"#00000000"};function It(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Ot[t.toLowerCase()]&&(t=Ot[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function br(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 qe(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(e){return[qe(e[0]),qe(e[1]),qe(e[2])]}function Xe(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 Bt(e){let[t,n,r]=yr(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function xr([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Xe(4.0767416621*o-3.3077115913*a+.2309699292*i),Xe(-1.2684380046*o+2.6097574011*a-.3413193965*i),Xe(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function zt(e,t,n){let r=It(e),o=It(t);if(!r||!o)return e;let a=Bt(r),i=Bt(o),s=Math.max(0,Math.min(1,n));return br(xr([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}var Je=S(L(),1),Se=(0,Y.createContext)({theme:ne,cssVars:!0});function kr(e,t=ne){return e?typeof e=="string"?je[e]??t:Ke(t,e):t}function Ae(e){let t=(0,Y.useContext)(Se),n=e.base?je[e.base]:t.theme,r=(0,Y.useMemo)(()=>kr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,Y.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,Y.useMemo)(()=>We(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Je.jsx)(Se.Provider,{value:i,children:(0,Je.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var vr=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Me(e){return vr.has(e)}function wr(e,t){let n=r=>t?`var(${Ve(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Me(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Me(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:zt(e[r],e[o],a)}}}function te(e){let t=(0,Y.useContext)(Se);return(0,Y.useMemo)(()=>{let n=Ke(t.theme,e);return wr(n,t.cssVars)},[t.theme,t.cssVars,e])}function q(e){let t=(0,Y.useContext)(Se);return e??t.locale??ee}function jt(e){return e?We(e):{}}var Re=S(_(),1),Ze=(0,Re.createContext)(void 0);function Vt(e){let t=(0,Re.useContext)(Ze);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var x=S(L(),1),Cr={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`},$r={en:Cr,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Tr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Qe=e=>$r[I(q(e))];function et(e){let t=te(e.theme),n=Qe(e.locale),[r,o]=(0,Ne.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),c=e.items.filter(g=>!s.has(g.label)).length,l=(0,x.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((g,u)=>{let f=!s.has(g.label),y=f&&c===1,d=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Sr,{p:t,item:g,off:!f}),(0,x.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:g.label})]});return(0,x.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,x.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":y||void 0,onClick:()=>{y||(i(g.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:y?"default":void 0},children:d}):d},u)})});return i?(0,x.jsxs)(x.Fragment,{children:[l,(0,x.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Tr,children:r?n.shown(c,e.items.length):""})]}):l}function Sr({p:e,item:t,off:n}){let r=t.color?Me(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,x.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,x.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,x.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,x.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 Mr(e){let t=te(e.theme),n=Tt(e.level,I(q(e.locale)));return(0,x.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 Ar(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,x.jsxs)(x.Fragment,{children:[e.slice(0,r),(0,x.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Wt(e){let t=te(e.theme),n=Qe(e.locale),[r,o]=(0,Ne.useState)(0);J(()=>ge(),[]);let a=()=>{o(f=>f+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,x.jsx)(et,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,g=e.source!==void 0||e.note!==void 0?(0,x.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,x.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,x.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,x.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,x.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,x.jsx)(Mr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,x.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,x.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,x.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,x.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:Ar(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,x.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,x.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,x.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,x.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,x.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,x.jsx)("span",{}),i]}):null]}),(0,x.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,x.jsx)(Ze.Provider,{value:r,children:(0,x.jsx)(ke.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),g?(0,x.jsxs)(x.Fragment,{children:[g,u]}):u]})}function tt(e){let t=te(e.theme),n=Qe(e.locale),r=e.height??220;if(J(()=>ge(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,x.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,x.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,x.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,x.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,x.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,x.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,x.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,x.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,x.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,x.jsx)(x.Fragment,{children:e.children})}function re(e,t,n,r,o="max"){let a=new Set,i=n.length,s=l=>{if(i&&l!=="none"){if(l==="first")a.add(0);else if(l==="last")a.add(i-1);else if(l==="max"||l==="min"){let g=-1,u=l==="max"?-1/0:1/0;r.forEach((f,y)=>{Number.isFinite(f)&&(l==="max"?f>u:f<u)&&(u=f,g=y)}),g>=0&&a.add(g)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((l,g)=>{g<i&&l!==null&&l!==void 0&&e(l,g)&&a.add(g)}),a;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<i&&a.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((g,u)=>{g===l&&a.add(u)});return a}function Kt(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 pe(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function Gt(e,t){return pe(e+1,t).slice(0,e)}function Ut(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Rr(e,t){if(e==null||typeof e!="object")return;let n=e;if(Ut(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Ut(r,o))return;r=r[o]}return r}}function be(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 Yt(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Rr(r,n)}function Pe(e,t){let n=Yt(e,t);return(r,o)=>be(n(r,o))}function ce(e,t){let n=Yt(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function nt(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var U=S(_(),1);function Nr(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
23
+ `||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,a=[","," ",";","|"],i=",",s=0;for(let c of a){let l=o(c);l>s&&(s=l,i=c)}return i}var Pr=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function qt(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Pr.test(t)||/^[-+]?\.\d+$/.test(t)){let n=be(t);if(Number.isFinite(n))return n}return t}function le(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Nr(o),i=[],s=[],c="",l=!1;for(let d=0;d<o.length;d++){let p=o[d];l?p==='"'?o[d+1]==='"'?(c+='"',d++):l=!1:c+=p:p==='"'&&!c.trim()?(l=!0,c=""):p===a?(s.push(c),c=""):p===`
24
+ `||p==="\r"?(p==="\r"&&o[d+1]===`
25
+ `&&d++,s.push(c),i.push(s),s=[],c=""):c+=p}(c!==""||s.length)&&(s.push(c),i.push(s));let g=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!g.length)return[];let u=d=>n?qt(d):d;if(!r)return g.map(d=>Object.fromEntries(d.map((p,T)=>[String(T),u(p)])));let f=[],y=new Set;return g[0].forEach((d,p)=>{let T=d.trim()||`col${p+1}`,k=T;for(let v=2;y.has(k);v++)k=`${T}_${v}`;y.add(k),f.push(k)}),g.slice(1).map(d=>Object.fromEntries(f.map((p,T)=>[p,u(d[T]??"")])))}function rt(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof i[c]=="string"?qt(i[c]):i[c]??null])))}function Lr(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,c)=>Object.fromEntries(a.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Xt(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 oe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return oe(JSON.parse(t))}catch{}return le(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?rt(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)?oe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?rt(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)?oe(t.rows):Array.isArray(t.values)?rt(t.values):Array.isArray(t.items)?oe(t.items):Array.isArray(t.results)?oe(t.results):Lr(t)}return[]}function Jt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}async function Fr(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(I(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return le(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return le(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):le(a)}async function Dr(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await Fr(a,t.parse,o,t.locale)}return t.select&&(r=Xt(r,t.select)),t.transform?t.transform(r):oe(r)}function Zt(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,U.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,U.useState)(0),l=q(t.locale),g=(0,U.useRef)(t);g.current={...t,locale:l};let u=(0,U.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",y=t.deps??[],d=JSON.stringify(y.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),p=(0,U.useRef)(!1);(0,U.useEffect)(()=>{let k=u.current;if(!k||!r){i($=>$.status==="loading"?{...$,status:"idle"}:$);return}let v=new AbortController,A=!0;return p.current=!0,i($=>({...$,data:o?$.data:[],status:"loading",error:null})),Dr(k,{...g.current,signal:v.signal}).then($=>{A&&i({data:$,status:"success",error:null,updatedAt:Date.now()})}).catch($=>{!A||v.signal.aborted||i(C=>({...C,status:"error",error:$ instanceof Error?$:new Error(String($))}))}).finally(()=>{A&&(p.current=!1)}),()=>{A=!1,p.current=!1,v.abort()}},[f,r,s,d,o]),(0,U.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{p.current||c(v=>v+1)},n);return()=>clearInterval(k)},[n,r]);let T=(0,U.useCallback)(()=>c(k=>k+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:T}}var at=S(L(),1),Er=["csv","svg","png"],_r=/^[=+\-@\t\r\n=+-@]/,Or=/var\(|color-mix\(/;function Qt(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?Ft(e.getTime()):String(e);return`"${(_r.test(t)&&!Number.isFinite(be(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ir(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Br(e,t){return`\uFEFF${[t.map(Qt),...e.map(r=>t.map(o=>Qt(r[o])))].map(r=>r.join(",")).join(`\r
26
+ `)}\r
27
+ `}function zr(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function ot(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var en=2,ae=16;function tn(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function nn(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 rn(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,c]=[a+ae*2,i+ae*2],l=o.cloneNode(!0),g=l.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,p)=>{let T;for(let k of Array.from(d.attributes)){if(!Or.test(k.value))continue;let v=(T??(T=getComputedStyle(d))).getPropertyValue(k.name);v&&g[p].setAttribute(k.name,tn(v,u))}}),l.removeAttribute("style");for(let[d,p]of Object.entries({viewBox:`${-ae} ${-ae} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))l.setAttribute(d,String(p));let f=tn(getComputedStyle(r).backgroundColor,u),y=o.parentElement?.querySelector("canvas")??null;if(n){let d=l.querySelector("desc")?.nextSibling??l.firstChild;l.insertBefore(nn("rect",{x:-ae,y:-ae,width:s,height:c,fill:f}),d),y&&l.insertBefore(nn("image",{href:y.toDataURL(),width:a,height:i}),d)}return{svg:new XMLSerializer().serializeToString(l),w:s,h:c,vw:a,vh:i,bg:f,canvas:y}}function Hr(e,t){let n=rn(e,en,!1);if(!n)return;let r=en,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,ae*r,ae*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(c=>c&&ot(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function on(e){let t=te(e.theme),n=I(q(e.locale))==="ko",r=zr(e.filename),o=(a,i)=>{if(a==="csv")return ot(new Blob([Br(e.data,e.columns?.length?e.columns:Ir(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Hr(i,r);let s=rn(i,1,!0);s&&ot(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,at.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Er.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,at.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(a,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var sn=S(L(),1);function an(e,t=ee){let n=Te(void 0,t),r=e.split(`
28
+ `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?_t(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let c=!1,l=s.replace(Dt,(g,u)=>o(a,u.trim())??(c=!0,""));c||i.push(l)}return i.length?i.map((s,c)=>(0,sn.jsx)("div",{children:s},c)):null}}var m=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),X=m("label","string",!0,"Item name field"),H=m("value","number",!0,"Value field"),jr=[X,H],Vr=[X,H],Wr=[m("label","string",!0,"Stage name"),m("value","number",!0,"Users at the stage")],Kr=[X,H],Gr=[m("label","string",!0,"Leaf (lowest level) name"),H,m("group","string",!1,"Parent group field")],Ur=[m("label","string",!0,"Leaf name"),H,m("group","string",!1,"Parent group field")],Yr=[X,m("value","number",!0,"Change (total rows may omit it)"),m("type","string",!1,'"total" makes a total bar')],qr=[X,H],Xr=[m("x","string",!0,"Column field"),m("series","string",!0,"Stacked series field"),H],Jr=[m("x","string",!0,"Column field"),m("y","string",!0,"Row field"),H],Zr=[m("axis","string",!0,"Metric (axis) field"),m("value","number",!0,"Value field",{multi:!0}),m("series","string",!1,"Series field")],Qr=[m("x","number",!0,"x value"),m("y","number",!0,"y value"),m("size","number",!1,"Circle size"),m("label","string",!1,"Name")],cn=m("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),eo=[m("x","any",!0,"x field (date, number or category)"),m("y","number",!0,"y field. An array for wide tables",{multi:!0}),m("series","string",!1,"Series field (long tables)"),m("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),cn],to=[m("x","any",!0,"x field"),m("y","number",!0,"y field. An array for wide tables",{multi:!0}),m("series","string",!1,"Series field"),m("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}),cn],no=[m("x","any",!0,"x field"),m("y","number",!0,"y field",{multi:!0}),m("series","string",!1,"Series field")],ro=[m("x","string",!0,"Category field"),m("y","number",!0,"Value field. An array for wide tables",{multi:!0}),m("series","string",!1,"Series field"),m("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})],oo=[X,H],ao=[m("value","number",!0,"Value field",{prop:"valueKey"}),m("target","number",!1,"Target field",{prop:"targetKey"})],io=[X,m("value","number",!0,"Actual value field"),m("target","number",!1,"Target field")],so=[m("x","any",!1,"x field"),m("y","number",!0,"y field")],lo=[X,m("x","string",!1,"Period field (long tables)"),m("value","number",!1,"Value field (long tables)")],co=[X,m("start","number",!0,"Before value"),m("end","number",!0,"After value")],uo=[X,H],mo=[m("value","number",!0,"Value field"),m("group","string",!1,"Group (row) field"),m("label","string",!1,"Dot name")],fo=[m("group","string",!0,"Group field"),m("value","number",!0,"Value field")],ho=[m("source","string",!0,"Source node"),m("target","string",!0,"Target node"),H],go=[m("source","string",!0,"Sending group"),m("target","string",!0,"Receiving group"),H],po=[m("date","date",!0,"Date field"),H],bo=[m("x","any",!0,"Period field"),m("series","string",!0,"Item field"),m("rank","number",!1,"Rank field (1 is first)"),m("value","number",!1,"Value field (instead of rank, largest is first)")],yo=[m("group","string",!0,"Group field"),m("value","number",!0,"Value field")],xo=[m("label","string",!1,"Row name field")],ko=[m("x","date",!0,"Date (period) field"),m("open","number",!0,"Open price field"),m("high","number",!0,"High price field"),m("low","number",!0,"Low price field"),m("close","number",!0,"Close price field"),m("volume","number",!1,"Volume field")],vo=[X,H],wo=[m("x","any",!0,"Period field (date or category)"),m("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),m("series","string",!1,"Series field (long tables, back row only)"),m("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Co=[m("value","number",!1,"Sample value field (raw rows)"),m("group","string",!1,"Group field. Up to 2 groups overlap"),m("x0","number",!1,"Bin start (pre-binned rows)"),m("x1","number",!1,"Bin end (pre-binned rows)"),m("count","number",!1,"Samples in the bin (pre-binned rows)")],$o=[m("x","number",!0,"x value"),m("y","number",!0,"y value"),m("series","string",!1,"Series field (one color per series)"),m("label","string",!1,"Name")],ln={pie:jr,donut:Vr,funnel:Wr,waffle:Kr,treemap:Gr,sunburst:Ur,waterfall:Yr,pareto:qr,marimekko:Xr,heatmap:Jr,radar:Zr,bubble:Qr,line:eo,area:to,stream:no,bar:ro,radialBar:oo,gauge:ao,bullet:io,sparkline:so,slope:lo,dumbbell:co,lollipop:uo,beeswarm:mo,ridgeline:fo,sankey:ho,chord:go,calendar:po,bump:bo,box:yo,parallel:xo,candlestick:ko,segmented:vo,skyline:wo,histogram:Co,scatter:$o},ue={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 un(e,t){return t==="ko"?e.nameKo:e.name}function mn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var it=["line","area","bar","scatter"];function st(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function dn(e,t,n){return it.includes(e)&&!st(e,t,n).length}function fn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var To={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 Le(e){let t=ln[e]?e:To[e]??Object.keys(ue).find(n=>n.toLowerCase()===e.toLowerCase()||ue[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!ue[t]))return{type:t,component:ue[t].component,name:ue[t].name,nameKo:ue[t].nameKo,encoding:ln[t]}}function hn(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of Le(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}var de=Math.PI*2;function gn(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function me(e){return Math.round(e*100)/100}function fe(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function Fe(e,t,n,r,o){let a=o-r;if(!(Math.abs(a)>1e-4))return"";let i=Math.abs(a)>=de-1e-4?r+(a>0?de-1e-4:-(de-1e-4)):o,[s,c]=fe(e,t,n,r),[l,g]=fe(e,t,n,i),u=Math.abs(i-r)>Math.PI?1:0;return`M${me(s)},${me(c)}A${me(n)},${me(n)} 0 ${u} ${a>0?1:0} ${me(l)},${me(g)}`}function pn(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 le(t.csv)}return null}var K=S(_(),1);var N=S(L(),1),De=60;var bn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function yn(e){let{c:t,events:n}=e,r=(0,K.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,J(()=>{ge()},[]);let i=n.length,s=!e.noNav&&i>0,c=(0,K.useContext)(ke),l=e.ariaLabel??c??e.kind,g=(0,K.useMemo)(()=>s?`${n.length}${n.slice(0,De).map(b=>`${b.label}${b.series??""}${b.formatted??b.value??""}`).join("")}`:"",[n,s]),u=(0,K.useMemo)(()=>(0,N.jsx)(So,{label:l,events:n,t:t.t}),[l,g,t.t]),f=(0,K.useRef)(null);(0,K.useEffect)(()=>{let b=()=>{f.current=null};return window.addEventListener("scroll",b,{capture:!0,passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b,{capture:!0}),window.removeEventListener("resize",b)}},[]),(0,K.useEffect)(()=>{f.current=null},[t.width,t.height]);let y=b=>{if(b.target!==b.currentTarget)return;if(e.onKey?.(b)){b.preventDefault();return}let P=t.active,M;switch(b.key){case"ArrowRight":case"ArrowDown":M=P===null?0:(P+1)%i;break;case"ArrowLeft":case"ArrowUp":M=P===null?i-1:(P-1+i)%i;break;case"Home":M=0;break;case"End":M=i-1;break;case"Escape":if(P===null)return;M=null;break;case"Enter":case" ":P!==null&&(b.preventDefault(),t.click(P));return;default:return}b.preventDefault(),t.setActive(M,"keyboard")},{via:d,node:p,setActive:T}=t;(0,K.useEffect)(()=>{if(d!=="touch"||!p)return;let b=P=>{p.contains(P.target)||T(null)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[d,p,T]);let k=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,A=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,$=typeof e.renderTip=="function"&&k?e.renderTip(k):null,C=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${i})`:""),z;if(v){let b=v.x*A,P=t.width*A,M=`clamp(${(4-b).toFixed(1)}px, -50%, calc(${(P-b-4).toFixed(1)}px - 100%))`,W=v.y<64;z={position:"absolute",left:b,top:v.y*A,transform:`translate(${M}, ${W?"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*A-8)}}let j=b=>{f.current=null,b.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},V=b=>b?P=>{let M=f.current??(f.current=P.currentTarget.getBoundingClientRect());M.width&&b((P.clientX-M.left)/M.width*t.width,(P.clientY-M.top)/M.height*t.height,P)}:void 0,E=V(e.onPointerMove),O=V(e.onPointerDown),w=E||O?b=>{b.pointerType==="touch"&&E?.(b),O?.(b)}:void 0,h=V(e.onPointerUp),R=jt(e.theme);return(0,N.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?y:void 0,onBlur:b=>{t.via==="keyboard"&&!b.currentTarget.contains(b.relatedTarget)&&t.setActive(null)},onPointerLeave:j,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...R,...e.style},children:[t.pending?null:e.underlay,(0,N.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:w,onPointerUp:h,onPointerCancel:h,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,N.jsx)("title",{id:o,children:l}),(0,N.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,N.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,v?(0,N.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:z,children:$??(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:v.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:v.title}),v.rows.map((b,P)=>(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,N.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(b.strong?"ink":"muted")},children:[b.color?(0,N.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:b.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,b.label]}),(0,N.jsx)("span",{style:{fontWeight:b.strong===!1?500:700},children:b.value})]},P))]})}):null,(0,N.jsx)("span",{className:"ztd-sr",style:bn,"aria-live":"polite","aria-atomic":"true",children:C}),s&&!t.pending?u:null]})}function So({label:e,events:t,t:n}){return(0,N.jsx)("div",{className:"ztd-sr",style:bn,children:(0,N.jsxs)("table",{children:[(0,N.jsx)("caption",{children:n.table(e)}),(0,N.jsxs)("tbody",{children:[t.slice(0,De).map((r,o)=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,N.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>De?(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:2,children:n.more(t.length-De)})}):null]})]})})}function lt(e){let t=e.baseline??"central";return(0,N.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 vn(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function xn(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 Ee=new Map;function kn(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=Ee.get(o);if(a===void 0){let i=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);vn(l)?i+=xn(l):s+=xn(l)}a=i+s*(n>=600?1.07:1),Ee.size>5e3&&Ee.clear(),Ee.set(o,a)}return a*t}function wn(e,t,n,r=400){if(e=e.trim(),kn(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let c=a+i+1>>1;kn(e.slice(0,c)+o,n,r)<=t?a=c:i=c-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(vn(s.charCodeAt(0))?2:3)?"":s+o}var D=S(_(),1);var G=S(_(),1);function Mo(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ao(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Tn(e,t=!0){let[n,r]=(0,G.useState)({visible:!t,near:!t});return(0,G.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=Ao(i[i.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Mo(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Cn(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Sn(e){let[t,n]=(0,G.useState)(null),[r,o]=(0,G.useState)(e??null),a=(0,G.useCallback)(i=>{n(i),i&&e===void 0&&o(Cn(i))},[e]);return J(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=l=>o(g=>g!==null&&Math.abs(g-l)<.5?g:l),s=()=>i(Cn(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let g=l[l.length-1]?.contentRect;g?i(g.width>0?Math.round(g.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,a,r]}var Ro=()=>()=>{};function _e(){return(0,G.useSyncExternalStore)(Ro,()=>!0,()=>!1)}var $n="(prefers-reduced-motion: reduce)";function Mn(e="auto"){let[t,n]=(0,G.useState)(()=>Q&&typeof window.matchMedia=="function"?window.matchMedia($n).matches:!1);return(0,G.useEffect)(()=>{if(e!=="auto"||!Q||typeof window.matchMedia!="function")return;let r=window.matchMedia($n),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function An(e,t){let n=te(e.theme),[r,o,a]=Sn(e.width),i=_e(),s=e.width??(a||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,g=Mn(e.reducedMotion??"auto"),u=e.animate!==!1&&!g&&Q,f=Tn(r,e.animateOnView!==!1&&u),y=q(e.locale),d=I(y),p=(0,D.useMemo)(()=>Te(e.format,y,t.format),[e.format,y,t.format]),T=(0,D.useCallback)(B=>$e(B,{locale:y}),[y]),k=(0,D.useMemo)(()=>Nt(p,e.unit),[p,e.unit]),v=(0,D.useMemo)(()=>Jt(e.data),[e.data]),[A,$]=(0,D.useState)(null),[C,z]=(0,D.useState)(null),j=(0,D.useRef)([]),V=(0,D.useRef)(e.onHover);V.current=e.onHover;let E=(0,D.useRef)(e.onClick);E.current=e.onClick;let O=(0,D.useRef)(null),w=(0,D.useRef)(null),h=(0,D.useRef)(null),R=(0,D.useCallback)((B,se="pointer")=>{if(h.current!==B){h.current=B;let Yn=B===null?null:j.current[B]??null;queueMicrotask(()=>V.current?.(Yn)),w.current?.(B)}O.current=B===null?null:se,$(B),z(O.current)},[]),b=(0,D.useCallback)(B=>{O.current!=="keyboard"&&(O.current=B===null?null:"sync",$(B),z(O.current))},[]),P=(0,D.useCallback)(B=>{let se=j.current[B];se&&E.current?.(se)},[]),M=Vt(e.replayKey),W=e.width!==void 0||(a??0)>0,ze={enabled:u,active:f.visible&&W,near:f.near,replayKey:M,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Un=(0,D.useCallback)((B,se=1)=>A===null||A===B?se:se*.38,[A]);return{p:n,width:s,height:l,measured:W,responsive:e.width===void 0,pending:Q&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:ze,fv:k,fmt:p,pct:T,locale:y,lang:d,t:d==="ko"?$t:Ct,active:A,via:C,setActive:R,click:P,events:j,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Un,sig:v,description:e.description,reduced:g,publish:w,applySync:b}}var F=S(_(),1);function No(e){return 1-Math.pow(1-e,3)}function Po(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Lo(e){return e==="easeInOut"?Po:e==="linear"?t=>t:No}function Fo(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 he(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function Oe(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 Rn(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 Nn(e,t,n,r){if(!t||!n||t.length!==n.length)return he(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let c of he(s,n[i]))o.push(c)}return o.length===r?o:he(e,r)}var Ie=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||!Oe(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Rn(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Oe(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),c=r>0?Math.min(a*r,240):0;if(s){let l=i.to.length;s.from=Nn(s.cur,s.parts,i.parts,l),s.vel=Nn(s.curVel,s.parts,i.parts,l),s.parts=i.parts,s.to=i.to.slice(),Rn(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=Oe(s.from,s.to)&&s.vel.every(g=>Math.abs(g)<1e-6),s.progress=s.done?1:0}else{let l=this.make(i,i.enter??i.from??i.to,n+c,0);l.done=Oe(l.from,l.to),this.tracks.set(i.key,l)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=he(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=Lo(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=he(s.from,l)),s.vel.length!==l&&(s.vel=he(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let g;if(this.easing==="spring"){let u=Math.exp(-a*c),f=a*c>=8&&a*c<20,y=0;for(let d=0;d<l;d++){let p=s.from[d]-s.to[d],T=s.vel[d]+a*p;s.cur[d]=s.to[d]+(p+T*c)*u,s.curVel[d]=(s.vel[d]-a*T*c)*u,f&&y<.15&&(y=Math.max(y,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/a)))}g=a*c>=20||f&&y<.15,s.progress=Math.min(1,1-(1+a*c)*u)}else{let u=Math.min(1,c/o),f=r(u),y=Fo(this.easing,u)/o;for(let d=0;d<l;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*f,s.curVel[d]=(s.to[d]-s.from[d])*y;g=u>=1,s.progress=f}if(g){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},ye=new Set,Be=0;function Pn(e){Be=0;let t=Array.from(ye);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||ye.delete(n)}ye.size&&typeof requestAnimationFrame<"u"&&(Be=requestAnimationFrame(Pn))}function Ln(e){return ye.add(e),!Be&&typeof requestAnimationFrame<"u"&&(Be=requestAnimationFrame(Pn)),()=>{ye.delete(e)}}function Do(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 Fn(e,t){let n=(0,F.useMemo)(()=>Do(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:c="spring",duration:l=900,stagger:g=0}=t,u=(0,F.useRef)(null),f=(0,F.useRef)("init"),y=(0,F.useRef)(null),d=(0,F.useRef)(s),p=(0,F.useRef)(i),T=(0,F.useRef)(!1),k=(0,F.useRef)(0),[,v]=(0,F.useState)(0),A=(0,F.useRef)(null),$=(0,F.useRef)(!0);u.current||(u.current=new Ie,u.current.configure(c,l),u.current.snap(n),y.current=n);let C=u.current;if(C.configure(c,l),y.current!==n){let w=f.current,h=!Object.is(d.current,s);C.sameTargets(n)?C.refreshData(n):!r||w==="init"?C.snap(n):w==="idle"?C.hold(n):w==="running"||h?C.update(n,we(),g):C.snap(n),y.current=n,d.current=s}let z=(0,F.useRef)(()=>!1);z.current=w=>{if(!$.current)return!1;let h=C.step(w);return!h&&f.current==="running"&&(f.current="done"),v(R=>(R+1)%1e9),h||(A.current=null),h};let j=(0,F.useCallback)(()=>{if(!Q||A.current||!C.animating)return;let w=h=>z.current(h);A.current=Ln(w)},[C]);J(()=>{let w=!Object.is(p.current,i);if(p.current=i,!r){(f.current!=="done"||C.animating)&&(C.snap(y.current??n),f.current="done",v(h=>h+1));return}f.current==="init"||w&&a?(C.hold(y.current??n),f.current="idle",T.current=!1,v(h=>h+1)):w&&(T.current=!0)},[r,i]),J(()=>{!r||!a||!T.current||(T.current=!1,C.hold(y.current??n),f.current="idle",v(w=>w+1))},[a,r]),(0,F.useEffect)(()=>{r&&o&&f.current==="idle"&&(C.start(we()),k.current+=1,f.current="running",j(),v(w=>w+1))},[r,o,i,C,j]),(0,F.useEffect)(()=>{C.animating&&j()}),(0,F.useEffect)(()=>($.current=!0,()=>{$.current=!1,A.current?.(),A.current=null}),[]);let V=we(),E=C.elapsed(V),O=r&&f.current==="idle";return{items:C.items(),get:w=>C.get(w),elapsed:O?0:E,fade:(w,h=320)=>O?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-w)/h)):1,waiting:O,animating:C.animating,generation:k.current}}var Eo=S(_(),1);var En=S(L(),1);var Dn=e=>e?"neutralStrong":"accent";var ct=S(L(),1);function _n(e,t,n,r){if(typeof e!="function")return re(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let c=o.get(r(i,s));c!==void 0&&e(i,s)&&a.add(c)}),a}var _o=S(_(),1);var mt=S(L(),1),Oo={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}, ${Ce(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},On={en:Oo,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}일 이동평균`}},ut=["ink","muted","dim"];function In(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,ut.length)}var Io=S(_(),1);var jn=S(L(),1),Bo={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ce(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},zo={en:Bo,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Bn=(e,t)=>zo[e].other(t);function zn(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,gn(o.map(a=>a.value)))}}var Hn=e=>Number.isFinite(e)&&e>0?e:0;var dt=S(_(),1);var Z=S(L(),1),Ho={radial:"Radial bar chart",gauge:"Gauge",vsTarget:"vs. target",current:"Current",target:"Target",targetWord:"target",achieved:"Achieved",range:"Range",rangeWord:"range",span:(e,t)=>`${e} to ${t}`},jo={en:Ho,ko:{radial:"방사형 막대",gauge:"게이지",vsTarget:"목표 대비",current:"현재",target:"목표",targetWord:"목표",achieved:"달성률",range:"범위",rangeWord:"범위",span:(e,t)=>`${e}~${t}`}};function ft(e){let t=An(e,{height:h=>Math.max(200,Math.min(270,h*.6)),duration:1e3,stagger:120,format:"percent"}),{p:n,width:r,height:o}=t,a=jo[t.lang],i=e.max??100,s=Math.max(30,Math.min(360,e.sweep??270)),c=s/360*de,l=(0,dt.useMemo)(()=>{let h=ce(e.label,"label"),R=Pe(e.value,"value"),b=e.data.map((M,W)=>({d:M,i:W,label:h(M,W),value:R(M,W)||0})),P=re(e.highlight,b.map(M=>M.d),b.map(M=>M.label),b.map(M=>M.value),"max");return b.map(M=>({i:M.i,label:M.label,value:M.value,frac:Math.max(0,Math.min(1,M.value/i)),hi:P.has(M.i),datum:M.d}))},[e.data,e.label,e.value,e.highlight,i]),g=Math.max(1,l.length),u=Math.max(30,Math.min(o/2-6,r/2-8)),f=r/2+(s<360?u*.18:0),y=o/2,d=u*.26,p=(u-d)/g,T=Math.max(4,Math.min(18,p*.64)),k=h=>u-p*h-p/2,v=0,A=t.motion.stagger??120,$=(0,dt.useMemo)(()=>l.map((h,R)=>({key:`r:${h.label}`,to:[h.frac],from:[0],enter:[0],delay:R*A,data:h})),[l,A]),C=Fn($,t.motion),z=Kt(n,"accent"),j=l.map(h=>({datum:h.datum,index:h.i,key:h.label,label:h.label,value:h.value,formatted:t.fv(h.value)})),V=null;if(t.active!==null&&l[t.active]){let h=l[t.active],[R,b]=fe(f,y,k(t.active),v+c*h.frac);V={x:R,y:b,title:h.label,rows:[{label:t.t.value,value:t.fv(h.value),color:h.hi?z.fill:n.paint("neutralStrong")},{label:a.vsTarget,value:t.pct(h.value/i*100)}]}}let E=t.motion.duration??1e3,O=e.description??`${a.radial}. ${l.map(h=>`${h.label} ${t.fv(h.value)}`).join(", ")}.`,w=Math.max(40,f-12);return(0,Z.jsxs)(yn,{c:t,kind:a.radial,ariaLabel:e.ariaLabel,description:O,events:j,tip:V,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[C.items.map(h=>{if(h.exiting)return null;let R=h.data,b=k(R.i),P=h.v[0],M=t.active===R.i;return(0,Z.jsxs)("g",{className:"ztd-mark",opacity:t.dim(R.i),onPointerEnter:W=>t.setActive(R.i,W.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click(R.i),children:[(0,Z.jsx)("path",{d:Fe(f,y,b,v,v+c),fill:"none",stroke:n.paint("neutralSoft"),strokeWidth:T,strokeLinecap:"round"}),P>.002?(0,Z.jsx)("path",{d:Fe(f,y,b,v,v+c*P),fill:"none",stroke:R.hi?z.fill:n.paint("neutralStrong"),strokeWidth:T,strokeLinecap:"round"}):null,M&&t.via==="keyboard"?(0,Z.jsx)("path",{d:Fe(f,y,b,v,v+c),fill:"none",stroke:n.paint("ink"),strokeWidth:1.5,strokeDasharray:"2 3"}):null]},h.key)}),s<360&&t.showLabels?l.map((h,R)=>{let b=k(R),[P,M]=fe(f,y,b,v),W=Math.max(9.5,Math.min(11.5,p*.62)),ze=`${h.label} ${t.fv(h.value)}`;return(0,Z.jsx)(lt,{x:P-8,y:M,anchor:"end",size:W,weight:h.hi?800:500,fill:n.paint(h.hi?"ink":"muted"),opacity:C.fade(R*A+E*.3,280),children:wn(ze,w,W,h.hi?800:500)},R)}):null,s>=360&&l.length?(0,Z.jsx)(lt,{x:f,y,anchor:"middle",size:Math.min(22,d*.6),weight:800,fill:n.paint("ink"),opacity:C.fade(E*.4,300),children:t.fv(l.find(h=>h.hi)?.value??l[0].value)}):null]})}var ie=S(L(),1);function Vn(e,t){let n=Le(e);return n?.type==="scatter"&&t?.size!==void 0?Le("bubble"):n}function Vo(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 Wo(e,t,n,r=!1){let o=Vn(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,c=new Set(!r&&it.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),l=u=>u.filter(f=>!c.has(f.label)),g=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(g.includes(o.type)){let u=ce(a.label,"label"),f=Pe(a.value,"value"),y=o.type==="waffle",d=t.map(($,C)=>({r:$,label:u($,C),value:y?f($,C):Hn(f($,C))})),{kept:p,other:T}=y?{kept:d,other:null}:zn(d,i.other,($,C)=>({r:{},label:Bn(I(n),$),value:C})),k=re(s,p.map($=>$.r),p.map($=>$.label),p.map($=>$.value),y?"first":"max"),v=T?[...p,T]:p,A=pe(v.length,k);return v.map(($,C)=>({label:$.label,color:A[C]}))}if(o.type==="candlestick"){let u=In(Array.isArray(i.ma)?i.ma:void 0,t.length),f=On[I(n)];return[{label:f.up,color:i.upColor??"accent"},{label:f.down,color:i.downColor??"neutralStrong"},...u.map((y,d)=>({label:f.maLegend(y),color:ut[d],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let u=ce(a.series,"series"),f=nt(t.map((d,p)=>u(d,p)));if(f.length<2)return[];let y=Gt(f.length,_n(s,t,f,u));return l(f.map((d,p)=>({label:d,color:y[p],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let p=ce(a.series,"series");u=nt(t.map((T,k)=>p(T,k)))}let f=st(o.type,a,i);if(f.length){let p=pe(u.length,re(s,u,u,u.map(()=>0),"none")),T=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((k,v)=>({label:k,color:p[v]}));return[...l(T),...f.map((k,v)=>({label:k,color:Dn(v),shape:"line"}))]}if(u.length<2)return[];let y=re(s,u,u,u.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return l(u.map((p,T)=>({label:p,color:y.has(T)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let d=pe(u.length,y);return l(u.map((p,T)=>({label:p,color:d[T]})))}return[]}function Wn(e,t){let{spec:n}=e,r=Vn(n.type,n.encoding),o=(0,xe.useMemo)(()=>pn(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=mn(n,e.locale),s=q(i),c=I(s),l=Zt(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),g=fn(n),u=(0,xe.useMemo)(()=>g?an(g,s):void 0,[g,s]),f=n.options?.hidden,y=Array.isArray(f)?f.map(String):[],d=y.join(""),[p,T]=(0,xe.useState)(null);if(!r)return(0,ie.jsx)(tt,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let k=o??l.data,v=t[r.type],A={...n.options??{}},$={...Vo(r,n.encoding),...A,...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:i},C=n.card?.legend==="toggle"&&dn(r.type,n.encoding??{},A),z=p&&p.base===d?p.hidden:y;C&&($.hidden=z);let j=w=>T(h=>{let R=h&&h.base===d?h.hidden:y;return{base:d,hidden:R.includes(w)?R.filter(b=>b!==w):[...R,w]}}),V=$.height??220,E=a&&!k.length&&(l.loading||l.error||l.empty)?(0,ie.jsx)(tt,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:V,locale:i}):(0,ie.jsx)(v,{...$});if(n.card){let w=n.card,h=w.legend==="auto"||w.legend==="toggle"?Wo(n,k,s,C):w.legend,R=h?.length?C?(0,ie.jsx)(et,{items:h,hidden:z,onToggle:j,locale:i}):h:void 0,b=w.download?(0,ie.jsx)(on,{data:k,columns:hn(n),filename:w.title??r.type,formats:Array.isArray(w.download)?w.download:void 0,locale:i}):void 0;E=(0,ie.jsx)(Wt,{number:w.number,title:w.title??un(r,c),subtitle:w.subtitle,legend:R,actions:b,source:w.source||void 0,note:w.note||void 0,accent:w.accent,takeaway:w.takeaway,level:w.level,sample:w.sample,replay:w.replay!==!1,className:e.className,locale:i,children:E})}let O=e.theme??n.theme;return O&&(E=(0,ie.jsx)(Ae,{theme:O,children:E})),E}function Ko({cfg:e,components:t}){let n=_e();return Wn({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Gn(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Kn.hydrateRoot)(r,(0,ht.createElement)(Ae,{theme:o.theme,cssVars:!0},(0,ht.createElement)(Ko,{cfg:o,components:{[e]:t}})))}Gn("radialBar",ft);})();