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