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