ztd-charts-cli 0.8.0 → 0.9.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/client/skyline.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(()=>{var Na=Object.create;var
|
|
1
|
+
(()=>{var Na=Object.create;var ir=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Fa=Object.getOwnPropertyNames;var _a=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var un=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Da=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fa(t))!Pa.call(e,o)&&o!==n&&ir(e,o,{get:()=>t[o],enumerable:!(r=Ra(t,o))||r.enumerable});return e};var R=(e,t,n)=>(n=e!=null?Na(_a(e)):{},Da(t||!e||!e.__esModule?ir(n,"default",{value:e,enumerable:!0}):n,e));var Y=un((yl,sr)=>{sr.exports=globalThis.__ztdReact.react});var cr=un((xl,lr)=>{lr.exports=globalThis.__ztdReact["react-dom/client"]});var V=un((Dl,Dr)=>{Dr.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Yn=R(Y(),1),ha=R(cr(),1);var xt=R(Y(),1);var zt=R(Y(),1);var ur=R(Y(),1),Ye=(0,ur.createContext)(void 0);var hr=R(Y(),1);var La=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],mr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',dr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',De={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:mr,monoFamily:dr,radius:18,radiusCode:14,radiusMark:4},mn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:mr,monoFamily:dr,radius:18,radiusCode:14,radiusMark:4},dn={dark:De,light:mn};function Mt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function fn(e){let t={};for(let n of La){let r=e[n];typeof r=="string"&&(t[Mt(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 hn(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 Ea=`
|
|
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,${De.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,${De.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,${De.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 br(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 yr(e,t){let[n]=(0,pr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var gr=!1;function lt(){if(gr||typeof document>"u"||(gr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Ea,document.head.appendChild(e)}var Mt=N(U(),1),be=typeof window<"u"&&typeof document<"u",Se=be?Mt.useLayoutEffect:Mt.useEffect;function St(){return typeof performance<"u"?performance.now():Date.now()}var Ce=N(U(),1),Oa=(0,Ce.createContext)(void 0),Ct=new Map;function Ia(e,t){let n=Ct.get(e);return n||Ct.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size||Ct.delete(e)}}function za(e,t,n){Ct.get(e)?.forEach(r=>r(t,n))}function Ba(e,t,n){let r=e.indexOf(n.key);return r>=0||t.length>1e3?r:t.indexOf(n.label)}function xr(e,t,n,r){let o=(0,Ce.useContext)(Oa),i=t??o,[a]=(0,Ce.useState)(()=>({})),s=(0,Ce.useRef)({keys:n,labels:r});s.current={keys:n,labels:r},e.publish.current=i?u=>za(i,u===null||s.current.keys[u]===void 0?null:{key:s.current.keys[u],label:s.current.labels[u]},a):null;let l=e.applySync;(0,Ce.useEffect)(()=>{if(i)return Ia(i,(u,m)=>{if(m===a)return;let c=u?Ba(s.current.keys,s.current.labels,u):-1;l(c<0?null:c)})},[i,a,l])}function Y(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function De(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var kr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},wr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Ha=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],ja={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Ga(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Va(e){return Ga(Ha,e)}function $r(e,t){let n=Va(e);return{text:n?n[t]:e,...ja[n?.id??"basic"]}}var vr={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Le(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),vr[t.toLowerCase()]&&(t=vr[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 Mr(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 gn(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 Je(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(e){return .2126*Je(e[0])+.7152*Je(e[1])+.0722*Je(e[2])}function pn(e,t,n){let r=typeof e=="string"?Le(e):e,o=typeof t=="string"?Le(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Le(n):n:null;o[3]<1&&i&&(o=gn(o,i));let a=r[3]<1?gn(r,o):r,s=At(a),l=At(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Wa(e){return[Je(e[0]),Je(e[1]),Je(e[2])]}function hn(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 Tr(e){let[t,n,r]=Wa(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 Ka([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[hn(4.0767416621*o-3.3077115913*i+.2309699292*a),hn(-1.2684380046*o+2.6097574011*i-.3413193965*a),hn(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function Nt(e,t,n){let r=Le(e),o=Le(t);if(!r||!o)return e;let i=Tr(r),a=Tr(o),s=Math.max(0,Math.min(1,n));return Mr(Ka([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 bn(e,t,n){let r=t[0],o=-1;for(let i of t){let a=pn(i,e,n);a>o&&(o=a,r=i)}return r}function Z(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 Xa(e,t){let n=bn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return pn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):bn(t,["#FFFFFF","#000000"])}function Rt(e,t){let n=Nt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Xa(e,n),raw:n}}function ye(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=Z(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=Z(e,"neutral");else if(s===0)r[a]=Z(e,"ink");else if(s===i-1)r[a]=Z(e,"neutral");else if(i===3)r[a]=Z(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?Z(e,"strong"):Rt(e,1-l)}}),r}var yn="mix:";function Ee(e){return e({theme:un,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${yn}${o}`}).map(n=>n.fill)}function Sr(e,t){return t?.startsWith(yn)?e.mix("neutralStrong","neutral",Number(t.slice(yn.length))):e.color(t)}function ct(e,t,n){return ye(e,t+1,n).slice(0,t)}function Ft(e,t,n,r="neutral"){let o=Z(e,"accent"),i=Z(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function qe(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=Z(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=Z(e,"neutral"):s===0?r[a]=Z(e,"strong"):s===i-1?r[a]=Z(e,"neutral"):r[a]=Rt(e,1-s/(i-1))}),r}var xe=N(U(),1);var _t=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ie="en-US",Cr=new Map;function xn(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=Cr.get(r);return o||(o=new Intl.NumberFormat(e,n),Cr.set(r,o)),o}function kn(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Qe(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ie,...r}=t;return kn(xn(n,r).format(e))}var wn=e=>e!==0&&Math.abs(e)<.05,$n=(e,t,n="")=>`${Qe(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ze(e,t={}){if(!Number.isFinite(e))return"-";if(wn(e)&&t.maximumFractionDigits===void 0)return $n(e,t.locale??ie,"%");let n=Math.abs(e);return`${Qe(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Fr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ie,...r}=t;if(Y(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,l]=i[a],u=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),c=Math.round(u*10**m)/10**m;if(a>0&&c>=i[a-1][0]/s){a--;continue}return(e<0&&c!==0?"-":"")+Qe(c,{locale:n,...r,maximumFractionDigits:m})+l}}return kn(xn(n,{notation:"compact",...r}).format(e))}var Ua=(e,t=Y(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ve(e,t=ie,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=xn(t,o);return l=>Number.isFinite(l)?`${a}${kn(s.format(l))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Ze(o,{locale:t});case"ratio":return o=>Ze(o*100,{locale:t});case"compact":return o=>Fr(o,{locale:t});case"currency":return r(Ua(t));default:{let o=r({maximumFractionDigits:1});return i=>wn(i)?$n(i,t):o(i)}}}function Pt(e,t=ie,n=0){return e!==void 0?Ve(e,t):n>=1e5?r=>wn(r)?$n(r,t):Fr(r,{locale:t}):r=>Qe(r,{locale:t})}function Ya(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var vn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ja=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,qa=["january","february","march","april","may","june","july","august","september","october","november","december"],Ar=e=>{let t=e.toLowerCase();return t.length<3?0:qa.findIndex(n=>n.startsWith(t))+1},Nr=e=>+e+(+e<30?2e3:1900);function _r(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Za=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],Pr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Dr=/\{([^{}]+)\}/g;function Dt(e,t){let n;for(let r of Za)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?[Nr(n[3]),+n[2],+n[1],1]:[Nr(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=Pr.exec(e)){let r=+n[1],o=+n[3],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=Ar(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=Ar(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Tn=e=>Ja.test(e)||Dt(e)!==null;function Lr(e){let t;for(let n of e){let r=typeof n=="string"?Pr.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function ut(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(vn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return ut(`${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=Dt(n,t);if(r)return Ya(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 Rr=new Map;function mt(e,t={month:"short",day:"numeric"}){let n=ut(e);if(!n)return"-";let{locale:r=ie,...o}=t,i=r+JSON.stringify(o),a=Rr.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Rr.set(i,a)),a.format(n)}var Mn=N(B(),1),Lt=(0,xe.createContext)({theme:Pe,cssVars:!0});function Qa(e,t=Pe){return e?typeof e=="string"?mn[e]??t:fn(t,e):t}function Et(e){let t=(0,xe.useContext)(Lt),n=e.base?mn[e.base]:t.theme,r=(0,xe.useMemo)(()=>Qa(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,xe.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,xe.useMemo)(()=>dn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Mn.jsx)(Lt.Provider,{value:a,children:(0,Mn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ei=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Or(e){return ei.has(e)}function ti(e,t){let n=r=>t?`var(${Tt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Or(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Or(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)})`:Nt(e[r],e[o],i)}}}function ke(e){let t=(0,xe.useContext)(Lt);return(0,xe.useMemo)(()=>{let n=fn(t.theme,e);return ti(n,t.cssVars)},[t.theme,t.cssVars,e])}function ce(e){let t=(0,xe.useContext)(Lt);return e??t.locale??ie}function Ir(e){return e?dn(e):{}}var Ot=N(U(),1),Sn=(0,Ot.createContext)(void 0);function zr(e){let t=(0,Ot.useContext)(Sn);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var F=N(B(),1),ni={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`},ri={en:ni,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var oi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Cn=e=>ri[Y(ce(e))];function An(e){let t=ke(e.theme),n=Cn(e.locale),[r,o]=(0,It.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,u=(0,F.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((m,c)=>{let d=!s.has(m.label),g=d&&l===1,f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ai,{p:t,item:m,off:!d}),(0,F.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,F.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,F.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":g||void 0,onClick:()=>{g||(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:g?"default":void 0},children:f}):f},c)})});return a?(0,F.jsxs)(F.Fragment,{children:[u,(0,F.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:oi,children:r?n.shown(l,e.items.length):""})]}):u}function ai({p:e,item:t,off:n}){let r=Sr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,F.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,F.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,F.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,F.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function ii(e){let t=ke(e.theme),n=$r(e.level,Y(ce(e.locale)));return(0,F.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function si(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,F.jsxs)(F.Fragment,{children:[e.slice(0,r),(0,F.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Br(e){let t=ke(e.theme),n=Cn(e.locale),[r,o]=(0,It.useState)(0);Se(()=>lt(),[]);let i=()=>{o(d=>d+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,F.jsx)(An,{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,m=e.source!==void 0||e.note!==void 0?(0,F.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,c=e.takeaway!==void 0||e.level||e.sample?(0,F.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,F.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,F.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,F.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,F.jsx)(ii,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,F.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,F.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,F.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:l}):null,(0,F.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:si(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,F.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,F.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,F.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,F.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,F.jsx)("span",{}),a]}):null]}),(0,F.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,F.jsx)(Sn.Provider,{value:r,children:(0,F.jsx)(Ye.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,F.jsxs)(F.Fragment,{children:[m,c]}):c]})}function Nn(e){let t=ke(e.theme),n=Cn(e.locale),r=e.height??220;if(Se(()=>lt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,F.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,F.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,F.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,F.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,F.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,i)=>(0,F.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,F.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,F.jsx)(F.Fragment,{children:e.children})}var nt=N(U(),1);var ue=N(U(),1);var V=N(B(),1),zt=60;var Bt={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,ue.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,Se(()=>{lt()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,ue.useContext)(Ye),u=e.ariaLabel??l??e.kind,m=(0,ue.useMemo)(()=>s?`${n.length}${n.slice(0,zt).map(x=>`${x.label}${x.series??""}${x.formatted??x.value??""}`).join("")}`:"",[n,s]),c=(0,ue.useMemo)(()=>(0,V.jsx)(li,{label:u,events:n,t:t.t}),[u,m,t.t]),d=(0,ue.useRef)(null);(0,ue.useEffect)(()=>{let x=()=>{d.current=null};return window.addEventListener("scroll",x,{capture:!0,passive:!0}),window.addEventListener("resize",x,{passive:!0}),()=>{window.removeEventListener("scroll",x,{capture:!0}),window.removeEventListener("resize",x)}},[]),(0,ue.useEffect)(()=>{d.current=null},[t.width,t.height]);let g=x=>{if(x.target!==x.currentTarget)return;if(e.onKey?.(x)){x.preventDefault();return}let C=t.active,A;switch(x.key){case"ArrowRight":case"ArrowDown":A=C===null?0:(C+1)%a;break;case"ArrowLeft":case"ArrowUp":A=C===null?a-1:(C-1+a)%a;break;case"Home":A=0;break;case"End":A=a-1;break;case"Escape":if(C===null)return;A=null;break;case"Enter":case" ":C!==null&&(x.preventDefault(),t.click(C));return;default:return}x.preventDefault(),t.setActive(A,"keyboard")},{via:f,node:b,setActive:T}=t;(0,ue.useEffect)(()=>{if(f!=="touch"||!b)return;let x=C=>{b.contains(C.target)||T(null)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[f,b,T]);let k=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,M=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,P=typeof e.renderTip=="function"&&k?e.renderTip(k):null,w=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${a})`:""),D;if(v){let x=v.x*M,C=t.width*M,A=`clamp(${(4-x).toFixed(1)}px, -50%, calc(${(C-x-4).toFixed(1)}px - 100%))`,j=v.y<64;D={position:"absolute",left:x,top:v.y*M,transform:`translate(${A}, ${j?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*M-8)}}let O=x=>{d.current=null,x.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},z=x=>x?C=>{let A=d.current??(d.current=C.currentTarget.getBoundingClientRect());A.width&&x((C.clientX-A.left)/A.width*t.width,(C.clientY-A.top)/A.height*t.height,C)}:void 0,H=z(e.onPointerMove),I=z(e.onPointerDown),E=H||I?x=>{x.pointerType==="touch"&&H?.(x),I?.(x)}:void 0,_=z(e.onPointerUp),h=Ir(e.theme);return(0,V.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?g:void 0,onBlur:x=>{t.via==="keyboard"&&!x.currentTarget.contains(x.relatedTarget)&&t.setActive(null)},onPointerLeave:O,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"),...h,...e.style},children:[t.pending?null:e.underlay,(0,V.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:H,onPointerDown:E,onPointerUp:_,onPointerCancel:_,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,V.jsx)("title",{id:o,children:u}),(0,V.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,V.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,v?(0,V.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:D,children:P??(0,V.jsxs)(V.Fragment,{children:[(0,V.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((x,C)=>(0,V.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,V.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(x.strong?"ink":"muted")},children:[x.color?(0,V.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:x.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,x.label]}),(0,V.jsx)("span",{style:{fontWeight:x.strong===!1?500:700},children:x.value})]},C))]})}):null,(0,V.jsx)("span",{className:"ztd-sr",style:Bt,"aria-live":"polite","aria-atomic":"true",children:w}),s&&!t.pending?c:null]})}function li({label:e,events:t,t:n}){return(0,V.jsx)("div",{className:"ztd-sr",style:Bt,children:(0,V.jsxs)("table",{children:[(0,V.jsx)("caption",{children:n.table(e)}),(0,V.jsxs)("tbody",{children:[t.slice(0,zt).map((r,o)=>(0,V.jsxs)("tr",{children:[(0,V.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,V.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>zt?(0,V.jsx)("tr",{children:(0,V.jsx)("td",{colSpan:2,children:n.more(t.length-zt)})}):null]})]})})}function Oe(e){let t=e.baseline??"central";return(0,V.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 y=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),de=y("label","string",!0,"Item name field"),ne=y("value","number",!0,"Value field"),ci=[de,ne],ui=[de,ne],mi=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],di=[de,ne],fi=[y("label","string",!0,"Leaf (lowest level) name"),ne,y("group","string",!1,"Parent group field")],hi=[y("label","string",!0,"Leaf name"),ne,y("group","string",!1,"Parent group field")],gi=[de,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],pi=[de,ne],bi=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),ne],yi=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),ne],xi=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],ki=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],Gr=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),wi=[y("x","any",!0,"x field (date, number or category)"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables)"),y("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Gr],$i=[y("x","any",!0,"x field"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("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}),Gr],vi=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],Ti=[y("x","string",!0,"Category field"),y("y","number",!0,"Value field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("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})],Mi=[de,ne],Si=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],Ci=[de,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],Ai=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],Ni=[de,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],Ri=[de,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],Fi=[de,ne],_i=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],Pi=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],Di=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),ne],Li=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),ne],Ei=[y("date","date",!0,"Date field"),ne],Oi=[y("x","any",!0,"Period field"),y("series","string",!0,"Item field"),y("rank","number",!1,"Rank field (1 is first)"),y("value","number",!1,"Value field (instead of rank, largest is first)")],Ii=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],zi=[y("label","string",!1,"Row name field")],Bi=[y("x","date",!0,"Date (period) field"),y("open","number",!0,"Open price field"),y("high","number",!0,"High price field"),y("low","number",!0,"Low price field"),y("close","number",!0,"Close price field"),y("volume","number",!1,"Volume field")],Hi=[de,ne],ji=[y("x","any",!0,"Period field (date or category)"),y("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables, back row only)"),y("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Gi=[y("value","number",!1,"Sample value field (raw rows)"),y("group","string",!1,"Group field. Up to 2 groups overlap"),y("x0","number",!1,"Bin start (pre-binned rows)"),y("x1","number",!1,"Bin end (pre-binned rows)"),y("count","number",!1,"Samples in the bin (pre-binned rows)")],Vi=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),ne],Wi=[de,ne,y("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")],Ki=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),y("value","number",!1,"Link weight. Without it every row counts 1")],Xi=[y("label","string",!0,"Row name. Items with the same name share a row"),y("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),y("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),y("group","string",!1,"Group field (one color per group, and the legend)"),y("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")],Ui=[y("label","string",!0,"Node name field"),y("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),y("group","string",!1,"Parent group field (flat rows, as in the treemap)"),y("id","string",!1,"Row id for id/parent rows. Defaults to the label"),y("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Yi=[y("region","string",!0,"Region name or code, matched to a region of options.map"),ne],Ji=[y("lon","number",!1,"Longitude (degrees)"),y("lat","number",!1,"Latitude (degrees)"),y("size","number",!1,"Value (circle area). Without it all circles match"),y("label","string",!1,"Place name"),y("region","string",!1,"Region of options.map, for rows without lon and lat"),y("group","string",!1,"Group field (one color per group)")],qi=[y("source","string",!0,"Start: a name in options.places or a region"),y("target","string",!0,"End"),y("value","number",!1,"Amount. Without it each row counts 1")],Zi=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("series","string",!1,"Series field (one color per series)"),y("label","string",!1,"Name")],jr={pie:ci,donut:ui,funnel:mi,waffle:di,treemap:fi,sunburst:hi,waterfall:gi,pareto:pi,marimekko:bi,heatmap:yi,radar:xi,bubble:ki,line:wi,area:$i,stream:vi,bar:Ti,radialBar:Mi,gauge:Si,bullet:Ci,sparkline:Ai,slope:Ni,dumbbell:Ri,lollipop:Fi,beeswarm:_i,ridgeline:Pi,sankey:Di,chord:Li,calendar:Ei,bump:Oi,box:Ii,parallel:zi,candlestick:Bi,segmented:Hi,skyline:ji,histogram:Gi,scatter:Zi,tileMap:Vi,barRace:Wi,network:Ki,timeline:Xi,tree:Ui,choropleth:Yi,symbolMap:Ji,flowMap:qi},et={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 Vr(e,t){return t==="ko"?e.nameKo:e.name}function Wr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Kr=["line","area","bar","scatter"],Xr=24,Rn=["line","area","bar","scatter","timeline"];function Fn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Ur(e,t,n){return Rn.includes(e)&&!Fn(e,t,n).length&&!(e==="scatter"&&Ht(n))}function Ht(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Yr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Qi={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 jt(e){let t=jr[e]?e:Qi[e]??Object.keys(et).find(n=>n.toLowerCase()===e.toLowerCase()||et[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!et[t]))return{type:t,component:et[t].component,name:et[t].name,nameKo:et[t].nameKo,encoding:jr[t]}}function Jr(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 jt(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 qr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function es(e,t){if(e==null||typeof e!="object")return;let n=e;if(qr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!qr(r,o))return;r=r[o]}return r}}function Ae(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function We(e,t){if(typeof e=="function")return e;let n=e??t;return r=>es(r,n)}function Gt(e,t){let n=We(e,t);return(r,o)=>Ae(n(r,o))}function Ne(e,t){let n=We(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 we(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function ts(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 ns=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function
|
|
22
|
+
`;function gr(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 pr(e,t){let[n]=(0,hr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var fr=!1;function ut(){if(fr||typeof document>"u"||(fr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Ea,document.head.appendChild(e)}var St=R(Y(),1),xe=typeof window<"u"&&typeof document<"u",Ce=xe?St.useLayoutEffect:St.useEffect;function Ct(){return typeof performance<"u"?performance.now():Date.now()}var Ae=R(Y(),1),Oa=(0,Ae.createContext)(void 0),At=new Map;function Ia(e,t){let n=At.get(e);return n||At.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size||At.delete(e)}}function za(e,t,n){At.get(e)?.forEach(r=>r(t,n))}function Ba(e,t,n){let r=e.indexOf(n.key);return r>=0||t.length>1e3?r:t.indexOf(n.label)}function br(e,t,n,r){let o=(0,Ae.useContext)(Oa),i=t??o,[a]=(0,Ae.useState)(()=>({})),s=(0,Ae.useRef)({keys:n,labels:r});s.current={keys:n,labels:r},e.publish.current=i?u=>za(i,u===null||s.current.keys[u]===void 0?null:{key:s.current.keys[u],label:s.current.labels[u]},a):null;let l=e.applySync;(0,Ae.useEffect)(()=>{if(i)return Ia(i,(u,m)=>{if(m===a)return;let c=u?Ba(s.current.keys,s.current.labels,u):-1;l(c<0?null:c)})},[i,a,l])}function J(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Le(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var yr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},xr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Ha=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],ja={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Ga(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Va(e){return Ga(Ha,e)}function kr(e,t){let n=Va(e);return{text:n?n[t]:e,...ja[n?.id??"basic"]}}var wr={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ee(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),wr[t.toLowerCase()]&&(t=wr[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 vr(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 pn(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 Je(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nt(e){return .2126*Je(e[0])+.7152*Je(e[1])+.0722*Je(e[2])}function bn(e,t,n){let r=typeof e=="string"?Ee(e):e,o=typeof t=="string"?Ee(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Ee(n):n:null;o[3]<1&&i&&(o=pn(o,i));let a=r[3]<1?pn(r,o):r,s=Nt(a),l=Nt(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Wa(e){return[Je(e[0]),Je(e[1]),Je(e[2])]}function gn(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 $r(e){let[t,n,r]=Wa(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 Ka([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[gn(4.0767416621*o-3.3077115913*i+.2309699292*a),gn(-1.2684380046*o+2.6097574011*i-.3413193965*a),gn(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function Rt(e,t,n){let r=Ee(e),o=Ee(t);if(!r||!o)return e;let i=$r(r),a=$r(o),s=Math.max(0,Math.min(1,n));return vr(Ka([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 yn(e,t,n){let r=t[0],o=-1;for(let i of t){let a=bn(i,e,n);a>o&&(o=a,r=i)}return r}function Q(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 Xa(e,t){let n=yn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return bn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):yn(t,["#FFFFFF","#000000"])}function Ft(e,t){let n=Rt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Xa(e,n),raw:n}}function ke(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=Q(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=Q(e,"neutral");else if(s===0)r[a]=Q(e,"ink");else if(s===i-1)r[a]=Q(e,"neutral");else if(i===3)r[a]=Q(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?Q(e,"strong"):Ft(e,1-l)}}),r}var xn="mix:";function Oe(e){return e({theme:mn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${xn}${o}`}).map(n=>n.fill)}function Tr(e,t){return t?.startsWith(xn)?e.mix("neutralStrong","neutral",Number(t.slice(xn.length))):e.color(t)}function Ve(e,t,n){return ke(e,t+1,n).slice(0,t)}function _t(e,t,n,r="neutral"){let o=Q(e,"accent"),i=Q(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function mt(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=Q(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=Q(e,"neutral"):s===0?r[a]=Q(e,"strong"):s===i-1?r[a]=Q(e,"neutral"):r[a]=Ft(e,1-s/(i-1))}),r}var we=R(Y(),1);var Pt=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ie="en-US",Mr=new Map;function kn(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=Mr.get(r);return o||(o=new Intl.NumberFormat(e,n),Mr.set(r,o)),o}function wn(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ze(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ie,...r}=t;return wn(kn(n,r).format(e))}var $n=e=>e!==0&&Math.abs(e)<.05,vn=(e,t,n="")=>`${Ze(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function qe(e,t={}){if(!Number.isFinite(e))return"-";if($n(e)&&t.maximumFractionDigits===void 0)return vn(e,t.locale??ie,"%");let n=Math.abs(e);return`${Ze(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Nr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ie,...r}=t;if(J(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,l]=i[a],u=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),c=Math.round(u*10**m)/10**m;if(a>0&&c>=i[a-1][0]/s){a--;continue}return(e<0&&c!==0?"-":"")+Ze(c,{locale:n,...r,maximumFractionDigits:m})+l}}return wn(kn(n,{notation:"compact",...r}).format(e))}var Ua=(e,t=J(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function We(e,t=ie,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=kn(t,o);return l=>Number.isFinite(l)?`${a}${wn(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=>qe(o,{locale:t});case"ratio":return o=>qe(o*100,{locale:t});case"compact":return o=>Nr(o,{locale:t});case"currency":return r(Ua(t));default:{let o=r({maximumFractionDigits:1});return i=>$n(i)?vn(i,t):o(i)}}}function Dt(e,t=ie,n=0){return e!==void 0?We(e,t):n>=1e5?r=>$n(r)?vn(r,t):Nr(r,{locale:t}):r=>Ze(r,{locale:t})}function Ya(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Tn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ja=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,qa=["january","february","march","april","may","june","july","august","september","october","november","december"],Sr=e=>{let t=e.toLowerCase();return t.length<3?0:qa.findIndex(n=>n.startsWith(t))+1},Cr=e=>+e+(+e<30?2e3:1900);function Rr(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Za=[/^(\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})일)?$/],Fr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,_r=/\{([^{}]+)\}/g;function Lt(e,t){let n;for(let r of Za)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?[Cr(n[3]),+n[2],+n[1],1]:[Cr(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=Fr.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=Sr(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=Sr(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Mn=e=>Ja.test(e)||Lt(e)!==null;function Pr(e){let t;for(let n of e){let r=typeof n=="string"?Fr.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function dt(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(Tn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return dt(`${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=Lt(n,t);if(r)return Ya(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 Ar=new Map;function ft(e,t={month:"short",day:"numeric"}){let n=dt(e);if(!n)return"-";let{locale:r=ie,...o}=t,i=r+JSON.stringify(o),a=Ar.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Ar.set(i,a)),a.format(n)}var Sn=R(V(),1),Et=(0,we.createContext)({theme:De,cssVars:!0});function Qa(e,t=De){return e?typeof e=="string"?dn[e]??t:hn(t,e):t}function Ot(e){let t=(0,we.useContext)(Et),n=e.base?dn[e.base]:t.theme,r=(0,we.useMemo)(()=>Qa(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,we.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,we.useMemo)(()=>fn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Sn.jsx)(Et.Provider,{value:a,children:(0,Sn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ei=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Lr(e){return ei.has(e)}function ti(e,t){let n=r=>t?`var(${Mt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Lr(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Lr(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)})`:Rt(e[r],e[o],i)}}}function $e(e){let t=(0,we.useContext)(Et);return(0,we.useMemo)(()=>{let n=hn(t.theme,e);return ti(n,t.cssVars)},[t.theme,t.cssVars,e])}function ce(e){let t=(0,we.useContext)(Et);return e??t.locale??ie}function Er(e){return e?fn(e):{}}var It=R(Y(),1),Cn=(0,It.createContext)(void 0);function Or(e){let t=(0,It.useContext)(Cn);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var P=R(V(),1),ni={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`},ri={en:ni,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var oi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},An=e=>ri[J(ce(e))];function Nn(e){let t=$e(e.theme),n=An(e.locale),[r,o]=(0,zt.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,u=(0,P.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,c)=>{let d=!s.has(m.label),g=d&&l===1,f=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(ai,{p:t,item:m,off:!d}),(0,P.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,P.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,P.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":g||void 0,onClick:()=>{g||(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:g?"default":void 0},children:f}):f},c)})});return a?(0,P.jsxs)(P.Fragment,{children:[u,(0,P.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:oi,children:r?n.shown(l,e.items.length):""})]}):u}function ai({p:e,item:t,off:n}){let r=Tr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,P.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,P.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,P.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,P.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 ii(e){let t=$e(e.theme),n=kr(e.level,J(ce(e.locale)));return(0,P.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 si(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,P.jsxs)(P.Fragment,{children:[e.slice(0,r),(0,P.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Ir(e){let t=$e(e.theme),n=An(e.locale),[r,o]=(0,zt.useState)(0);Ce(()=>ut(),[]);let i=()=>{o(d=>d+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,P.jsx)(Nn,{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,m=e.source!==void 0||e.note!==void 0?(0,P.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,P.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,P.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,P.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,P.jsx)(ii,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,P.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,P.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,P.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,P.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:si(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,P.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,P.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,P.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,P.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,P.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,P.jsx)("span",{}),a]}):null]}),(0,P.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,P.jsx)(Cn.Provider,{value:r,children:(0,P.jsx)(Ye.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,P.jsxs)(P.Fragment,{children:[m,c]}):c]})}function Rn(e){let t=$e(e.theme),n=An(e.locale),r=e.height??220;if(Ce(()=>ut(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,P.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,P.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,P.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,P.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,P.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,P.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,P.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,P.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,P.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,P.jsx)(P.Fragment,{children:e.children})}var tt=R(Y(),1);var ue=R(Y(),1);var X=R(V(),1),Bt=60;var Ht={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function zr(e){let{c:t,events:n}=e,r=(0,ue.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,Ce(()=>{ut()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,ue.useContext)(Ye),u=e.ariaLabel??l??e.kind,m=(0,ue.useMemo)(()=>s?`${n.length}${n.slice(0,Bt).map(v=>`${v.label}${v.series??""}${v.formatted??v.value??""}`).join("")}`:"",[n,s]),c=(0,ue.useMemo)(()=>(0,X.jsx)(li,{label:u,events:n,t:t.t}),[u,m,t.t]),d=(0,ue.useRef)(null);(0,ue.useEffect)(()=>{let v=()=>{d.current=null};return window.addEventListener("scroll",v,{capture:!0,passive:!0}),window.addEventListener("resize",v,{passive:!0}),()=>{window.removeEventListener("scroll",v,{capture:!0}),window.removeEventListener("resize",v)}},[]),(0,ue.useEffect)(()=>{d.current=null},[t.width,t.height]);let g=v=>{if(v.target!==v.currentTarget)return;if(e.onKey?.(v)){v.preventDefault();return}let h=t.active,L;switch(v.key){case"ArrowRight":case"ArrowDown":L=h===null?0:(h+1)%a;break;case"ArrowLeft":case"ArrowUp":L=h===null?a-1:(h-1+a)%a;break;case"Home":L=0;break;case"End":L=a-1;break;case"Escape":if(h===null)return;L=null;break;case"Enter":case" ":h!==null&&(v.preventDefault(),t.click(h));return;default:return}v.preventDefault(),t.setActive(L,"keyboard")},{via:f,node:b,setActive:T}=t;(0,ue.useEffect)(()=>{if(f!=="touch"||!b)return;let v=h=>{b.contains(h.target)||T(null)};return document.addEventListener("pointerdown",v),()=>document.removeEventListener("pointerdown",v)},[f,b,T]);let k=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,S=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,F=typeof e.renderTip=="function"&&k?e.renderTip(k):null,x=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${a})`:""),_;if($){let v=$.x*S,h=t.width*S,L=`clamp(${(4-v).toFixed(1)}px, -50%, calc(${(h-v-4).toFixed(1)}px - 100%))`,W=$.y<64;_={position:"absolute",left:v,top:$.y*S,transform:`translate(${L}, ${W?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*S-8)}}let z=v=>{d.current=null,v.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},I=v=>v?h=>{let L=d.current??(d.current=h.currentTarget.getBoundingClientRect());L.width&&v((h.clientX-L.left)/L.width*t.width,(h.clientY-L.top)/L.height*t.height,h)}:void 0,O=I(e.onPointerMove),B=I(e.onPointerDown),E=O||B?v=>{v.pointerType==="touch"&&O?.(v),B?.(v)}:void 0,N=I(e.onPointerUp),C=Er(e.theme);return(0,X.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?g:void 0,onBlur:v=>{t.via==="keyboard"&&!v.currentTarget.contains(v.relatedTarget)&&t.setActive(null)},onPointerLeave:z,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...C,...e.style},children:[t.pending?null:e.underlay,(0,X.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:O,onPointerDown:E,onPointerUp:N,onPointerCancel:N,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,X.jsx)("title",{id:o,children:u}),(0,X.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,X.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,X.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:_,children:F??(0,X.jsxs)(X.Fragment,{children:[(0,X.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((v,h)=>(0,X.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,X.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(v.strong?"ink":"muted")},children:[v.color?(0,X.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:v.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,v.label]}),(0,X.jsx)("span",{style:{fontWeight:v.strong===!1?500:700},children:v.value})]},h))]})}):null,(0,X.jsx)("span",{className:"ztd-sr",style:Ht,"aria-live":"polite","aria-atomic":"true",children:x}),s&&!t.pending?c:null]})}function li({label:e,events:t,t:n}){return(0,X.jsx)("div",{className:"ztd-sr",style:Ht,children:(0,X.jsxs)("table",{children:[(0,X.jsx)("caption",{children:n.table(e)}),(0,X.jsxs)("tbody",{children:[t.slice(0,Bt).map((r,o)=>(0,X.jsxs)("tr",{children:[(0,X.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,X.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>Bt?(0,X.jsx)("tr",{children:(0,X.jsx)("td",{colSpan:2,children:n.more(t.length-Bt)})}):null]})]})})}function Ie(e){let t=e.baseline??"central";return(0,X.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 y=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),fe=y("label","string",!0,"Item name field"),re=y("value","number",!0,"Value field"),ci=[fe,re],ui=[fe,re],mi=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],di=[fe,re],fi=[y("label","string",!0,"Leaf (lowest level) name"),re,y("group","string",!1,"Parent group field")],hi=[y("label","string",!0,"Leaf name"),re,y("group","string",!1,"Parent group field")],gi=[fe,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],pi=[fe,re],bi=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),re],yi=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),re],xi=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],ki=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],Hr=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),wi=[y("x","any",!0,"x field (date, number or category)"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables)"),y("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Hr],$i=[y("x","any",!0,"x field"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("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}),Hr],vi=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],Ti=[y("x","string",!0,"Category field"),y("y","number",!0,"Value field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("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})],Mi=[fe,re],Si=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],Ci=[fe,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],Ai=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],Ni=[fe,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],Ri=[fe,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],Fi=[fe,re],_i=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],Pi=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],Di=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),re],Li=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),re],Ei=[y("date","date",!0,"Date field"),re],Oi=[y("x","any",!0,"Period field"),y("series","string",!0,"Item field"),y("rank","number",!1,"Rank field (1 is first)"),y("value","number",!1,"Value field (instead of rank, largest is first)")],Ii=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],zi=[y("label","string",!1,"Row name field")],Bi=[y("x","date",!0,"Date (period) field"),y("open","number",!0,"Open price field"),y("high","number",!0,"High price field"),y("low","number",!0,"Low price field"),y("close","number",!0,"Close price field"),y("volume","number",!1,"Volume field")],Hi=[fe,re],ji=[y("x","any",!0,"Period field (date or category)"),y("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables, back row only)"),y("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Gi=[y("value","number",!1,"Sample value field (raw rows)"),y("group","string",!1,"Group field. Up to 2 groups overlap"),y("x0","number",!1,"Bin start (pre-binned rows)"),y("x1","number",!1,"Bin end (pre-binned rows)"),y("count","number",!1,"Samples in the bin (pre-binned rows)")],Vi=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),re],Wi=[fe,re,y("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")],Ki=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),y("value","number",!1,"Link weight. Without it every row counts 1")],Xi=[y("label","string",!0,"Row name. Items with the same name share a row"),y("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),y("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),y("group","string",!1,"Group field (one color per group, and the legend)"),y("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")],Ui=[y("label","string",!0,"Node name field"),y("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),y("group","string",!1,"Parent group field (flat rows, as in the treemap)"),y("id","string",!1,"Row id for id/parent rows. Defaults to the label"),y("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Yi=[y("region","string",!0,"Region name or code, matched to a region of options.map"),re],Ji=[y("lon","number",!1,"Longitude (degrees)"),y("lat","number",!1,"Latitude (degrees)"),y("size","number",!1,"Value (circle area). Without it all circles match"),y("label","string",!1,"Place name"),y("region","string",!1,"Region of options.map, for rows without lon and lat"),y("group","string",!1,"Group field (one color per group)")],qi=[y("source","string",!0,"Start: a name in options.places or a region"),y("target","string",!0,"End"),y("value","number",!1,"Amount. Without it each row counts 1")],Zi=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("series","string",!1,"Series field (one color per series)"),y("label","string",!1,"Name")],Br={pie:ci,donut:ui,funnel:mi,waffle:di,treemap:fi,sunburst:hi,waterfall:gi,pareto:pi,marimekko:bi,heatmap:yi,radar:xi,bubble:ki,line:wi,area:$i,stream:vi,bar:Ti,radialBar:Mi,gauge:Si,bullet:Ci,sparkline:Ai,slope:Ni,dumbbell:Ri,lollipop:Fi,beeswarm:_i,ridgeline:Pi,sankey:Di,chord:Li,calendar:Ei,bump:Oi,box:Ii,parallel:zi,candlestick:Bi,segmented:Hi,skyline:ji,histogram:Gi,scatter:Zi,tileMap:Vi,barRace:Wi,network:Ki,timeline:Xi,tree:Ui,choropleth:Yi,symbolMap:Ji,flowMap:qi},Qe={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 jr(e,t){return t==="ko"?e.nameKo:e.name}function Gr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Vr=["line","area","bar","scatter"],Wr=24,Fn=["line","area","bar","scatter","timeline"];function _n(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Kr(e,t,n){return Fn.includes(e)&&!_n(e,t,n).length&&!(e==="scatter"&&jt(n))}function jt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Xr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Qi={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 Gt(e){let t=Br[e]?e:Qi[e]??Object.keys(Qe).find(n=>n.toLowerCase()===e.toLowerCase()||Qe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Qe[t]))return{type:t,component:Qe[t].component,name:Qe[t].name,nameKo:Qe[t].nameKo,encoding:Br[t]}}function Ur(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 Gt(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 Yr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function es(e,t){if(e==null||typeof e!="object")return;let n=e;if(Yr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Yr(r,o))return;r=r[o]}return r}}function Ne(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 Ke(e,t){if(typeof e=="function")return e;let n=e??t;return r=>es(r,n)}function Vt(e,t){let n=Ke(e,t);return(r,o)=>Ne(n(r,o))}function Re(e,t){let n=Ke(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 ve(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function ts(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 ns=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Jr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(ns.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Ne(t);if(Number.isFinite(n))return n}return t}function Xe(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??ts(o),a=[],s=[],l="",u=!1;for(let f=0;f<o.length;f++){let b=o[f];u?b==='"'?o[f+1]==='"'?(l+='"',f++):u=!1:l+=b:b==='"'&&!l.trim()?(u=!0,l=""):b===i?(s.push(l),l=""):b===`
|
|
24
24
|
`||b==="\r"?(b==="\r"&&o[f+1]===`
|
|
25
|
-
`&&f++,s.push(l),a.push(s),s=[],l=""):l+=b}(l!==""||s.length)&&(s.push(l),a.push(s));let m=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let c=f=>n?Zr(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((b,T)=>[String(T),c(b)])));let d=[],g=new Set;return m[0].forEach((f,b)=>{let T=f.trim()||`col${b+1}`,k=T;for(let v=2;g.has(k);v++)k=`${T}_${v}`;g.add(k),d.push(k)}),m.slice(1).map(f=>Object.fromEntries(d.map((b,T)=>[b,c(f[T]??"")])))}function _n(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"?Zr(a[l]):a[l]??null])))}function rs(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 Qr(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 Ie(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Ie(JSON.parse(t))}catch{}return Ke(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?_n(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)?Ie(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?_n(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)?Ie(t.rows):Array.isArray(t.values)?_n(t.values):Array.isArray(t.items)?Ie(t.items):Array.isArray(t.results)?Ie(t.results):rs(t)}return[]}function Vt(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 Pn(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 m=e[l][u];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 u=1;u<r;u++){let m=0,c=0;for(let d=0;d<n;d++){let g=a(d,u),f=g-a(d,u-1),b=0;for(let T=0;T<d;T++)b+=a(T,u)-a(T,u-1);m+=g,c+=(f/2+b)*g}m&&(l-=c/m),s[u]=l}}for(let l=0;l<r;l++){if(t==="zero"){let c=0,d=0;for(let g=0;g<n;g++){let f=e[g][l],b=Number.isFinite(f)?f:0;b>=0?(o[g][l]=c,c+=b,i[g][l]=c):(o[g][l]=d,d+=b,i[g][l]=d)}continue}let u=0;for(let c=0;c<n;c++)u+=a(c,l);let m=t==="silhouette"?-u/2:s[l];for(let c=0;c<n;c++){let d=a(c,l);t==="expand"&&(d=u?d/u*100:0),o[c][l]=m,m+=d,i[c][l]=m}}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 m=0;for(let c=0;c<r;c++)m+=((o[0]?.[c]??0)+(i[n-1]?.[c]??0))/2;m/=r;for(let c=0;c<n;c++)for(let d=0;d<r;d++)o[c][d]-=m,i[c][d]-=m}return{y0:o,y1:i}}function eo(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 to(e){let t=e.length,n=e.map(u=>{let m=0,c=-1/0;return u.forEach((d,g)=>{d>c&&(c=d,m=g)}),m}),r=e.map(u=>u.reduce((m,c)=>m+(Number.isFinite(c)?c:0),0)),o=Array.from({length:t},(u,m)=>m).sort((u,m)=>n[u]-n[m]),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 os=Math.PI*2;function no(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ro(e,t,n,r){return Math.max(0,Math.min(r-1,Math.round((e-t)/(n-t||1)*(r-1))))}function oo(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function as(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ao(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var Wt=new Map;function se(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=Wt.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);as(u)?a+=ao(u):s+=ao(u)}i=a+s*(n>=600?1.07:1),Wt.size>5e3&&Wt.clear(),Wt.set(o,i)}return i*t}var so=N(B(),1),is=e=>Array.isArray(e)&&e.length===2;function io(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&is(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var uo=N(B(),1),fe=10.5;function ss(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=>Qe(a,{locale:n,maximumFractionDigits:i}))}function lo(e,t,n){let r=18;for(let o of ss(e,t,n))r=Math.max(r,se(o,fe));return Math.ceil(r+8)}function co(e,t,n=fe,r=8,o=400,i){let a=t.length;if(a<=1)return t.map((c,d)=>d);let s=t.map(c=>se(c,n,o)),l=(c,d)=>Math.abs(e[d]-e[c])<(s[c]+s[d])/2+r,u=[];for(let c of i??[])u.some(d=>l(d,c))||u.push(c);let m=c=>!u.some(d=>l(d,c));for(let c=1;c<=a;c++){let d=u.slice();for(let g=0;g<a;g+=c)m(g)&&d.push(g);if(c>1&&(a-1)%c>c/2&&m(a-1)&&d.push(a-1),d.sort((g,f)=>g-f),d.every((g,f)=>!f||!l(d[f-1],g)))return d}return[0,a-1]}function Kt(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 ze(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=Kt(a,n),u=[o,i];for(let m=0;m<4;m++){let c=Math.ceil(i/l-1e-9)*l,d=Math.floor(o/l+1e-9)*l;u=[o===0?0:o-d<=l*.3?d:o-a*s,i===0?0:c-i<=l*.3?c:i+a*s];let g=Kt(u[1]-u[0],n);if(g===l)break;l=g}return u}function mo(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.25]:[o*1.25,0];let a=Kt(i-o,n);return[Math.floor(o/a+1e-9)*a,Math.ceil(i/a-1e-9)*a]}function dt(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=Kt(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)=>dt(n,r,l),s}function Ln(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]=ze(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function ls(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(u,m=1)=>{let c=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let g of u){let f=Number((g*10**d).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:dt(e,t,3)}function fo(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=()=>ls(e[0],e[1],Math.abs(t[1]-t[0])),r}function ft(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 cs=864e5;function ho(e,t,n,r=ie){let o=t-e;if(!(o>0))return[{t:e,label:mt(e,{locale:r,month:"short",day:"numeric"})}];let i=o/cs,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),u=(m,c,d,g=!1)=>{let f=new Date(m),b=-1,T=0;for(;f.getTime()<=t&&T++<500;){if(f.getTime()>=e){let k=f.getFullYear(),v=g&&!l&&k!==b;a.push({t:f.getTime(),label:mt(f,{locale:r,...d,...v?{year:"numeric"}:{}})}),b=k}c(f)}};if(i<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),c=[1,2,3,4,6,12].find(g=>g>=m)??12,d=new Date(s);d.setMinutes(0,0,0),u(d,g=>g.setHours(g.getHours()+c),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());u(m,c=>c.setDate(c.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),u(m,c=>c.setDate(c.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=i/30.44,c=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(g=>g>=c)??120;if(d>=12){let g=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);u(g,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let g=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=g.getMonth()%d;f&&g.setMonth(g.getMonth()+(d-f)),u(g,b=>b.setMonth(b.getMonth()+d),{month:"short"},!0)}}return a}function go(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 us=(e,t,n)=>e==="date"?ut(t,n)?.getTime()??NaN:Ae(t);function po(e){if(!Tn(e.trim()))return e;let t=ut(e)?.getTime();return t===void 0||!Number.isFinite(t)?e:String(t)}function ms(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Tn(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Be(e,t,n,r,o={}){let i=We(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:We(n,"y"),u=!a&&r!==void 0?We(r,"series"):null,m=e.map((h,x)=>i(h,x)),c=o.xType??ms(m),d=o.locale??ie,g,f,b;if(c==="band"){let h=m.map(C=>String(C??""));g=we(h);let x=new Map(g.map((C,A)=>[C,A]));f=g.map((C,A)=>A),b=Int32Array.from(h,C=>x.get(C)??-1)}else{let h=c==="date"?o.dayFirst??Lr(m):void 0,x=m.map(j=>us(c,j,h)),C=Array.from(new Set(x.filter(j=>Number.isFinite(j)))).sort((j,re)=>j-re),A=new Map(C.map((j,re)=>[j,re]));f=C,g=C.map(String),b=Int32Array.from(x,j=>A.get(j)??-1)}let T=o.dateFormat,k=h=>typeof h=="string"?Dt(h.trim())?.[3]:void 0,v=c==="date"&&m.length<5e3?k(m[0]):void 0,M=(v===2||v===3)&&m.every(h=>k(h)===v),P=M&&v===3;if(c==="date"&&!T){let h=f.length>1?f[f.length-1]-f[0]:0;T=M&&v===2||h>864e5*120?{month:"short"}:h<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},h>864e5*800&&(T={year:"numeric",month:"short"})}let w;if(c==="band")w=g;else if(P&&!o.dateFormat){let h=Y(d)==="ko";w=f.map(x=>{let C=new Date(x),A=Math.floor(C.getMonth()/3)+1;return h?`${C.getFullYear()}년 ${A}분기`:`Q${A} ${C.getFullYear()}`})}else{let h=f.every(vn),x=c==="date"?new Intl.DateTimeFormat(d,T):new Intl.NumberFormat(d,h?{useGrouping:!1}:{maximumFractionDigits:6});w=f.length>1e3?go(f.length,C=>x.format(f[C])):f.map(C=>x.format(C))}let D=s?[...s]:u?we(e.map((h,x)=>String(u(h,x)??""))):[""],O=new Map(D.map((h,x)=>[h,x])),z=D.map(()=>new Array(g.length).fill(NaN)),H=D.map(()=>new Array(g.length).fill(null)),I=o.aggregate??"sum",E=I==="mean"?D.map(()=>new Uint32Array(g.length)):null,_=(h,x,C,A)=>{let j=z[h][x];I==="last"?z[h][x]=C:I==="count"?z[h][x]=(Number.isFinite(j)?j:0)+1:I==="mean"?Number.isFinite(C)&&(z[h][x]=(Number.isFinite(j)?j:0)+C,E[h][x]++):z[h][x]=Number.isFinite(j)?j+(Number.isFinite(C)?C:0):C,H[h][x]=A};for(let h=0;h<e.length;h++){let x=b[h];if(x<0)continue;let C=e[h];if(s)for(let A=0;A<s.length;A++)_(A,x,Ae(C[s[A]]),C);else{let A=u?O.get(String(u(C,h)??""))??0:0;_(A,x,Ae(l(C,h)),C)}}if(E)for(let h=0;h<z.length;h++)for(let x=0;x<g.length;x++)E[h][x]>1&&(z[h][x]/=E[h][x]);return{type:c,keys:g,xnum:f,labels:w,series:D,values:z,rows:H}}var ds=140,gt=12,bo=14,En=20,yo=12.5;function fs(e,t,n=Xr){let r=Ne(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 hs(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+gt)/(ds+gt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function gs(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*gt)/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 ht=e=>e.filter(Number.isFinite);function Xt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Gt(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return ht(n)}function xo(e,t,n,r,o,i){return Be(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function ps(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 w=t.flat(),D=r.refLines??{},[O,z]=ft([...Xt(w,r.x??"x"),...ht([Number(D.x)])]),[H,I]=ft([...Xt(w,r.y??"y"),...ht([Number(D.y)])].filter(_=>!s||_>0)),E=r.zero??!1;return{y:u??(s?Ln(H,I,a):ze(H,I,a,{zero:E,pad:.08})),x:r.xDomain??ze(O,z,Math.max(2,Math.round(o/110)),{zero:E,pad:.06}),sameKeys:!0}}let m=e==="bar",c=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),g=n.every(w=>w.keys.join("")===d),f=n.length>0&&n.every(w=>w.type!=="band"&&w.type===n[0].type),b=r.xDomain??(!m&&f?ft(n.flatMap(w=>ht(w.xnum))):void 0),T=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(T==="percent")return{x:b,sameKeys:g};if(u)return{y:u,x:b,sameKeys:g};let k=[];t.forEach((w,D)=>{let O=n[D];if(T==="stacked"||T==="auto"&&O.series.length>1){let H=Pn(O.values,"zero");H.y0.forEach(I=>k.push(...I)),H.y1.forEach(I=>k.push(...I))}else O.values.forEach(H=>k.push(...H));m&&!c&&r.line!==void 0&&xo(e,w,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(H=>k.push(...H)),m||k.push(...Xt(w,r.lower),...Xt(w,r.upper))}),m&&k.push(0),c||k.push(...io(r.annotations));for(let w of r.referenceLines??[])k.push(w.y);r.signColors&&k.push(Number(r.baseline??0));let[v,M]=ft(ht(k).filter(w=>!s||w>0));return{y:s?Ln(v,M,a):m?ze(v,M,c?Math.max(2,Math.round(o/120)):a):ze(v,M,a,{zero:r.zero??e==="area"}),x:b,sameKeys:g}}function bs(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Be(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),u=(r.yScale==="log"&&e==="line"?fo:Dn)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=lo(u,Pt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),c=n.flatMap(w=>w.series),d=r.endLabels??n.some(w=>w.series.length>1),g=m+6,f=i-(d?Math.min(i*.28,Math.max(...c.map(w=>se(w,11,700)),20)+14):10),b=l.keys.length,[T,k]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,v=l.type==="number"?b>12:b>ho(T,k,Math.max(2,Math.floor((f-g)/64)),s).length;if(l.type==="band"||!b||v)return;let M=w=>g+(l.xnum[w]-T)/(k-T)*(f-g),P=w=>se(l.labels[w],fe);for(let w=1;;w++){let D=Array.from({length:Math.ceil(b/w)},(O,z)=>z*w);if(w>=b||D.every((O,z)=>!z||M(O)-M(D[z-1])>=(P(O)+P(D[z-1]))/2+8))return D.map(O=>({value:l.xnum[O],label:l.labels[O]}))}}function ys(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 xs(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${ys(`${e}|${t}|${o}|${Vt(r)}`)}`}function ks(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 ws={en:{intro:(e,t)=>`${De(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},On=18;function ko(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=fs(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=hs(s,a,e.columns),{pw:u,ph:m}=gs(s,l,e.height),c=e.scale!=="free",d=t==="scatter"?[]:o.map(E=>xo(t,E,n,n.y,n.series,n.aggregate)),g=c?ps(t,o,d,n,u,m):{sameKeys:!1},f=c?bs(t,o,d,n,g,u,m,e.locale):void 0,b=t==="bar"&&n.orientation==="horizontal",T=c&&(!b||g.sameKeys),k=c&&(b||g.x!==void 0||g.sameKeys),v=new Set(ks(e.highlight,r)?[e.highlight].flat():[]),M=v.size>0,P=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,w=e.syncId??xs(t,e.by,n,e.data),D=_t(Ve(n.format,e.locale),n.unit),O=ws[e.lang],z=[],H=r.map(E=>E===""?O.blank:E);return{panels:r.map((E,_)=>{let h=o[_],x=H[_],C=_%l,A;if(t!=="scatter"){let re=d[_],je=pe=>re.values.reduce((le,ve)=>le+(Number.isFinite(ve[pe])?ve[pe]:0),0),W=re.keys.map((pe,le)=>le).filter(pe=>re.values.some(le=>Number.isFinite(le[pe]))),oe=W[W.length-1];z.push({first:W.length?je(W[0]):NaN,last:W.length?je(oe):NaN,total:W.reduce((pe,le)=>pe+je(le),0)}),t!=="bar"&&re.series.length===1&&oe!==void 0&&(A=D(re.values[0][oe]))}else z.push({first:NaN,last:NaN,total:h.length});let j={data:h,width:u,height:m,ariaLabel:e.title?`${e.title}, ${x}`:x,syncId:w,highlight:M?v.has(E)?P?()=>!0:void 0:"none":e.highlight,showYAxis:!T||C===0,showXAxis:!k||_+l>=a};return g.y&&(j.yDomain=g.y),g.x&&(j.xDomain=g.x),f&&(j.xTicks=f),{value:E,label:x,props:j,last:A,isPicked:v.has(E)}}),cols:l,pw:u,ph:m,isPanelPick:M,description:$s(t,e.by,H,z,i,D,O)}}function $s(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=u=>oo(r.map(m=>m[u]));if(e==="line"||e==="area"){let u=l("last");u>=0&&(s+=a.endHigh(n[u],i(r[u].last)));let m=n.filter((c,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 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 me=N(U(),1);function vs(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ts(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 Ut={threshold:.25,enoughPx:96,rootMargin:"0px"};function vo(e,t=!0){let[n,r]=(0,me.useState)({visible:!t,near:!t});return(0,me.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=Ts(a[a.length-1],Ut.threshold,Ut.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:vs(Ut.threshold),rootMargin:Ut.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 wo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Yt(e){let[t,n]=(0,me.useState)(null),[r,o]=(0,me.useState)(e??null),i=(0,me.useCallback)(a=>{n(a),a&&e===void 0&&o(wo(a))},[e]);return Se(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=u=>o(m=>m!==null&&Math.abs(m-u)<.5?m:u),s=()=>a(wo(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let m=u[u.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 Ms=()=>()=>{};function tt(){return(0,me.useSyncExternalStore)(Ms,()=>!0,()=>!1)}var $o="(prefers-reduced-motion: reduce)";function Jt(e="auto"){let[t,n]=(0,me.useState)(()=>be&&typeof window.matchMedia=="function"?window.matchMedia($o).matches:!1);return(0,me.useEffect)(()=>{if(e!=="auto"||!be||typeof window.matchMedia!="function")return;let r=window.matchMedia($o),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var $e=N(B(),1),Ss=60,Cs=420;function To(e){let t=ke(),n=e.chartProps??{},[,r,o]=Yt(e.width),i=e.width??(o||480),a=ce(e.locale??n.locale),s=Y(a),l=(0,nt.useContext)(Ye),u=e.title??l,m=e.chart.facetPlan,c=(0,nt.useMemo)(()=>{let k=ko({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 m?m(k,n,a):k},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,v)=>typeof v=="function"?String(v):v),e.highlight,e.syncId,i,e.height,u,a,s,m]),d=`${(0,nt.useId)().replace(/:/g,"")}fd`,g=Jt(n.reducedMotion??"auto"),f=tt(),b=yr({motion:{enabled:n.animate!==!1&&!g&&be},hydrated:f},{waiting:!1,generation:0}),T=e.chart;return(0,$e.jsxs)("div",{ref:r,role:"group","aria-label":u,"aria-describedby":d,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,$e.jsx)("p",{id:d,style:Bt,children:e.description??c.description}),(0,$e.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,columnGap:gt,rowGap:bo,...c.legend?{marginTop:On}:null},children:c.panels.map((k,v)=>{let M=t.paint(k.isPicked?"accentText":c.isPanelPick?"muted":"ink");return(0,$e.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...br(b,!1,"fade",v*Ss,Cs)},children:[(0,$e.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:En,fontSize:yo,fontWeight:700,lineHeight:`${En}px`,color:M},children:[(0,$e.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,$e.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,$e.jsx)(T,{...n,...k.props})]},k.value)})}),c.legend?(0,$e.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:On},children:c.legend}):null]})}var Mo=["max","min","first","last","none"];function he(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 m=-1,c=u==="max"?-1/0:1/0;r.forEach((d,g)=>{Number.isFinite(d)&&(u==="max"?d>c:d<c)&&(c=d,m=g)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((u,m)=>{m<a&&u!==null&&u!==void 0&&e(u,m)&&i.add(m)}),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((m,c)=>{m===u&&i.add(c)});return i}var ge=N(U(),1);async function As(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(Y(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Ke(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 Ke(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):Ke(i)}async function Ns(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 As(i,t.parse,o,t.locale)}return t.select&&(r=Qr(r,t.select)),t.transform?t.transform(r):Ie(r)}function So(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,ge.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ge.useState)(0),u=ce(t.locale),m=(0,ge.useRef)(t);m.current={...t,locale:u};let c=(0,ge.useRef)(e);c.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",g=t.deps??[],f=JSON.stringify(g.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),b=(0,ge.useRef)(!1);(0,ge.useEffect)(()=>{let k=c.current;if(!k||!r){a(P=>P.status==="loading"?{...P,status:"idle"}:P);return}let v=new AbortController,M=!0;return b.current=!0,a(P=>({...P,data:o?P.data:[],status:"loading",error:null})),Ns(k,{...m.current,signal:v.signal}).then(P=>{M&&a({data:P,status:"success",error:null,updatedAt:Date.now()})}).catch(P=>{!M||v.signal.aborted||a(w=>({...w,status:"error",error:P instanceof Error?P:new Error(String(P))}))}).finally(()=>{M&&(b.current=!1)}),()=>{M=!1,b.current=!1,v.abort()}},[d,r,s,f,o]),(0,ge.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{b.current||l(v=>v+1)},n);return()=>clearInterval(k)},[n,r]);let T=(0,ge.useCallback)(()=>l(k=>k+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:T}}var zn=N(B(),1),Rs=["csv","svg","png"],Fs=/^[=+\-@\t\r\n=+-@]/,_s=/var\(|color-mix\(/;function Co(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?_r(e.getTime()):String(e);return`"${(Fs.test(t)&&!Number.isFinite(Ae(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ps(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Ds(e,t){return`\uFEFF${[t.map(Co),...e.map(r=>t.map(o=>Co(r[o])))].map(r=>r.join(",")).join(`\r
|
|
25
|
+
`&&f++,s.push(l),a.push(s),s=[],l=""):l+=b}(l!==""||s.length)&&(s.push(l),a.push(s));let m=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let c=f=>n?Jr(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((b,T)=>[String(T),c(b)])));let d=[],g=new Set;return m[0].forEach((f,b)=>{let T=f.trim()||`col${b+1}`,k=T;for(let $=2;g.has(k);$++)k=`${T}_${$}`;g.add(k),d.push(k)}),m.slice(1).map(f=>Object.fromEntries(d.map((b,T)=>[b,c(f[T]??"")])))}function Pn(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"?Jr(a[l]):a[l]??null])))}function rs(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 qr(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 ze(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ze(JSON.parse(t))}catch{}return Xe(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Pn(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)?ze(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Pn(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)?ze(t.rows):Array.isArray(t.values)?Pn(t.values):Array.isArray(t.items)?ze(t.items):Array.isArray(t.results)?ze(t.results):rs(t)}return[]}function Wt(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 Dn(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 m=e[l][u];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 u=1;u<r;u++){let m=0,c=0;for(let d=0;d<n;d++){let g=a(d,u),f=g-a(d,u-1),b=0;for(let T=0;T<d;T++)b+=a(T,u)-a(T,u-1);m+=g,c+=(f/2+b)*g}m&&(l-=c/m),s[u]=l}}for(let l=0;l<r;l++){if(t==="zero"){let c=0,d=0;for(let g=0;g<n;g++){let f=e[g][l],b=Number.isFinite(f)?f:0;b>=0?(o[g][l]=c,c+=b,i[g][l]=c):(o[g][l]=d,d+=b,i[g][l]=d)}continue}let u=0;for(let c=0;c<n;c++)u+=a(c,l);let m=t==="silhouette"?-u/2:s[l];for(let c=0;c<n;c++){let d=a(c,l);t==="expand"&&(d=u?d/u*100:0),o[c][l]=m,m+=d,i[c][l]=m}}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 m=0;for(let c=0;c<r;c++)m+=((o[0]?.[c]??0)+(i[n-1]?.[c]??0))/2;m/=r;for(let c=0;c<n;c++)for(let d=0;d<r;d++)o[c][d]-=m,i[c][d]-=m}return{y0:o,y1:i}}function Zr(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 Qr(e){let t=e.length,n=e.map(u=>{let m=0,c=-1/0;return u.forEach((d,g)=>{d>c&&(c=d,m=g)}),m}),r=e.map(u=>u.reduce((m,c)=>m+(Number.isFinite(c)?c:0),0)),o=Array.from({length:t},(u,m)=>m).sort((u,m)=>n[u]-n[m]),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 os=Math.PI*2;function eo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function to(e,t,n,r){return Math.max(0,Math.min(r-1,Math.round((e-t)/(n-t||1)*(r-1))))}function no(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function as(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ro(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 Kt=new Map;function se(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=Kt.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);as(u)?a+=ro(u):s+=ro(u)}i=a+s*(n>=600?1.07:1),Kt.size>5e3&&Kt.clear(),Kt.set(o,i)}return i*t}var ao=R(V(),1),is=e=>Array.isArray(e)&&e.length===2;function oo(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&is(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var lo=R(V(),1),he=10.5;function ss(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=>Ze(a,{locale:n,maximumFractionDigits:i}))}function io(e,t,n){let r=18;for(let o of ss(e,t,n))r=Math.max(r,se(o,he));return Math.ceil(r+8)}function so(e,t,n=he,r=8,o=400,i){let a=t.length;if(a<=1)return t.map((c,d)=>d);let s=t.map(c=>se(c,n,o)),l=(c,d)=>Math.abs(e[d]-e[c])<(s[c]+s[d])/2+r,u=[];for(let c of i??[])u.some(d=>l(d,c))||u.push(c);let m=c=>!u.some(d=>l(d,c));for(let c=1;c<=a;c++){let d=u.slice();for(let g=0;g<a;g+=c)m(g)&&d.push(g);if(c>1&&(a-1)%c>c/2&&m(a-1)&&d.push(a-1),d.sort((g,f)=>g-f),d.every((g,f)=>!f||!l(d[f-1],g)))return d}return[0,a-1]}function Xt(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 Be(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=Xt(a,n),u=[o,i];for(let m=0;m<4;m++){let c=Math.ceil(i/l-1e-9)*l,d=Math.floor(o/l+1e-9)*l;u=[o===0?0:o-d<=l*.3?d:o-a*s,i===0?0:c-i<=l*.3?c:i+a*s];let g=Xt(u[1]-u[0],n);if(g===l)break;l=g}return u}function co(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.25]:[o*1.25,0];let a=Xt(i-o,n);return[Math.floor(o/a+1e-9)*a,Math.ceil(i/a-1e-9)*a]}function ht(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=Xt(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 Ln(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)=>ht(n,r,l),s}function En(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]=Be(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function ls(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(u,m=1)=>{let c=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let g of u){let f=Number((g*10**d).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:ht(e,t,3)}function uo(e,t){let n=Ln([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=()=>ls(e[0],e[1],Math.abs(t[1]-t[0])),r}function gt(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 cs=864e5;function mo(e,t,n,r=ie){let o=t-e;if(!(o>0))return[{t:e,label:ft(e,{locale:r,month:"short",day:"numeric"})}];let i=o/cs,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),u=(m,c,d,g=!1)=>{let f=new Date(m),b=-1,T=0;for(;f.getTime()<=t&&T++<500;){if(f.getTime()>=e){let k=f.getFullYear(),$=g&&!l&&k!==b;a.push({t:f.getTime(),label:ft(f,{locale:r,...d,...$?{year:"numeric"}:{}})}),b=k}c(f)}};if(i<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),c=[1,2,3,4,6,12].find(g=>g>=m)??12,d=new Date(s);d.setMinutes(0,0,0),u(d,g=>g.setHours(g.getHours()+c),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());u(m,c=>c.setDate(c.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),u(m,c=>c.setDate(c.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=i/30.44,c=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(g=>g>=c)??120;if(d>=12){let g=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);u(g,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let g=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=g.getMonth()%d;f&&g.setMonth(g.getMonth()+(d-f)),u(g,b=>b.setMonth(b.getMonth()+d),{month:"short"},!0)}}return a}function fo(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 us=(e,t,n)=>e==="date"?dt(t,n)?.getTime()??NaN:Ne(t);function ho(e){if(!Mn(e.trim()))return e;let t=dt(e)?.getTime();return t===void 0||!Number.isFinite(t)?e:String(t)}function ms(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Mn(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function He(e,t,n,r,o={}){let i=Ke(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:Ke(n,"y"),u=!a&&r!==void 0?Ke(r,"series"):null,m=e.map((C,v)=>i(C,v)),c=o.xType??ms(m),d=o.locale??ie,g,f,b;if(c==="band"){let C=m.map(h=>String(h??""));g=ve(C);let v=new Map(g.map((h,L)=>[h,L]));f=g.map((h,L)=>L),b=Int32Array.from(C,h=>v.get(h)??-1)}else{let C=c==="date"?o.dayFirst??Pr(m):void 0,v=m.map(W=>us(c,W,C)),h=Array.from(new Set(v.filter(W=>Number.isFinite(W)))).sort((W,G)=>W-G),L=new Map(h.map((W,G)=>[W,G]));f=h,g=h.map(String),b=Int32Array.from(v,W=>L.get(W)??-1)}let T=o.dateFormat,k=C=>typeof C=="string"?Lt(C.trim())?.[3]:void 0,$=c==="date"&&m.length<5e3?k(m[0]):void 0,S=($===2||$===3)&&m.every(C=>k(C)===$),F=S&&$===3;if(c==="date"&&!T){let C=f.length>1?f[f.length-1]-f[0]:0;T=S&&$===2||C>864e5*120?{month:"short"}:C<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},C>864e5*800&&(T={year:"numeric",month:"short"})}let x;if(c==="band")x=g;else if(F&&!o.dateFormat){let C=J(d)==="ko";x=f.map(v=>{let h=new Date(v),L=Math.floor(h.getMonth()/3)+1;return C?`${h.getFullYear()}년 ${L}분기`:`Q${L} ${h.getFullYear()}`})}else{let C=f.every(Tn),v=c==="date"?new Intl.DateTimeFormat(d,T):new Intl.NumberFormat(d,C?{useGrouping:!1}:{maximumFractionDigits:6});x=f.length>1e3?fo(f.length,h=>v.format(f[h])):f.map(h=>v.format(h))}let _=s?[...s]:u?ve(e.map((C,v)=>String(u(C,v)??""))):[""],z=new Map(_.map((C,v)=>[C,v])),I=_.map(()=>new Array(g.length).fill(NaN)),O=_.map(()=>new Array(g.length).fill(null)),B=o.aggregate??"sum",E=B==="mean"?_.map(()=>new Uint32Array(g.length)):null,N=(C,v,h,L)=>{let W=I[C][v];B==="last"?I[C][v]=h:B==="count"?I[C][v]=(Number.isFinite(W)?W:0)+1:B==="mean"?Number.isFinite(h)&&(I[C][v]=(Number.isFinite(W)?W:0)+h,E[C][v]++):I[C][v]=Number.isFinite(W)?W+(Number.isFinite(h)?h:0):h,O[C][v]=L};for(let C=0;C<e.length;C++){let v=b[C];if(v<0)continue;let h=e[C];if(s)for(let L=0;L<s.length;L++)N(L,v,Ne(h[s[L]]),h);else{let L=u?z.get(String(u(h,C)??""))??0:0;N(L,v,Ne(l(h,C)),h)}}if(E)for(let C=0;C<I.length;C++)for(let v=0;v<g.length;v++)E[C][v]>1&&(I[C][v]/=E[C][v]);return{type:c,keys:g,xnum:f,labels:x,series:_,values:I,rows:O}}var ds=140,bt=12,go=14,On=20,po=12.5;function fs(e,t,n=Wr){let r=Re(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 hs(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+bt)/(ds+bt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function gs(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*bt)/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 pt=e=>e.filter(Number.isFinite);function Ut(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Vt(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return pt(n)}function bo(e,t,n,r,o,i){return He(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function ps(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 x=t.flat(),_=r.refLines??{},[z,I]=gt([...Ut(x,r.x??"x"),...pt([Number(_.x)])]),[O,B]=gt([...Ut(x,r.y??"y"),...pt([Number(_.y)])].filter(N=>!s||N>0)),E=r.zero??!1;return{y:u??(s?En(O,B,a):Be(O,B,a,{zero:E,pad:.08})),x:r.xDomain??Be(z,I,Math.max(2,Math.round(o/110)),{zero:E,pad:.06}),sameKeys:!0}}let m=e==="bar",c=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),g=n.every(x=>x.keys.join("")===d),f=n.length>0&&n.every(x=>x.type!=="band"&&x.type===n[0].type),b=r.xDomain??(!m&&f?gt(n.flatMap(x=>pt(x.xnum))):void 0),T=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(T==="percent")return{x:b,sameKeys:g};if(u)return{y:u,x:b,sameKeys:g};let k=[];t.forEach((x,_)=>{let z=n[_];if(T==="stacked"||T==="auto"&&z.series.length>1){let O=Dn(z.values,"zero");O.y0.forEach(B=>k.push(...B)),O.y1.forEach(B=>k.push(...B))}else z.values.forEach(O=>k.push(...O));m&&!c&&r.line!==void 0&&bo(e,x,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(O=>k.push(...O)),m||k.push(...Ut(x,r.lower),...Ut(x,r.upper))}),m&&k.push(0),c||k.push(...oo(r.annotations));for(let x of r.referenceLines??[])k.push(x.y);r.signColors&&k.push(Number(r.baseline??0));let[$,S]=gt(pt(k).filter(x=>!s||x>0));return{y:s?En($,S,a):m?Be($,S,c?Math.max(2,Math.round(o/120)):a):Be($,S,a,{zero:r.zero??e==="area"}),x:b,sameKeys:g}}function bs(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=He(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),u=(r.yScale==="log"&&e==="line"?uo:Ln)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=io(u,Dt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),c=n.flatMap(x=>x.series),d=r.endLabels??n.some(x=>x.series.length>1),g=m+6,f=i-(d?Math.min(i*.28,Math.max(...c.map(x=>se(x,11,700)),20)+14):10),b=l.keys.length,[T,k]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=l.type==="number"?b>12:b>mo(T,k,Math.max(2,Math.floor((f-g)/64)),s).length;if(l.type==="band"||!b||$)return;let S=x=>g+(l.xnum[x]-T)/(k-T)*(f-g),F=x=>se(l.labels[x],he);for(let x=1;;x++){let _=Array.from({length:Math.ceil(b/x)},(z,I)=>I*x);if(x>=b||_.every((z,I)=>!I||S(z)-S(_[I-1])>=(F(z)+F(_[I-1]))/2+8))return _.map(z=>({value:l.xnum[z],label:l.labels[z]}))}}function ys(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 xs(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${ys(`${e}|${t}|${o}|${Wt(r)}`)}`}function ks(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 ws={en:{intro:(e,t)=>`${Le(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:"(빈 값)"}},In=18;function yo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=fs(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=hs(s,a,e.columns),{pw:u,ph:m}=gs(s,l,e.height),c=e.scale!=="free",d=t==="scatter"?[]:o.map(E=>bo(t,E,n,n.y,n.series,n.aggregate)),g=c?ps(t,o,d,n,u,m):{sameKeys:!1},f=c?bs(t,o,d,n,g,u,m,e.locale):void 0,b=t==="bar"&&n.orientation==="horizontal",T=c&&(!b||g.sameKeys),k=c&&(b||g.x!==void 0||g.sameKeys),$=new Set(ks(e.highlight,r)?[e.highlight].flat():[]),S=$.size>0,F=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,x=e.syncId??xs(t,e.by,n,e.data),_=Pt(We(n.format,e.locale),n.unit),z=ws[e.lang],I=[],O=r.map(E=>E===""?z.blank:E);return{panels:r.map((E,N)=>{let C=o[N],v=O[N],h=N%l,L;if(t!=="scatter"){let G=d[N],de=le=>G.values.reduce((be,ot)=>be+(Number.isFinite(ot[le])?ot[le]:0),0),K=G.keys.map((le,be)=>be).filter(le=>G.values.some(be=>Number.isFinite(be[le]))),oe=K[K.length-1];I.push({first:K.length?de(K[0]):NaN,last:K.length?de(oe):NaN,total:K.reduce((le,be)=>le+de(be),0)}),t!=="bar"&&G.series.length===1&&oe!==void 0&&(L=_(G.values[0][oe]))}else I.push({first:NaN,last:NaN,total:C.length});let W={data:C,width:u,height:m,ariaLabel:e.title?`${e.title}, ${v}`:v,syncId:x,highlight:S?$.has(E)?F?()=>!0:void 0:"none":e.highlight,showYAxis:!T||h===0,showXAxis:!k||N+l>=a};return g.y&&(W.yDomain=g.y),g.x&&(W.xDomain=g.x),f&&(W.xTicks=f),{value:E,label:v,props:W,last:L,isPicked:$.has(E)}}),cols:l,pw:u,ph:m,isPanelPick:S,description:$s(t,e.by,O,I,i,_,z)}}function $s(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=u=>no(r.map(m=>m[u]));if(e==="line"||e==="area"){let u=l("last");u>=0&&(s+=a.endHigh(n[u],i(r[u].last)));let m=n.filter((c,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 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 me=R(Y(),1);function vs(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ts(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 Yt={threshold:.25,enoughPx:96,rootMargin:"0px"};function wo(e,t=!0){let[n,r]=(0,me.useState)({visible:!t,near:!t});return(0,me.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=Ts(a[a.length-1],Yt.threshold,Yt.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:vs(Yt.threshold),rootMargin:Yt.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 xo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Jt(e){let[t,n]=(0,me.useState)(null),[r,o]=(0,me.useState)(e??null),i=(0,me.useCallback)(a=>{n(a),a&&e===void 0&&o(xo(a))},[e]);return Ce(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=u=>o(m=>m!==null&&Math.abs(m-u)<.5?m:u),s=()=>a(xo(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let m=u[u.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 Ms=()=>()=>{};function et(){return(0,me.useSyncExternalStore)(Ms,()=>!0,()=>!1)}var ko="(prefers-reduced-motion: reduce)";function qt(e="auto"){let[t,n]=(0,me.useState)(()=>xe&&typeof window.matchMedia=="function"?window.matchMedia(ko).matches:!1);return(0,me.useEffect)(()=>{if(e!=="auto"||!xe||typeof window.matchMedia!="function")return;let r=window.matchMedia(ko),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Te=R(V(),1),Ss=60,Cs=420;function $o(e){let t=$e(),n=e.chartProps??{},[,r,o]=Jt(e.width),i=e.width??(o||480),a=ce(e.locale??n.locale),s=J(a),l=(0,tt.useContext)(Ye),u=e.title??l,m=e.chart.facetPlan,c=(0,tt.useMemo)(()=>{let k=yo({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 m?m(k,n,a):k},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,$)=>typeof $=="function"?String($):$),e.highlight,e.syncId,i,e.height,u,a,s,m]),d=`${(0,tt.useId)().replace(/:/g,"")}fd`,g=qt(n.reducedMotion??"auto"),f=et(),b=pr({motion:{enabled:n.animate!==!1&&!g&&xe},hydrated:f},{waiting:!1,generation:0}),T=e.chart;return(0,Te.jsxs)("div",{ref:r,role:"group","aria-label":u,"aria-describedby":d,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Te.jsx)("p",{id:d,style:Ht,children:e.description??c.description}),(0,Te.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,columnGap:bt,rowGap:go,...c.legend?{marginTop:In}:null},children:c.panels.map((k,$)=>{let S=t.paint(k.isPicked?"accentText":c.isPanelPick?"muted":"ink");return(0,Te.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...gr(b,!1,"fade",$*Ss,Cs)},children:[(0,Te.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:On,fontSize:po,fontWeight:700,lineHeight:`${On}px`,color:S},children:[(0,Te.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,Te.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,Te.jsx)(T,{...n,...k.props})]},k.value)})}),c.legend?(0,Te.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:In},children:c.legend}):null]})}var vo=["max","min","first","last","none"];function ge(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 m=-1,c=u==="max"?-1/0:1/0;r.forEach((d,g)=>{Number.isFinite(d)&&(u==="max"?d>c:d<c)&&(c=d,m=g)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((u,m)=>{m<a&&u!==null&&u!==void 0&&e(u,m)&&i.add(m)}),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((m,c)=>{m===u&&i.add(c)});return i}var pe=R(Y(),1);async function As(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(J(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Xe(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 Xe(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):Xe(i)}async function Ns(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 As(i,t.parse,o,t.locale)}return t.select&&(r=qr(r,t.select)),t.transform?t.transform(r):ze(r)}function To(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,pe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,pe.useState)(0),u=ce(t.locale),m=(0,pe.useRef)(t);m.current={...t,locale:u};let c=(0,pe.useRef)(e);c.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",g=t.deps??[],f=JSON.stringify(g.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),b=(0,pe.useRef)(!1);(0,pe.useEffect)(()=>{let k=c.current;if(!k||!r){a(F=>F.status==="loading"?{...F,status:"idle"}:F);return}let $=new AbortController,S=!0;return b.current=!0,a(F=>({...F,data:o?F.data:[],status:"loading",error:null})),Ns(k,{...m.current,signal:$.signal}).then(F=>{S&&a({data:F,status:"success",error:null,updatedAt:Date.now()})}).catch(F=>{!S||$.signal.aborted||a(x=>({...x,status:"error",error:F instanceof Error?F:new Error(String(F))}))}).finally(()=>{S&&(b.current=!1)}),()=>{S=!1,b.current=!1,$.abort()}},[d,r,s,f,o]),(0,pe.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{b.current||l($=>$+1)},n);return()=>clearInterval(k)},[n,r]);let T=(0,pe.useCallback)(()=>l(k=>k+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:T}}var Bn=R(V(),1),Rs=["csv","svg","png"],Fs=/^[=+\-@\t\r\n=+-@]/,_s=/var\(|color-mix\(/;function Mo(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?Rr(e.getTime()):String(e);return`"${(Fs.test(t)&&!Number.isFinite(Ne(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ps(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Ds(e,t){return`\uFEFF${[t.map(Mo),...e.map(r=>t.map(o=>Mo(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
26
|
`)}\r
|
|
27
|
-
`}function Ls(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}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?mt(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(Dr,(m,c)=>o(i,c.trim())??(l=!0,""));l||a.push(u)}return a.length?a.map((s,l)=>(0,Do.jsx)("div",{children:s},l)):null}}function Lo(e,t,n=!1){let r=Ne(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=we(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 Eo(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return Ke(t.csv)}return null}var Go=N(U(),1);var Q=N(U(),1);function Oo(e,t){let n=ke(e.theme),[r,o,i]=Yt(e.width),a=tt(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,m=Jt(e.reducedMotion??"auto"),c=e.animate!==!1&&!m&&be,d=vo(r,e.animateOnView!==!1&&c),g=ce(e.locale),f=Y(g),b=(0,Q.useMemo)(()=>Ve(e.format,g,t.format),[e.format,g,t.format]),T=(0,Q.useCallback)(W=>Ze(W,{locale:g}),[g]),k=(0,Q.useMemo)(()=>_t(b,e.unit),[b,e.unit]),v=(0,Q.useMemo)(()=>Vt(e.data),[e.data]),[M,P]=(0,Q.useState)(null),[w,D]=(0,Q.useState)(null),O=(0,Q.useRef)([]),z=(0,Q.useRef)(e.onHover);z.current=e.onHover;let H=(0,Q.useRef)(e.onClick);H.current=e.onClick;let I=(0,Q.useRef)(null),E=(0,Q.useRef)(null),_=(0,Q.useRef)(null),h=(0,Q.useCallback)((W,oe="pointer")=>{if(_.current!==W){_.current=W;let pe=W===null?null:O.current[W]??null;queueMicrotask(()=>z.current?.(pe)),E.current?.(W)}I.current=W===null?null:oe,P(W),D(I.current)},[]),x=(0,Q.useCallback)(W=>{I.current!=="keyboard"&&(I.current=W===null?null:"sync",P(W),D(I.current))},[]),C=(0,Q.useCallback)(W=>{let oe=O.current[W];oe&&H.current?.(oe)},[]),A=zr(e.replayKey),j=e.width!==void 0||(i??0)>0,re={enabled:c,active:d.visible&&j,near:d.near,replayKey:A,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},je=(0,Q.useCallback)((W,oe=1)=>M===null||M===W?oe:oe*.38,[M]);return{p:n,width:s,height:u,measured:j,responsive:e.width===void 0,pending:be&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:re,fv:k,fmt:b,pct:T,locale:g,lang:f,t:f==="ko"?wr:kr,active:M,via:w,setActive:h,click:C,events:O,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:je,sig:v,description:e.description,reduced:m,publish:E,applySync:x}}var J=N(U(),1);function Os(e){return 1-Math.pow(1-e,3)}function Is(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function zs(e){return e==="easeInOut"?Is:e==="linear"?t=>t:Os}function Bs(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 rt(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 qt(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 Io(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 zo(e,t,n,r){if(!t||!n||t.length!==n.length)return rt(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 rt(s,n[a]))o.push(l)}return o.length===r?o:rt(e,r)}var Zt=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||!qt(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),Io(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=qt(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=zo(s.cur,s.parts,a.parts,u),s.vel=zo(s.curVel,s.parts,a.parts,u),s.parts=a.parts,s.to=a.to.slice(),Io(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=qt(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<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=qt(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=rt(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=zs(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=rt(s.from,u)),s.vel.length!==u&&(s.vel=rt(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 m;if(this.easing==="spring"){let c=Math.exp(-i*l),d=i*l>=8&&i*l<20,g=0;for(let f=0;f<u;f++){let b=s.from[f]-s.to[f],T=s.vel[f]+i*b;s.cur[f]=s.to[f]+(b+T*l)*c,s.curVel[f]=(s.vel[f]-i*T*l)*c,d&&g<.15&&(g=Math.max(g,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}m=i*l>=20||d&&g<.15,s.progress=Math.min(1,1-(1+i*l)*c)}else{let c=Math.min(1,l/o),d=r(c),g=Bs(this.easing,c)/o;for(let f=0;f<u;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*g;m=c>=1,s.progress=d}if(m){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}},pt=new Set,Qt=0;function Bo(e){Qt=0;let t=Array.from(pt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||pt.delete(n)}pt.size&&typeof requestAnimationFrame<"u"&&(Qt=requestAnimationFrame(Bo))}function Ho(e){return pt.add(e),!Qt&&typeof requestAnimationFrame<"u"&&(Qt=requestAnimationFrame(Bo)),()=>{pt.delete(e)}}function Hs(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 jo(e,t){let n=(0,J.useMemo)(()=>Hs(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:u=900,stagger:m=0}=t,c=(0,J.useRef)(null),d=(0,J.useRef)("init"),g=(0,J.useRef)(null),f=(0,J.useRef)(s),b=(0,J.useRef)(a),T=(0,J.useRef)(!1),k=(0,J.useRef)(0),[,v]=(0,J.useState)(0),M=(0,J.useRef)(null),P=(0,J.useRef)(!0);c.current||(c.current=new Zt,c.current.configure(l,u),c.current.snap(n),g.current=n);let w=c.current;if(w.configure(l,u),g.current!==n){let E=d.current,_=!Object.is(f.current,s);w.sameTargets(n)?w.refreshData(n):!r||E==="init"?w.snap(n):E==="idle"?w.hold(n):E==="running"||_?w.update(n,St(),m):w.snap(n),g.current=n,f.current=s}let D=(0,J.useRef)(()=>!1);D.current=E=>{if(!P.current)return!1;let _=w.step(E);return!_&&d.current==="running"&&(d.current="done"),v(h=>(h+1)%1e9),_||(M.current=null),_};let O=(0,J.useCallback)(()=>{if(!be||M.current||!w.animating)return;let E=_=>D.current(_);M.current=Ho(E)},[w]);Se(()=>{let E=!Object.is(b.current,a);if(b.current=a,!r){(d.current!=="done"||w.animating)&&(w.snap(g.current??n),d.current="done",v(_=>_+1));return}d.current==="init"||E&&i?(w.hold(g.current??n),d.current="idle",T.current=!1,v(_=>_+1)):E&&(T.current=!0)},[r,a]),Se(()=>{!r||!i||!T.current||(T.current=!1,w.hold(g.current??n),d.current="idle",v(E=>E+1))},[i,r]),(0,J.useEffect)(()=>{r&&o&&d.current==="idle"&&(w.start(St()),k.current+=1,d.current="running",O(),v(E=>E+1))},[r,o,a,w,O]),(0,J.useEffect)(()=>{w.animating&&O()}),(0,J.useEffect)(()=>(P.current=!0,()=>{P.current=!1,M.current?.(),M.current=null}),[]);let z=St(),H=w.elapsed(z),I=r&&d.current==="idle";return{items:w.items(),get:E=>w.get(E),elapsed:I?0:H,fade:(E,_=320)=>I?0:Number.isFinite(H)?Math.max(0,Math.min(1,(H-E)/_)):1,waiting:I,animating:w.animating,generation:k.current}}var Bn=N(B(),1);function Vo(e,t,n,r,o){if(r)return o==="categorical"?ye(e,t,n):qe(e,t,n);if(o==="categorical")return ye(e,t,n);let i=Z(e,"strong"),a=Z(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var js=N(U(),1);var Hn=N(B(),1);var Wo=e=>e?"neutralStrong":"accent";var jn=N(B(),1);function Ko(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 Gs=N(U(),1);var Vn=N(B(),1),Vs={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${De(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Xo={en:Vs,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}일 이동평균`}},Gn=["ink","muted","dim"];function Uo(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Gn.length)}var Ws=N(U(),1);var Qo=N(B(),1),Ks={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${De(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Xs={en:Ks,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Yo=(e,t)=>Xs[e].other(t);function Jo(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,no(o.map(i=>i.value)))}}var qo=e=>Number.isFinite(e)&&e>0?e:0;function Zo(e,t,n,r){return r==="emphasis"?Ft(e,t,n):ye(e,t,n)}var ee=N(U(),1);var R=N(B(),1),Us={kind:"Skyline",row:{back:"back",front:"front"},total:{back:"Back total",front:"Front total"},sum:"total",sumLabel:"Total",rate:"Front ÷ back",peak:e=>`Peak ${e}`,frontPeak:(e,t,n)=>`Front peak ${e} · ${t}${n?` (${n})`:""}`,range:(e,t)=>`${e}–${t}`,nothing:"Nothing to draw",ofBack:e=>`${e} of the back row`,cell:(e,t,n)=>`${e?`${e} `:""}${t}${n?` (${n})`:""}`,desc:(e,t,n,r)=>`${De(e,"series","series")} (${t}) stacked from ${n} to ${r}`,descPeak:(e,t)=>`Peak period ${e} at ${t}`,descFront:(e,t,n,r)=>`Front row (${e}) peaks at ${t} with ${n}${r?`, ${r} of the back row`:""}`,descFrontZero:e=>`The front row (${e}) is all zero`,merged:e=>`Neighboring periods are summed in groups of ${e}`,keys:"Use left and right arrows for periods, up and down to switch rows."},Ys={en:Us,ko:{kind:"스카이라인",row:{back:"뒷줄",front:"앞줄"},total:{back:"뒷줄 합계",front:"앞줄 합계"},sum:"합계",sumLabel:"합계",rate:"앞줄 ÷ 뒷줄",peak:e=>`최고 ${e}`,frontPeak:(e,t,n)=>`앞줄 최고 ${e} · ${t}${n?` (${n})`:""}`,range:(e,t)=>`${e}~${t}`,nothing:"그릴 값이 없어요",ofBack:e=>`뒷줄의 ${e}`,cell:(e,t,n)=>`${e?`${e} `:""}${t}${n?`(${n})`:""}`,desc:(e,t,n,r)=>`계열 ${e}개(${t})를 ${n}부터 ${r}까지 쌓았어요`,descPeak:(e,t)=>`가장 많은 기간 ${e} ${t}`,descFront:(e,t,n,r)=>`앞줄(${e})이 가장 많은 기간 ${t} ${n}${r?`, 뒷줄의 ${r}`:""}`,descFrontZero:e=>`앞줄(${e})은 모두 0이에요`,merged:e=>`이웃 기간을 ${e}개씩 합쳤어요`,keys:"←→로 기간을, ↑↓로 앞줄과 뒷줄을 옮겨요."}},Js=.52,Kn=.14,ra=.05,Xn=[.1,.32],qs=20,Zs=40,Fe=.8944271909999159,Ue=.4472135954999579,Wn=10,Qs=20,Re=4,en=26,ea=18,el=["back","front"],tl=["back"],L=e=>Math.round(e*10)/10,bt=e=>e.map(([t,n])=>`${L(t)},${L(n)}`).join(" "),Xe=e=>e.reduce((t,n)=>t+n,0),ta=(e,t,n,r,o=400)=>{let i=se(t,n,o)/2;return Math.max(i+2,Math.min(r-i-2,e))};function nl(e,t){for(let n=1;n<t;n++){let r=Math.ceil(t/n);if(r<=Zs&&e/(r+.55)>=qs)return n}return Math.max(1,t)}function oa(e,t,n){let r=t-n*(Math.ceil(t/n)-1);return e===0?[0,r]:[r+(e-1)*n,r+e*n]}function na(e,t,n){return Array.from({length:Math.ceil(t/n)},(r,o)=>{let[i,a]=oa(o,t,n);return e.map(s=>Xe(s.slice(i,a).map(l=>Number.isFinite(l)&&l>0?l:0)))})}function rl(e){let t=Math.min(Xn[1],Math.max(Xn[0],e.depth)),n=k=>e.width-Wn-(e.wall?k+14:8),r=0,o=0,i=[],a=[],s=[0,1];for(let k=0;k<3;k++){let v=nl(n(o),e.n);if(v===r)break;r=v,i=na(e.back,e.n,r),a=na(e.front,e.n,r),s=ze(0,Math.max(0,...i.map(Xe),...a.map(Xe)),4);let M=e.tickFmt(s[1]);o=e.wall?Math.max(...dt(s[0],s[1],4).map(P=>se(M(P),fe))):0}let l=i.length,u=Math.max(1,n(o)/(l+.55)),m=Js*u,c=(Kn+ra)*u,d=c+t*u,g=e.height-e.below,f=g-d*Ue,b=e.legendH+Qs,T=k=>Wn+k*u;return{merge:r,shown:l,back:i,front:a,backTotal:i.map(Xe),frontTotal:a.map(Xe),ticks:dt(s[0],s[1],4),fmt:e.tickFmt(s[1]),k:Math.max(0,f-b)/(s[1]||1),s:u,w:m,floor:g,wallBase:f,top:b,shift:[c*Fe,c*Ue],depthFront:Kn*u,depthBack:t*u,wallX:[Wn+d*Fe-6,T(l-1)+m+d*Fe+6],slotX:T}}function ol(e,t){return t?e==="ArrowUp"?"back":e==="ArrowDown"?"front":null:null}function al(e,t){let n=0;return e.map(r=>n+=r*t)}function il(e,t){let n=e.d*Fe,r=-e.d*Ue,o=e.base-t;return[[e.x,o],[e.x+n,o+r],[e.x+e.w+n,o+r],[e.x+e.w+n,e.base+r],[e.x+e.w,e.base],[e.x,e.base]]}function sl(e){let{p:t,g:n,cum:r,colors:o,hatch:i}=e,a=n.d*Fe,s=-n.d*Ue,l=n.x+n.w,u=(T,k)=>bt([[l,T],[l+a,T+s],[l+a,k+s],[l,k]]),m=r[r.length-1]??0,c=n.base-m,d=[],g=[],f=0;if(r.forEach((T,k)=>{let v=n.base-f,M=n.base-T;T>f&&(d.push((0,R.jsx)("rect",{x:L(n.x),y:L(M),width:L(n.w),height:L(T-f),fill:o[k].fill},`f${k}`)),d.push((0,R.jsx)("polygon",{points:u(M,v),fill:o[k].fill},`s${k}`)),f>0&&g.push((0,R.jsx)("polyline",{points:bt([[n.x,v],[l,v],[l+a,v+s]]),fill:"none",stroke:t.paint("panel"),strokeWidth:1.2},`g${k}`))),f=T}),m<1)return(0,R.jsx)("g",{children:d});let b=u(c,n.base);return(0,R.jsxs)("g",{children:[d,(0,R.jsx)("polygon",{points:b,fill:"#000",fillOpacity:e.shade}),i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("rect",{x:L(n.x),y:L(c),width:L(n.w),height:L(m),fill:i}),(0,R.jsx)("polygon",{points:b,fill:i})]}):null,g,(0,R.jsx)("line",{x1:L(l),x2:L(l),y1:L(c),y2:L(n.base),stroke:t.paint("panel"),strokeOpacity:.7}),(0,R.jsx)("polygon",{points:bt([[n.x,c],[l,c],[l+a,c+s],[n.x+a,c+s]]),fill:e.lid,stroke:e.lidStroke?t.paint("neutralStrong"):void 0,strokeOpacity:e.lidStroke?.55:void 0,strokeLinejoin:"round"})]})}function Un(e){let{p:t}=e;return(0,R.jsx)("text",{x:L(e.x),y:L(e.y),dy:"0.35em",fontSize:e.size??11.5,fill:t.paint("ink"),textAnchor:"middle",fontWeight:700,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),stroke:t.paint("panel"),strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke",style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}function ll(e,t){let n=[],r=0,o=0;for(let i of e){let a=15+se(i.name,11.5);if(r>0){let s=i.divider?28:14;r+s+a>t?(r=0,o++):r+=s}n.push({x:r,line:o}),r+=a}return n}function cl(e){let{p:t,rates:n}=e,r=Math.max(0,...n.map(s=>s??0)),o=mo(0,r,2)[1],i=r>0?n.indexOf(r):-1,a=e.top+en;return(0,R.jsxs)("g",{"aria-hidden":"true",children:[(0,R.jsx)(Oe,{x:e.from,y:e.top-8,size:11,fill:t.paint("muted"),children:e.title}),(0,R.jsx)("line",{x1:L(e.from),x2:L(e.to),y1:L(e.top),y2:L(e.top),stroke:t.paint("line2")}),(0,R.jsx)("line",{x1:L(e.from),x2:L(e.to),y1:L(a),y2:L(a),stroke:t.paint("line")}),n.map((s,l)=>{if(s===null||s<=0)return null;let u=s/o*en;return(0,R.jsx)("rect",{x:L(e.x(l)),y:L(a-u),width:L(e.w),height:L(u),rx:Math.min(1.5,u/2),fill:t.paint(l===i?"accent":"neutralStrong")},l)}),(0,R.jsx)(Oe,{x:e.right,y:a,size:fe,fill:t.paint("muted"),children:"0"}),(0,R.jsx)(Oe,{x:e.right,y:e.top,size:fe,fill:t.paint("muted"),children:e.pct(o)}),i>=0?(0,R.jsx)(Un,{p:t,x:e.x(i)+e.w/2,y:a-r/o*en-8,size:11,opacity:e.fade(i),children:e.pct(r)}):null]})}function Yn(e){let t=e.frontRate==="strip"&&e.front!==void 0,n=Oo(e,{height:p=>Math.max(300,Math.min(440,p*.58))+(t?40:0),duration:800,stagger:40}),{p:r,width:o,height:i}=n,a=Ys[n.lang],s=(0,ee.useId)().replace(/:/g,""),[l,u]=(0,ee.useState)("back"),m=(0,ee.useMemo)(()=>e.front===void 0?[]:Array.isArray(e.front)?e.front:[e.front],[e.front]),c=(0,ee.useMemo)(()=>Be(e.data,e.x,e.y,e.series,{locale:n.locale,dayFirst:e.dayFirst}),[e.data,e.x,e.y,e.series,n.locale,e.dayFirst]),d=(0,ee.useMemo)(()=>m.length?Be(e.data,e.x,m,void 0,{locale:n.locale,xType:c.type,dayFirst:e.dayFirst}).values:[],[e.data,e.x,m,n.locale,c,e.dayFirst]),g=typeof e.y=="string"?e.y:n.t.value,f=(0,ee.useMemo)(()=>c.series.map(p=>p||g),[c,g]),b=(0,ee.useMemo)(()=>[...f,...m],[f,m]),T=f.length,k=m.length,v=k>0,M=v?l:"back",P=e.frontRate??"label",w=e.texture??"front",D=e.wall!==!1,O=t&&v,z=v&&!t&&n.showLabels,H=(0,ee.useMemo)(()=>T>1||v?b.map((p,$)=>({name:p,divider:$===T&&T>0})):[],[b,T,v]),I=(0,ee.useMemo)(()=>ll(H,o),[H,o]),E=I.length?(I[I.length-1].line+1)*ea+6:0,_=Re+(O?70:z?48:22),h=(0,ee.useMemo)(()=>rl({width:o,height:i,back:c.values,front:d,n:c.keys.length,depth:e.depth??Xn[1],wall:D,legendH:E,below:_,tickFmt:p=>Pt(e.format,n.locale,p)}),[o,i,c,d,e.depth,D,E,_,e.format,n.locale]),{shown:x,merge:C}=h,A=(0,ee.useMemo)(()=>{let p=c.keys.length;return Array.from({length:x},($,S)=>{let[G,K]=oa(S,p,C),X=K-1,q=G===X;return{label:q?c.labels[G]:a.range(c.labels[G],c.labels[X]),key:q?c.keys[G]:`${c.keys[G]}~${c.keys[X]}`,sync:po(c.keys[G]),datum:q?c.rows[0]?.[G]??null:null}})},[x,C,c,a]),j=(0,ee.useMemo)(()=>{let p=e.highlight,$=typeof p=="string"?b.includes(p):Array.isArray(p)&&p.some(X=>typeof X=="string"&&b.includes(X));if(T===1&&!$){let X=he(p,A.map(q=>q.datum),A.map(q=>q.label),h.backTotal,"max");return{periods:Ft(r,x,X),back:[Z(r,"neutral")],front:qe(r,k,new Set)}}let S=[...f.map((X,q)=>Xe(h.back.map(te=>te[q]))),...m.map((X,q)=>Xe(h.front.map(te=>te[q])))],G=he(typeof p=="function"?void 0:p,b,b,S,"first"),K=(X,q)=>new Set([...G].filter(te=>te>=X&&te<X+q).map(te=>te-X));return{periods:null,back:qe(r,T,K(0,T)),front:qe(r,k,K(T,k))}},[e.highlight,b,T,k,A,h,r,x,f,m]),re=(p,$)=>$==="front"?j.front:j.periods?[j.periods[p]]:j.back,je=At(Le(r.theme.panel)??[0,0,0,1])<.4?.3:.16,W=`url(#${s}h)`,oe=p=>w==="all"||w==="front"&&p==="front",pe=r.mix("panel","neutralSoft",.5),le=(p,$)=>$==="back"?{x:h.slotX(p)+h.shift[0],base:h.floor-h.shift[1],w:h.w,d:h.depthBack}:{x:h.slotX(p),base:h.floor,w:h.w,d:h.depthFront},ve=(p,$)=>$==="back"?h.backTotal[p]:h.frontTotal[p],qn=(p,$)=>$==="back"?h.back[p]:h.front[p],tn=(p,$)=>{let S=le(p,$);return S.base-ve(p,$)*h.k-S.d*Ue},ot=v?el:tl,ba=n.motion.duration??800,nn=Math.min(n.motion.stagger??40,600/Math.max(1,x-1)),ya=(0,ee.useMemo)(()=>A.flatMap((p,$)=>ot.map(S=>{let G=al(S==="back"?h.back[$]:h.front[$],h.k),K=G.map(()=>0);return{key:`${p.key}|${S}`,to:G,from:K,enter:K,delay:$*nn+(S==="front"?120:0),data:{i:$,r:S}}})),[h,A,ot,nn]),Zn=jo(ya,n.motion),Qn=new Map;for(let p of Zn.items)p.exiting||Qn.set(`${p.data.i}|${p.data.r}`,p);let rn=p=>Zn.fade(p*nn+ba*.7,260),Te=n.fv,er=p=>Ze(p*100,{locale:n.locale,maximumFractionDigits:1}),on=p=>h.backTotal[p]>0?h.frontTotal[p]/h.backTotal[p]:null,xt=p=>{let $=on(p);return $===null?"":er($)},tr=(p,$)=>($==="back"?f:m).map((S,G)=>({name:S,v:qn(p,$)[G],sw:re(p,$)[G]})).reverse(),an=(p,$)=>tr(p,$).map(S=>`${S.name} ${Te(S.v)}`).join(", "),kt=p=>(p==="back"?T:k)>1,xa=(p,$)=>{let S=kt($)?[an(p,$),`${a.sum} ${Te(ve(p,$))}`]:[an(p,$)];return $==="front"&&P!==!1&&on(p)!==null&&S.push(a.ofBack(xt(p))),`${A[p].label}${v?` ${a.row[$]}`:""}: ${S.join(", ")} (${p+1}/${x})`},at=h.backTotal.every(p=>p===0)&&h.frontTotal.every(p=>p===0),ka=(0,ee.useMemo)(()=>at?[]:A.map((p,$)=>({datum:p.datum,index:$,key:p.key,label:p.label,series:v?a.row[M]:void 0,value:ve($,M),formatted:ot.map(S=>a.cell(v?a.row[S]:"",Te(ve($,S)),kt(S)?an($,S):"")).join(", ")})),[h,A,a,M,Te,f,m]),nr=(0,ee.useMemo)(()=>({keys:A.map(p=>p.sync),labels:A.map(p=>p.label)}),[A]);xr(n,e.syncId,nr.keys,nr.labels);let ae=n.active!==null&&n.active<x&&!at?n.active:null,wa=(p,$,S)=>{let G=le(p,"back"),K=(G.w+G.d*Fe)/2,X=G.x+K,q=Math.min(tn(p,"back"),tn(p,"front")),te=40+$.length*18;if(q-te-14>=2)return{x:X,y:q,title:S,rows:$};let sr=Math.max(112,se(S,11.5,600),...$.map(ln=>(ln.color?15:0)+se(ln.label??"",12)+16+se(ln.value,12,700)))+24,sn=K+12+sr/2,Aa=Math.max(4,Math.min(q,i-te-4));return{x:X+sn+sr/2<=o-4?X+sn:X-sn,y:Aa+te+14,title:S,rows:$}},rr=null;if(ae!==null){let p=[];for(let $ of ot){let S=$===M;for(let G of tr(ae,$))p.push({label:G.name,value:Te(G.v),color:G.sw.fill,strong:kt($)?S?void 0:!1:S});kt($)&&p.push({label:v?a.total[$]:a.sumLabel,value:Te(ve(ae,$)),strong:S})}v&&P!==!1&&p.push({label:a.rate,value:xt(ae)||"-",strong:!1}),rr=wa(ae,p,A[ae].label)}let $a=ae!==null&&n.via==="keyboard"?xa(ae,M):void 0,Ge=h.backTotal.indexOf(Math.max(...h.backTotal)),Me=v?h.frontTotal.indexOf(Math.max(...h.frontTotal)):-1,or=a.kind;if(x){let p=[a.kind,a.desc(T,f.join(", "),A[0].label,A[x-1].label),a.descPeak(A[Ge].label,Te(h.backTotal[Ge]))];v&&p.push(h.frontTotal[Me]>0?a.descFront(m.join(", "),A[Me].label,Te(h.frontTotal[Me]),xt(Me)):a.descFrontZero(m.join(", "))),C>1&&p.push(a.merged(C)),or=p.join(". ")}let va=`${e.description??`${or}.`}${v?` ${a.keys}`:""}`,ar=(0,ee.useMemo)(()=>{let p=A.map(($,S)=>ta(h.slotX(S)+h.w/2,$.label,fe,o));return{xs:p,show:co(p,A.map($=>$.label),fe,6)}},[h,A,o]),ir=h.floor+Re+20,wt=O?ir+en+14:h.floor+Re+12,Ta=(p,$,S)=>{if(at)return;let G=ro(p,h.slotX(0)+h.s*.49,h.slotX(x-1)+h.s*.49,x),K=!S&&v&&$>=h.floor-h.frontTotal[G]*h.k-6?"front":"back";K!==l&&u(K),G!==n.active&&n.setActive(G,S?"touch":"pointer")},$t=h.top-10,it=h.slotX(0)-8,st=h.slotX(x-1)+h.w+8,vt=(Kn+ra)*h.s+h.depthBack+8,Ma=bt([[it,h.floor+Re],[st,h.floor+Re],[st+vt*Fe,h.floor+Re-vt*Ue],[it+vt*Fe,h.floor+Re-vt*Ue]]),Sa=()=>{let p=le(Ge,"back"),$=a.peak(Te(h.backTotal[Ge])),S=Math.min(p.x+(p.w+p.d*Fe)/2,(D?h.wallX[1]:o-2)-se($,11.5,700)/2);return(0,R.jsx)(Un,{p:r,x:S,y:tn(Ge,"back")-11,opacity:rn(Ge),children:$})},Ca=()=>{let p=P==="label"?xt(Me):"",$=a.frontPeak(A[Me].label,Te(h.frontTotal[Me]),p),S=h.slotX(Me)+h.w/2;return(0,R.jsxs)("g",{opacity:rn(Me),children:[(0,R.jsx)("line",{x1:L(S),x2:L(S),y1:L(wt+8),y2:L(wt+14),stroke:r.paint("muted")}),(0,R.jsx)(Un,{p:r,x:ta(S,$,11,o,700),y:wt+25,size:11,children:$})]})};return(0,R.jsxs)(Hr,{c:n,kind:a.kind,ariaLabel:e.ariaLabel,description:va,events:ka,tip:rr,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,announce:$a,onPointerMove:(p,$,S)=>Ta(p,$,S.pointerType==="touch"),onKey:p=>{let $=ol(p.key,v);return $===null?!1:($!==l&&u($),ae===null&&!at&&n.setActive(0,"keyboard"),!0)},defs:w!=="none"?(0,R.jsx)("pattern",{id:`${s}h`,width:4,height:4,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:(0,R.jsx)("rect",{width:1.6,height:4,fill:r.paint("panel"),fillOpacity:.55})}):void 0,children:[(0,R.jsx)("g",{"aria-hidden":"true",children:H.map((p,$)=>{let{x:S,line:G}=I[$],K=G*ea+9,X=$>=T;return(0,R.jsxs)("g",{children:[p.divider&&S>0?(0,R.jsx)("line",{x1:S-14,x2:S-14,y1:K-7,y2:K+7,stroke:r.paint("line")}):null,(0,R.jsx)("rect",{x:S,y:K-5,width:10,height:10,rx:2,fill:X?j.front[$-T].fill:j.back[$].fill}),oe(X?"front":"back")?(0,R.jsx)("rect",{x:S,y:K-5,width:10,height:10,rx:2,fill:W}):null,(0,R.jsx)(Oe,{x:S+15,y:K,size:11.5,fill:r.paint("muted"),children:p.name})]},$)})}),at?(0,R.jsx)(Oe,{x:o/2,y:(h.top+h.floor)/2,anchor:"middle",size:13,fill:r.paint("muted"),children:a.nothing}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("g",{"aria-hidden":"true",children:[D?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("rect",{x:L(h.wallX[0]),y:L($t),width:L(Math.max(0,h.wallX[1]-h.wallX[0])),height:L(Math.max(0,h.wallBase-$t)),fill:r.paint("line2"),fillOpacity:.6}),h.ticks.map(p=>{let $=h.wallBase-p*h.k;return(0,R.jsxs)("g",{children:[(0,R.jsx)("line",{x1:L(h.wallX[0]),x2:L(h.wallX[1]),y1:L($),y2:L($),stroke:r.paint("line")}),(0,R.jsx)(Oe,{x:h.wallX[1]+6,y:$,size:fe,fill:r.paint("muted"),children:h.fmt(p)})]},p)})]}):null,(0,R.jsx)("polygon",{points:Ma,fill:r.paint("neutralSoft")}),(0,R.jsx)("rect",{x:L(it),y:L(h.floor+Re),width:L(Math.max(0,st-it)),height:Re,fill:r.paint("line")})]}),A.map((p,$)=>(0,R.jsxs)("g",{className:"ztd-mark",opacity:ae===null||ae===$?1:.38,onClick:()=>n.click($),style:{cursor:e.onClick?"pointer":void 0},children:[(0,R.jsx)("rect",{x:L(h.slotX($)),y:L($t),width:L(h.s),height:L(Math.max(0,i-$t)),fill:"transparent"}),ot.map(S=>{let G=Qn.get(`${$}|${S}`);if(!G)return null;let K=le($,S),X=ve($,S)*h.k;if(X>0&&X<1){let q=qn($,S),te=q.length-1;for(;te>0&&!(q[te]>0);)te--;return(0,R.jsx)("line",{x1:L(K.x),x2:L(K.x+K.w),y1:L(K.base-.5),y2:L(K.base-.5),stroke:re($,S)[te].fill},S)}return(0,R.jsx)(sl,{p:r,g:K,cum:G.v,colors:re($,S),hatch:oe(S)?W:null,lid:S==="back"?pe:r.paint("neutralSoft"),lidStroke:S==="back",shade:je},S)}),ae===$&&n.via!=="sync"?(0,R.jsx)("polygon",{points:bt(il(le($,M),ve($,M)*h.k)),fill:"none",stroke:r.paint("ink"),strokeWidth:2,strokeLinejoin:"round",pointerEvents:"none"}):null]},p.key)),n.showLabels&&h.backTotal[Ge]>0?Sa():null,O?(0,R.jsx)(cl,{p:r,rates:A.map((p,$)=>on($)),x:h.slotX,w:h.w,from:it,to:st,top:ir,right:D?h.wallX[1]+6:st+6,title:a.rate,pct:er,fade:rn}):null,(0,R.jsx)("g",{"aria-hidden":"true",children:ar.show.map(p=>(0,R.jsx)(Oe,{x:ar.xs[p],y:wt,anchor:"middle",size:fe,fill:r.paint(ae===p?"ink":"muted"),weight:ae===p?700:400,children:A[p].label},p))}),z&&h.frontTotal[Me]>0?Ca():null]})]})}var ul=N(U(),1);var la=N(B(),1);function aa(e,t){return t===!1?e.map((n,r)=>r):to(e)}function ia(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 sa(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]=Z(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?Z(e,"neutral"):Rt(e,1-a/Math.max(1,o.length-1))),r}function ca(e){return!e||typeof e!="object"||Array.isArray(e)?[]:we(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function ua(e,t){return ct(e,t+1,new Set)}var ml=N(U(),1);var da=N(B(),1);function ma(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Mo.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var _e=N(B(),1);function fa(e,t,n){let r=jt(e);return r?.type==="scatter"&&t?.size!==void 0&&!Ht(n)?jt("bubble"):r}function dl(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 fl(e,t,n,r=!1){let o=fa(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&&Rn.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),u=c=>c.filter(d=>!l.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let c=Ne(i.label,"label"),d=Gt(i.value,"value"),g=o.type==="waffle",f=t.map((w,D)=>({r:w,label:c(w,D),value:g?d(w,D):qo(d(w,D))})),{kept:b,other:T}=g?{kept:f,other:null}:Jo(f,a.other,(w,D)=>({r:{},label:Yo(Y(n),w),value:D})),k=he(s,b.map(w=>w.r),b.map(w=>w.label),b.map(w=>w.value),g?"first":"max"),v=T?[...b,T]:b,M=Ee(w=>g?ye(w,v.length,k):Zo(w,v.length,k,a.colorMode)),P=g&&a.shape==="arc";return v.map((w,D)=>({label:w.label,color:M[D],...P&&{shape:"circle"}}))}if(o.type==="candlestick"){let c=Uo(Array.isArray(a.ma)?a.ma:void 0,t.length),d=Xo[Y(n)];return[{label:d.up,color:a.upColor??"accent"},{label:d.down,color:a.downColor??"neutralStrong"},...c.map((g,f)=>({label:d.maLegend(g),color:Gn[f],shape:"line"}))]}if(o.type==="network"){let c=ca(a.groups);if(c.length<2)return[];let d=Ee(g=>ua(g,c.length));return c.map((g,f)=>({label:g,color:d[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let c=Ne(i.group,"group"),d=we(t.map((f,b)=>c(f,b)).filter(Boolean));if(d.length<2)return[];let g=Ee(f=>ct(f,d.length,new Set));return d.map((f,b)=>({label:f,color:g[b],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||Ht(a))return[];let c=Ne(i.series,"series"),d=we(t.map((b,T)=>c(b,T)));if(d.length<2)return[];let g=Ko(s,t,d,c),f=Ee(b=>ct(b,d.length,g));return u(d.map((b,T)=>({label:b,color:f[T],shape:"circle"})))}if(o.type==="timeline"){let c=typeof i.group!="string",d=c?i.status:i.group;if(typeof d!="string")return[];let g=Lo(t,d,c),f=Ee(b=>ye(b,g.length,ma(s,g)));return u(g.map((b,T)=>({label:b,color:f[T],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 M=Ne(i.series,"series");c=we(t.map((P,w)=>M(P,w)))}let d=Fn(o.type,i,a);if(d.length){let M=he(s,c,c,c.map(()=>0),"none"),P=Ee(D=>ye(D,c.length,M)),w=c.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:c.map((D,O)=>({label:D,color:P[O]}));return[...u(w),...d.map((D,O)=>({label:D,color:Wo(O),shape:"line"}))]}if(c.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?eo(c.length,Array.isArray(a.negative)?a.negative.map(M=>c.indexOf(String(M))):[],typeof a.neutral=="string"?c.indexOf(a.neutral):-1):-1,b=f>=0?new Set([f]):he(s,c,c,c.map(()=>0),"first");if(o.type==="radar")return u(c.map((M,P)=>({label:M,color:b.has(P)?"accent":"neutralStrong",shape:"square"})));let T=a.colorMode,k=M=>ye(M,c.length,b);if((o.type==="line"||o.type==="area")&&(k=M=>Vo(M,c.length,b,o.type==="area",T)),o.type==="stream"){let M=Be(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),P=aa(M.values,a.reorder),w=ia(s,M.series,M.values);k=D=>sa(D,P,w)}let v=Ee(k);return u(c.map((M,P)=>({label:M,color:v[P],...o.type==="line"&&{shape:"line"}})))}return[]}function hl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Kr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function gl(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:u,...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:u}}function ha(e,t){let{spec:n}=e,r=fa(n.type,n.encoding,n.options),o=(0,yt.useMemo)(()=>Eo(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Wr(n,e.locale),s=ce(a),l=Y(s),u=So(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=Yr(n),c=(0,yt.useMemo)(()=>m?Po(m,s):void 0,[m,s]),d=n.options?.hidden,g=Array.isArray(d)?d.map(String):[],f=g.join(""),[b,T]=(0,yt.useState)(null);if(!r)return(0,_e.jsx)(Nn,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let k=o??u.data,v=t[r.type],M={...n.options??{}},P={...dl(r,n.encoding),...M,...c?{tooltip:c}:{},data:k,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:a},w=n.card?.legend==="toggle"&&Ur(r.type,n.encoding??{},M),D=b&&b.base===f?b.hidden:g;w&&(P.hidden=D);let O=_=>T(h=>{let x=h&&h.base===f?h.hidden:g;return{base:f,hidden:x.includes(_)?x.filter(C=>C!==_):[...x,_]}}),z=P.height??220,H=hl(n,r.type),I=i&&!k.length&&(u.loading||u.error||u.empty)?(0,_e.jsx)(Nn,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:z,locale:a}):H?(0,_e.jsx)(To,{chart:v,...gl(r.type,H,P)}):(0,_e.jsx)(v,{...P});if(n.card){let _=n.card,h=_.legend==="auto"||_.legend==="toggle"?fl(n,k,s,w):_.legend,x=h?.length?w?(0,_e.jsx)(An,{items:h,hidden:D,onToggle:O,locale:a}):h:void 0,C=_.download?(0,_e.jsx)(_o,{data:k,columns:Jr(n),filename:_.title??r.type,formats:Array.isArray(_.download)?_.download:void 0,locale:a}):void 0;I=(0,_e.jsx)(Br,{number:_.number,title:_.title??Vr(r,l),subtitle:_.subtitle,legend:x,actions:C,source:_.source||void 0,note:_.note||void 0,accent:_.accent,takeaway:_.takeaway,level:_.level,sample:_.sample,replay:_.replay!==!1,className:e.className,locale:a,children:I})}let E=e.theme??n.theme;return E&&(I=(0,_e.jsx)(Et,{theme:E,children:I})),I}function pl({cfg:e,components:t}){let n=tt();return ha({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function pa(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ga.hydrateRoot)(r,(0,Jn.createElement)(Et,{theme:o.theme,cssVars:!0},(0,Jn.createElement)(pl,{cfg:o,components:{[e]:t}})))}pa("skyline",Yn);})();
|
|
27
|
+
`}function Ls(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function zn(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var So=2,je=16;function Co(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 Ao(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 No(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+je*2,a+je*2],u=o.cloneNode(!0),m=u.querySelectorAll("*"),c=new Map;o.querySelectorAll("*").forEach((f,b)=>{let T;for(let k of Array.from(f.attributes)){if(!_s.test(k.value))continue;let $=(T??(T=getComputedStyle(f))).getPropertyValue(k.name);$&&m[b].setAttribute(k.name,Co($,c))}}),u.removeAttribute("style");for(let[f,b]of Object.entries({viewBox:`${-je} ${-je} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(f,String(b));let d=Co(getComputedStyle(r).backgroundColor,c),g=o.parentElement?.querySelector("canvas")??null;if(n){let f=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(Ao("rect",{x:-je,y:-je,width:s,height:l,fill:d}),f),g&&u.insertBefore(Ao("image",{href:g.toDataURL(),width:i,height:a}),f)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:l,vw:i,vh:a,bg:d,canvas:g}}function Es(e,t){let n=No(e,So,!1);if(!n)return;let r=So,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,je*r,je*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(l=>l&&zn(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Ro(e){let t=$e(e.theme),n=J(ce(e.locale))==="ko",r=Ls(e.filename),o=(i,a)=>{if(i==="csv")return zn(new Blob([Ds(e.data,e.columns?.length?e.columns:Ps(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return Es(a,r);let s=No(a,1,!0);s&&zn(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Bn.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Rs.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 _o=R(V(),1);function Fo(e,t=ie){let n=We(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?ft(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(_r,(m,c)=>o(i,c.trim())??(l=!0,""));l||a.push(u)}return a.length?a.map((s,l)=>(0,_o.jsx)("div",{children:s},l)):null}}function Po(e,t,n=!1){let r=Re(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=ve(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 Do(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 Xe(t.csv)}return null}var Ho=R(Y(),1);var ee=R(Y(),1);function Lo(e,t){let n=$e(e.theme),[r,o,i]=Jt(e.width),a=et(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,m=qt(e.reducedMotion??"auto"),c=e.animate!==!1&&!m&&xe,d=wo(r,e.animateOnView!==!1&&c),g=ce(e.locale),f=J(g),b=(0,ee.useMemo)(()=>We(e.format,g,t.format),[e.format,g,t.format]),T=(0,ee.useCallback)(K=>qe(K,{locale:g}),[g]),k=(0,ee.useMemo)(()=>Pt(b,e.unit),[b,e.unit]),$=(0,ee.useMemo)(()=>Wt(e.data),[e.data]),[S,F]=(0,ee.useState)(null),[x,_]=(0,ee.useState)(null),z=(0,ee.useRef)([]),I=(0,ee.useRef)(e.onHover);I.current=e.onHover;let O=(0,ee.useRef)(e.onClick);O.current=e.onClick;let B=(0,ee.useRef)(null),E=(0,ee.useRef)(null),N=(0,ee.useRef)(null),C=(0,ee.useCallback)((K,oe="pointer")=>{if(N.current!==K){N.current=K;let le=K===null?null:z.current[K]??null;queueMicrotask(()=>I.current?.(le)),E.current?.(K)}B.current=K===null?null:oe,F(K),_(B.current)},[]),v=(0,ee.useCallback)(K=>{B.current!=="keyboard"&&(B.current=K===null?null:"sync",F(K),_(B.current))},[]),h=(0,ee.useCallback)(K=>{let oe=z.current[K];oe&&O.current?.(oe)},[]),L=Or(e.replayKey),W=e.width!==void 0||(i??0)>0,G={enabled:c,active:d.visible&&W,near:d.near,replayKey:L,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},de=(0,ee.useCallback)((K,oe=1)=>S===null||S===K?oe:oe*.38,[S]);return{p:n,width:s,height:u,measured:W,responsive:e.width===void 0,pending:xe&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:G,fv:k,fmt:b,pct:T,locale:g,lang:f,t:f==="ko"?xr:yr,active:S,via:x,setActive:C,click:h,events:z,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:de,sig:$,description:e.description,reduced:m,publish:E,applySync:v}}var q=R(Y(),1);function Os(e){return 1-Math.pow(1-e,3)}function Is(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function zs(e){return e==="easeInOut"?Is:e==="linear"?t=>t:Os}function Bs(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 nt(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 Zt(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 Eo(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 Oo(e,t,n,r){if(!t||!n||t.length!==n.length)return nt(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 nt(s,n[a]))o.push(l)}return o.length===r?o:nt(e,r)}var Qt=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||!Zt(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),Eo(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Zt(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=Oo(s.cur,s.parts,a.parts,u),s.vel=Oo(s.curVel,s.parts,a.parts,u),s.parts=a.parts,s.to=a.to.slice(),Eo(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=Zt(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<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=Zt(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=nt(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=zs(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=nt(s.from,u)),s.vel.length!==u&&(s.vel=nt(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 m;if(this.easing==="spring"){let c=Math.exp(-i*l),d=i*l>=8&&i*l<20,g=0;for(let f=0;f<u;f++){let b=s.from[f]-s.to[f],T=s.vel[f]+i*b;s.cur[f]=s.to[f]+(b+T*l)*c,s.curVel[f]=(s.vel[f]-i*T*l)*c,d&&g<.15&&(g=Math.max(g,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}m=i*l>=20||d&&g<.15,s.progress=Math.min(1,1-(1+i*l)*c)}else{let c=Math.min(1,l/o),d=r(c),g=Bs(this.easing,c)/o;for(let f=0;f<u;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*g;m=c>=1,s.progress=d}if(m){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}},yt=new Set,en=0;function Io(e){en=0;let t=Array.from(yt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||yt.delete(n)}yt.size&&typeof requestAnimationFrame<"u"&&(en=requestAnimationFrame(Io))}function zo(e){return yt.add(e),!en&&typeof requestAnimationFrame<"u"&&(en=requestAnimationFrame(Io)),()=>{yt.delete(e)}}function Hs(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 Bo(e,t){let n=(0,q.useMemo)(()=>Hs(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:u=900,stagger:m=0}=t,c=(0,q.useRef)(null),d=(0,q.useRef)("init"),g=(0,q.useRef)(null),f=(0,q.useRef)(s),b=(0,q.useRef)(a),T=(0,q.useRef)(!1),k=(0,q.useRef)(0),[,$]=(0,q.useState)(0),S=(0,q.useRef)(null),F=(0,q.useRef)(!0);c.current||(c.current=new Qt,c.current.configure(l,u),c.current.snap(n),g.current=n);let x=c.current;if(x.configure(l,u),g.current!==n){let E=d.current,N=!Object.is(f.current,s);x.sameTargets(n)?x.refreshData(n):!r||E==="init"?x.snap(n):E==="idle"?x.hold(n):E==="running"||N?x.update(n,Ct(),m):x.snap(n),g.current=n,f.current=s}let _=(0,q.useRef)(()=>!1);_.current=E=>{if(!F.current)return!1;let N=x.step(E);return!N&&d.current==="running"&&(d.current="done"),$(C=>(C+1)%1e9),N||(S.current=null),N};let z=(0,q.useCallback)(()=>{if(!xe||S.current||!x.animating)return;let E=N=>_.current(N);S.current=zo(E)},[x]);Ce(()=>{let E=!Object.is(b.current,a);if(b.current=a,!r){(d.current!=="done"||x.animating)&&(x.snap(g.current??n),d.current="done",$(N=>N+1));return}d.current==="init"||E&&i?(x.hold(g.current??n),d.current="idle",T.current=!1,$(N=>N+1)):E&&(T.current=!0)},[r,a]),Ce(()=>{!r||!i||!T.current||(T.current=!1,x.hold(g.current??n),d.current="idle",$(E=>E+1))},[i,r]),(0,q.useEffect)(()=>{r&&o&&d.current==="idle"&&(x.start(Ct()),k.current+=1,d.current="running",z(),$(E=>E+1))},[r,o,a,x,z]),(0,q.useEffect)(()=>{x.animating&&z()}),(0,q.useEffect)(()=>(F.current=!0,()=>{F.current=!1,S.current?.(),S.current=null}),[]);let I=Ct(),O=x.elapsed(I),B=r&&d.current==="idle";return{items:x.items(),get:E=>x.get(E),elapsed:B?0:O,fade:(E,N=320)=>B?0:Number.isFinite(O)?Math.max(0,Math.min(1,(O-E)/N)):1,waiting:B,animating:x.animating,generation:k.current}}var Hn=R(V(),1);function jo(e,t,n,r,o){if(r)return o==="categorical"?ke(e,t,n):mt(e,t,n);if(o==="categorical")return ke(e,t,n);let i=Q(e,"strong"),a=Q(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var js=R(Y(),1);var jn=R(V(),1);var Go=e=>e?"neutralStrong":"accent";var Gn=R(V(),1);function Vo(e,t,n,r){if(typeof e!="function")return ge(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 Gs=R(Y(),1);var Wn=R(V(),1),Vs={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}, ${Le(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Wo={en:Vs,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}일 이동평균`}},Vn=["ink","muted","dim"];function Ko(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Vn.length)}var Ws=R(Y(),1);var qo=R(V(),1),Ks={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Le(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Xs={en:Ks,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Xo=(e,t)=>Xs[e].other(t);function Uo(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,eo(o.map(i=>i.value)))}}var Yo=e=>Number.isFinite(e)&&e>0?e:0;function Jo(e,t,n,r){return r==="emphasis"?_t(e,t,n):ke(e,t,n)}var te=R(Y(),1);var A=R(V(),1),Us={kind:"Skyline",row:{back:"back",front:"front"},total:{back:"Back total",front:"Front total"},sum:"total",sumLabel:"Total",rate:"Front ÷ back",peak:e=>`Peak ${e}`,frontPeak:(e,t,n)=>`Front peak ${e} · ${t}${n?` (${n})`:""}`,range:(e,t)=>`${e}–${t}`,nothing:"Nothing to draw",ofBack:e=>`${e} of the back row`,cell:(e,t,n)=>`${e?`${e} `:""}${t}${n?` (${n})`:""}`,desc:(e,t,n,r)=>`${Le(e,"series","series")} (${t}) stacked from ${n} to ${r}`,descPeak:(e,t)=>`Peak period ${e} at ${t}`,descFront:(e,t,n,r)=>`Front row (${e}) peaks at ${t} with ${n}${r?`, ${r} of the back row`:""}`,descFrontZero:e=>`The front row (${e}) is all zero`,merged:e=>`Neighboring periods are summed in groups of ${e}`,keys:"Use left and right arrows for periods, up and down to switch rows."},Ys={en:Us,ko:{kind:"스카이라인",row:{back:"뒷줄",front:"앞줄"},total:{back:"뒷줄 합계",front:"앞줄 합계"},sum:"합계",sumLabel:"합계",rate:"앞줄 ÷ 뒷줄",peak:e=>`최고 ${e}`,frontPeak:(e,t,n)=>`앞줄 최고 ${e} · ${t}${n?` (${n})`:""}`,range:(e,t)=>`${e}~${t}`,nothing:"그릴 값이 없어요",ofBack:e=>`뒷줄의 ${e}`,cell:(e,t,n)=>`${e?`${e} `:""}${t}${n?`(${n})`:""}`,desc:(e,t,n,r)=>`계열 ${e}개(${t})를 ${n}부터 ${r}까지 쌓았어요`,descPeak:(e,t)=>`가장 많은 기간 ${e} ${t}`,descFront:(e,t,n,r)=>`앞줄(${e})이 가장 많은 기간 ${t} ${n}${r?`, 뒷줄의 ${r}`:""}`,descFrontZero:e=>`앞줄(${e})은 모두 0이에요`,merged:e=>`이웃 기간을 ${e}개씩 합쳤어요`,keys:"←→로 기간을, ↑↓로 앞줄과 뒷줄을 옮겨요."}},Js={low:{cx:.8944271909999159,cy:.4472135954999579,face:.52,front:.14,gap:.05,depth:[.1,.32,.32]},high:{cx:.4472135954999579,cy:.8944271909999159,face:.54,front:.42,gap:.1,depth:[.1,.45,.42]}};var qs=20,Zs=40,Qs=.4,Zo=14,Kn=10,el=20,Fe=4,tn=26,Qo=18,tl=["back","front"],nl=["back"],D=e=>Math.round(e*10)/10,rt=e=>e.map(([t,n])=>`${D(t)},${D(n)}`).join(" "),Ue=e=>e.reduce((t,n)=>t+n,0),ea=(e,t,n,r,o=400)=>{let i=se(t,n,o)/2;return Math.max(i+2,Math.min(r-i-2,e))};function rl(e,t){for(let n=1;n<t;n++){let r=Math.ceil(t/n);if(r<=Zs&&e/(r+.55)>=qs)return n}return Math.max(1,t)}function ra(e,t,n){let r=t-n*(Math.ceil(t/n)-1);return e===0?[0,r]:[r+(e-1)*n,r+e*n]}function ta(e,t,n){return Array.from({length:Math.ceil(t/n)},(r,o)=>{let[i,a]=ra(o,t,n);return e.map(s=>Ue(s.slice(i,a).map(l=>Number.isFinite(l)&&l>0?l:0)))})}function ol(e){let t=Js[e.view??"high"],n=e.view==="low"||e.front.length?t.front:0,r=Math.min(t.depth[1],Math.max(t.depth[0],e.depth??t.depth[2])),o=O=>e.width-Kn-(e.wall?O+14:8),i=0,a=0,s=[],l=[],u=[0,1];for(let O=0;O<3;O++){let B=rl(o(a),e.n);if(B===i)break;i=B,s=ta(e.back,e.n,i),l=ta(e.front,e.n,i),u=Be(0,Math.max(0,...s.map(Ue),...l.map(Ue)),4);let E=e.tickFmt(u[1]);a=e.wall?Math.max(...ht(u[0],u[1],4).map(N=>se(E(N),he))):0}let m=s.length,c=Math.max(1,o(a)/(m+.55)),d=t.face*c,g=e.height-e.below,f=e.legendH+el,b=(n+t.gap+r)*c*t.cy,T=e.view==="low"?1:Math.min(1,Qs*Math.max(0,g-f)/(b||1)),k=(n+t.gap)*c*T,$=k+r*c*T,S=g-$*t.cy,F=Math.max(0,S-f)/(u[1]||1),x=ht(u[0],u[1],4),_=x.length>1?(x[1]-x[0])*F:1/0,z=_>=Zo?1:_>0?Math.ceil(Zo/_):x.length,I=O=>Kn+O*c;return{merge:i,shown:m,back:s,front:l,backTotal:s.map(Ue),frontTotal:l.map(Ue),ticks:x.filter((O,B)=>B%z===0),fmt:e.tickFmt(u[1]),k:F,s:c,w:d,floor:g,wallBase:S,top:f,cx:t.cx,cy:t.cy,lead:k,shift:[k*t.cx,k*t.cy],depthFront:n*c*T,depthBack:r*c*T,wallX:[Kn+$*t.cx-6,I(m-1)+d+$*t.cx+6],slotX:I}}function al(e,t){return t?e==="ArrowUp"?"back":e==="ArrowDown"?"front":null:null}function il(e,t){let n=0;return e.map(r=>n+=r*t)}function sl(e,t){let{dx:n,dy:r}=e,o=e.base-t;return[[e.x,o],[e.x+n,o+r],[e.x+e.w+n,o+r],[e.x+e.w+n,e.base+r],[e.x+e.w,e.base],[e.x,e.base]]}function na(e){let{p:t,g:n,cum:r,colors:o,hatch:i}=e,{dx:a,dy:s}=n,l=n.x+n.w,u=(k,$)=>rt([[l,k],[l+a,k+s],[l+a,$+s],[l,$]]),m=r[r.length-1]??0,c=n.base-m,d=[],g=[],f=0;if(r.forEach((k,$)=>{let S=n.base-f,F=n.base-k;k>f&&(d.push((0,A.jsx)("rect",{x:D(n.x),y:D(F),width:D(n.w),height:D(k-f),fill:o[$].fill},`f${$}`)),d.push((0,A.jsx)("polygon",{points:u(F,S),fill:o[$].fill},`s${$}`)),f>0&&g.push((0,A.jsx)("polyline",{points:rt([[n.x,S],[l,S],[l+a,S+s]]),fill:"none",stroke:t.paint("panel"),strokeWidth:1.2},`g${$}`))),f=k}),m<1&&!e.tile)return(0,A.jsx)("g",{children:d});let b=u(c,n.base),T=rt([[n.x,c],[l,c],[l+a,c+s],[n.x+a,c+s]]);return(0,A.jsxs)("g",{children:[d,m>=1?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("polygon",{points:b,fill:"#000",fillOpacity:e.shade}),i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("rect",{x:D(n.x),y:D(c),width:D(n.w),height:D(m),fill:i}),(0,A.jsx)("polygon",{points:b,fill:i})]}):null,g,(0,A.jsx)("line",{x1:D(l),x2:D(l),y1:D(c),y2:D(n.base),stroke:t.paint("panel"),strokeOpacity:.7})]}):null,(0,A.jsx)("polygon",{points:T,fill:e.lid,stroke:e.lidStroke?t.paint(e.lidInk?"ink":"neutralStrong"):void 0,strokeOpacity:e.lidStroke?e.lidInk?.4:.55:void 0,strokeLinejoin:"round"}),e.lidHatch&&i?(0,A.jsx)("polygon",{points:T,fill:i}):null]})}function Xn(e){let{p:t}=e;return(0,A.jsx)("text",{x:D(e.x),y:D(e.y),dy:"0.35em",fontSize:e.size??11.5,fill:t.paint("ink"),textAnchor:"middle",fontWeight:700,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),stroke:t.paint("panel"),strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke",style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}function ll(e,t){let n=[],r=0,o=0;for(let i of e){let a=15+se(i.name,11.5);if(r>0){let s=i.divider?28:14;r+s+a>t?(r=0,o++):r+=s}n.push({x:r,line:o}),r+=a}return n}function cl(e){let{p:t,rates:n}=e,r=Math.max(0,...n.map(s=>s??0)),o=co(0,r,2)[1],i=r>0?n.indexOf(r):-1,a=e.top+tn;return(0,A.jsxs)("g",{"aria-hidden":"true",children:[(0,A.jsx)(Ie,{x:e.from,y:e.top-8,size:11,fill:t.paint("muted"),children:e.title}),(0,A.jsx)("line",{x1:D(e.from),x2:D(e.to),y1:D(e.top),y2:D(e.top),stroke:t.paint("line2")}),(0,A.jsx)("line",{x1:D(e.from),x2:D(e.to),y1:D(a),y2:D(a),stroke:t.paint("line")}),n.map((s,l)=>{if(s===null||s<=0)return null;let u=s/o*tn;return(0,A.jsx)("rect",{x:D(e.x(l)),y:D(a-u),width:D(e.w),height:D(u),rx:Math.min(1.5,u/2),fill:t.paint(l===i?"accent":"neutralStrong")},l)}),(0,A.jsx)(Ie,{x:e.right,y:a,size:he,fill:t.paint("muted"),children:"0"}),(0,A.jsx)(Ie,{x:e.right,y:e.top,size:he,fill:t.paint("muted"),children:e.pct(o)}),i>=0?(0,A.jsx)(Xn,{p:t,x:e.x(i)+e.w/2,y:a-r/o*tn-8,size:11,opacity:e.fade(i),children:e.pct(r)}):null]})}function Un(e){let t=e.frontRate==="strip"&&e.front!==void 0,n=Lo(e,{height:p=>Math.max(300,Math.min(440,p*.58))+(t?40:0),duration:800,stagger:40}),{p:r,width:o,height:i}=n,a=Ys[n.lang],s=(0,te.useId)().replace(/:/g,""),[l,u]=(0,te.useState)("back"),m=(0,te.useMemo)(()=>e.front===void 0?[]:Array.isArray(e.front)?e.front:[e.front],[e.front]),c=(0,te.useMemo)(()=>He(e.data,e.x,e.y,e.series,{locale:n.locale,dayFirst:e.dayFirst}),[e.data,e.x,e.y,e.series,n.locale,e.dayFirst]),d=(0,te.useMemo)(()=>m.length?He(e.data,e.x,m,void 0,{locale:n.locale,xType:c.type,dayFirst:e.dayFirst}).values:[],[e.data,e.x,m,n.locale,c,e.dayFirst]),g=typeof e.y=="string"?e.y:n.t.value,f=(0,te.useMemo)(()=>c.series.map(p=>p||g),[c,g]),b=(0,te.useMemo)(()=>[...f,...m],[f,m]),T=f.length,k=m.length,$=k>0,S=$?l:"back",F=e.frontRate??"label",x=e.texture??"front",_=e.wall!==!1,z=e.view??"high",I=z==="high",O=t&&$,B=$&&!t&&n.showLabels,E=(0,te.useMemo)(()=>T>1||$?b.map((p,w)=>({name:p,divider:w===T&&T>0})):[],[b,T,$]),N=(0,te.useMemo)(()=>ll(E,o),[E,o]),C=N.length?(N[N.length-1].line+1)*Qo+6:0,v=Fe+(O?70:B?48:22),h=(0,te.useMemo)(()=>ol({width:o,height:i,back:c.values,front:d,n:c.keys.length,depth:e.depth,wall:_,view:z,legendH:C,below:v,tickFmt:p=>Dt(e.format,n.locale,p)}),[o,i,c,d,e.depth,_,z,C,v,e.format,n.locale]),{shown:L,merge:W}=h,G=(0,te.useMemo)(()=>{let p=c.keys.length;return Array.from({length:L},(w,M)=>{let[j,H]=ra(M,p,W),Z=H-1,U=j===Z;return{label:U?c.labels[j]:a.range(c.labels[j],c.labels[Z]),key:U?c.keys[j]:`${c.keys[j]}~${c.keys[Z]}`,sync:ho(c.keys[j]),datum:U?c.rows[0]?.[j]??null:null}})},[L,W,c,a]),de=(0,te.useMemo)(()=>{let p=e.highlight,w=typeof p=="string"?b.includes(p):Array.isArray(p)&&p.some(U=>typeof U=="string"&&b.includes(U)),M=U=>I?Ve(r,k,U):mt(r,k,U);if(T===1&&!w){let U=ge(p,G.map(ne=>ne.datum),G.map(ne=>ne.label),h.backTotal,"max");return{periods:_t(r,L,U),back:[Q(r,"neutral")],front:M(new Set)}}let j=[...f.map((U,ne)=>Ue(h.back.map(ye=>ye[ne]))),...m.map((U,ne)=>Ue(h.front.map(ye=>ye[ne])))],H=ge(typeof p=="function"?void 0:p,b,b,j,"first"),Z=(U,ne)=>new Set([...H].filter(ye=>ye>=U&&ye<U+ne).map(ye=>ye-U));return{periods:null,back:mt(r,T,Z(0,T)),front:M(Z(T,k))}},[e.highlight,b,T,k,G,h,r,L,f,m,I]),K=(p,w)=>w==="front"?de.front:de.periods?[de.periods[p]]:de.back,oe=Nt(Ee(r.theme.panel)??[0,0,0,1])<.4?.3:.16,le=`url(#${s}h)`,be=p=>x==="all"||x==="front"&&p==="front",ot=r.mix("panel","neutralSoft",.5),pa=r.paint("neutral"),at=(p,w)=>{let M=w==="back"?h.depthBack:h.depthFront,j=w==="back"?h.shift:[0,0];return{x:h.slotX(p)+j[0],base:h.floor-j[1],w:h.w,dx:M*h.cx,dy:-M*h.cy}},Pe=(p,w)=>w==="back"?h.backTotal[p]:h.frontTotal[p],Jn=(p,w)=>w==="back"?h.back[p]:h.front[p],nn=(p,w)=>{let M=at(p,w);return M.base-Pe(p,w)*h.k+M.dy},it=$?tl:nl,ba=n.motion.duration??800,rn=Math.min(n.motion.stagger??40,600/Math.max(1,L-1)),ya=(0,te.useMemo)(()=>G.flatMap((p,w)=>it.map(M=>{let j=il(M==="back"?h.back[w]:h.front[w],h.k),H=j.map(()=>0);return{key:`${p.key}|${M}`,to:j,from:H,enter:H,delay:w*rn+(M==="front"?120:0),data:{i:w,r:M}}})),[h,G,it,rn]),qn=Bo(ya,n.motion),Zn=new Map;for(let p of qn.items)p.exiting||Zn.set(`${p.data.i}|${p.data.r}`,p);let on=p=>qn.fade(p*rn+ba*.7,260),Me=n.fv,Qn=p=>qe(p*100,{locale:n.locale,maximumFractionDigits:1}),an=p=>h.backTotal[p]>0?h.frontTotal[p]/h.backTotal[p]:null,kt=p=>{let w=an(p);return w===null?"":Qn(w)},er=(p,w)=>(w==="back"?f:m).map((M,j)=>({name:M,v:Jn(p,w)[j],sw:K(p,w)[j]})).reverse(),sn=(p,w)=>er(p,w).map(M=>`${M.name} ${Me(M.v)}`).join(", "),wt=p=>(p==="back"?T:k)>1,xa=(p,w)=>{let M=wt(w)?[sn(p,w),`${a.sum} ${Me(Pe(p,w))}`]:[sn(p,w)];return w==="front"&&F!==!1&&an(p)!==null&&M.push(a.ofBack(kt(p))),`${G[p].label}${$?` ${a.row[w]}`:""}: ${M.join(", ")} (${p+1}/${L})`},st=h.backTotal.every(p=>p===0)&&h.frontTotal.every(p=>p===0),ka=(0,te.useMemo)(()=>st?[]:G.map((p,w)=>({datum:p.datum,index:w,key:p.key,label:p.label,series:$?a.row[S]:void 0,value:Pe(w,S),formatted:it.map(M=>a.cell($?a.row[M]:"",Me(Pe(w,M)),wt(M)?sn(w,M):"")).join(", ")})),[h,G,a,S,Me,f,m]),tr=(0,te.useMemo)(()=>({keys:G.map(p=>p.sync),labels:G.map(p=>p.label)}),[G]);br(n,e.syncId,tr.keys,tr.labels);let ae=n.active!==null&&n.active<L&&!st?n.active:null,wa=(p,w,M)=>{let j=at(p,"back"),H=(j.w+j.dx)/2,Z=j.x+H,U=Math.min(nn(p,"back"),nn(p,"front")),ne=40+w.length*18;if(U-ne-14>=2)return{x:Z,y:U,title:M,rows:w};let ye=Math.max(112,se(M,11.5,600),...w.map(cn=>(cn.color?15:0)+se(cn.label??"",12)+16+se(cn.value,12,700)))+24,ln=H+12+ye/2,Aa=Math.max(4,Math.min(U,i-ne-4));return{x:Z+ln+ye/2<=o-4?Z+ln:Z-ln,y:Aa+ne+14,title:M,rows:w}},nr=null;if(ae!==null){let p=[];for(let w of it){let M=w===S;for(let j of er(ae,w))p.push({label:j.name,value:Me(j.v),color:j.sw.fill,strong:wt(w)?M?void 0:!1:M});wt(w)&&p.push({label:$?a.total[w]:a.sumLabel,value:Me(Pe(ae,w)),strong:M})}$&&F!==!1&&p.push({label:a.rate,value:kt(ae)||"-",strong:!1}),nr=wa(ae,p,G[ae].label)}let $a=ae!==null&&n.via==="keyboard"?xa(ae,S):void 0,Ge=h.backTotal.indexOf(Math.max(...h.backTotal)),Se=$?h.frontTotal.indexOf(Math.max(...h.frontTotal)):-1,rr=a.kind;if(L){let p=[a.kind,a.desc(T,f.join(", "),G[0].label,G[L-1].label),a.descPeak(G[Ge].label,Me(h.backTotal[Ge]))];$&&p.push(h.frontTotal[Se]>0?a.descFront(m.join(", "),G[Se].label,Me(h.frontTotal[Se]),kt(Se)):a.descFrontZero(m.join(", "))),W>1&&p.push(a.merged(W)),rr=p.join(". ")}let va=`${e.description??`${rr}.`}${$?` ${a.keys}`:""}`,or=(0,te.useMemo)(()=>{let p=G.map((w,M)=>ea(h.slotX(M)+h.w/2,w.label,he,o));return{xs:p,show:so(p,G.map(w=>w.label),he,6)}},[h,G,o]),ar=h.floor+Fe+20,$t=O?ar+tn+14:h.floor+Fe+12,Ta=(p,w,M)=>{if(st)return;let j=to(p,h.slotX(0)+h.s*.49,h.slotX(L-1)+h.s*.49,L),H=I?h.depthFront*h.cy+4:6,Z=!M&&$&&w>=h.floor-h.frontTotal[j]*h.k-H?"front":"back";Z!==l&&u(Z),j!==n.active&&n.setActive(j,M?"touch":"pointer")},vt=h.top-10,lt=h.slotX(0)-8,ct=h.slotX(L-1)+h.w+8,Tt=h.lead+h.depthBack+8,Ma=rt([[lt,h.floor+Fe],[ct,h.floor+Fe],[ct+Tt*h.cx,h.floor+Fe-Tt*h.cy],[lt+Tt*h.cx,h.floor+Fe-Tt*h.cy]]),Sa=()=>{let p=at(Ge,"back"),w=a.peak(Me(h.backTotal[Ge])),M=Math.min(p.x+(p.w+p.dx)/2,(_?h.wallX[1]:o-2)-se(w,11.5,700)/2);return(0,A.jsx)(Xn,{p:r,x:M,y:nn(Ge,"back")-11,opacity:on(Ge),children:w})},Ca=()=>{let p=F==="label"?kt(Se):"",w=a.frontPeak(G[Se].label,Me(h.frontTotal[Se]),p),M=h.slotX(Se)+h.w/2;return(0,A.jsxs)("g",{opacity:on(Se),children:[(0,A.jsx)("line",{x1:D(M),x2:D(M),y1:D($t+8),y2:D($t+14),stroke:r.paint("muted")}),(0,A.jsx)(Xn,{p:r,x:ea(M,w,11,o,700),y:$t+25,size:11,children:w})]})};return(0,A.jsxs)(zr,{c:n,kind:a.kind,ariaLabel:e.ariaLabel,description:va,events:ka,tip:nr,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,announce:$a,onPointerMove:(p,w,M)=>Ta(p,w,M.pointerType==="touch"),onKey:p=>{let w=al(p.key,$);return w===null?!1:(w!==l&&u(w),ae===null&&!st&&n.setActive(0,"keyboard"),!0)},defs:x!=="none"?(0,A.jsx)("pattern",{id:`${s}h`,width:4,height:4,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:(0,A.jsx)("rect",{width:1.6,height:4,fill:r.paint("panel"),fillOpacity:.55})}):void 0,children:[(0,A.jsx)("g",{"aria-hidden":"true",children:E.map((p,w)=>{let{x:M,line:j}=N[w],H=j*Qo+9,Z=w>=T;return(0,A.jsxs)("g",{children:[p.divider&&M>0?(0,A.jsx)("line",{x1:M-14,x2:M-14,y1:H-7,y2:H+7,stroke:r.paint("line")}):null,(0,A.jsx)("rect",{x:M,y:H-5,width:10,height:10,rx:2,fill:Z?de.front[w-T].fill:de.back[w].fill}),be(Z?"front":"back")?(0,A.jsx)("rect",{x:M,y:H-5,width:10,height:10,rx:2,fill:le}):null,(0,A.jsx)(Ie,{x:M+15,y:H,size:11.5,fill:r.paint("muted"),children:p.name})]},w)})}),st?(0,A.jsx)(Ie,{x:o/2,y:(h.top+h.floor)/2,anchor:"middle",size:13,fill:r.paint("muted"),children:a.nothing}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("g",{"aria-hidden":"true",children:[_?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("rect",{x:D(h.wallX[0]),y:D(vt),width:D(Math.max(0,h.wallX[1]-h.wallX[0])),height:D(Math.max(0,h.wallBase-vt)),fill:r.paint("line2"),fillOpacity:.6}),h.ticks.map(p=>{let w=h.wallBase-p*h.k;return(0,A.jsxs)("g",{children:[(0,A.jsx)("line",{x1:D(h.wallX[0]),x2:D(h.wallX[1]),y1:D(w),y2:D(w),stroke:r.paint("line")}),(0,A.jsx)(Ie,{x:h.wallX[1]+6,y:w,size:he,fill:r.paint("muted"),children:h.fmt(p)})]},p)})]}):null,(0,A.jsx)("polygon",{points:Ma,fill:r.paint("neutralSoft")}),(0,A.jsx)("rect",{x:D(lt),y:D(h.floor+Fe),width:D(Math.max(0,ct-lt)),height:Fe,fill:r.paint("line")})]}),G.map((p,w)=>(0,A.jsxs)("g",{className:"ztd-mark",opacity:ae===null||ae===w?1:.38,onClick:()=>n.click(w),style:{cursor:e.onClick?"pointer":void 0},children:[(0,A.jsx)("rect",{x:D(h.slotX(w)),y:D(vt),width:D(h.s),height:D(Math.max(0,i-vt)),fill:"transparent"}),it.map(M=>{let j=Zn.get(`${w}|${M}`);if(!j)return null;let H=at(w,M),Z=Pe(w,M)*h.k;if(I)return Pe(w,M)===0?(0,A.jsx)("polygon",{points:rt([[H.x,H.base],[H.x+H.w,H.base],[H.x+H.w+H.dx,H.base+H.dy],[H.x+H.dx,H.base+H.dy]]),fill:"none",stroke:r.paint("neutralStrong"),strokeOpacity:.7,strokeDasharray:"2 2"},M):(0,A.jsx)(na,{p:r,g:H,cum:j.v,colors:K(w,M),hatch:be(M)?le:null,lid:M==="back"?ot:pa,lidStroke:!0,lidInk:M==="front",lidHatch:M==="front",shade:oe,tile:!0},M);if(Z>0&&Z<1){let U=Jn(w,M),ne=U.length-1;for(;ne>0&&!(U[ne]>0);)ne--;return(0,A.jsx)("line",{x1:D(H.x),x2:D(H.x+H.w),y1:D(H.base-.5),y2:D(H.base-.5),stroke:K(w,M)[ne].fill},M)}return(0,A.jsx)(na,{p:r,g:H,cum:j.v,colors:K(w,M),hatch:be(M)?le:null,lid:M==="back"?ot:r.paint("neutralSoft"),lidStroke:M==="back",shade:oe},M)}),ae===w&&n.via!=="sync"?(0,A.jsx)("polygon",{points:rt(sl(at(w,S),Pe(w,S)*h.k)),fill:"none",stroke:r.paint("ink"),strokeWidth:2,strokeLinejoin:"round",pointerEvents:"none"}):null]},p.key)),n.showLabels&&h.backTotal[Ge]>0?Sa():null,O?(0,A.jsx)(cl,{p:r,rates:G.map((p,w)=>an(w)),x:h.slotX,w:h.w,from:lt,to:ct,top:ar,right:_?h.wallX[1]+6:ct+6,title:a.rate,pct:Qn,fade:on}):null,(0,A.jsx)("g",{"aria-hidden":"true",children:or.show.map(p=>(0,A.jsx)(Ie,{x:or.xs[p],y:$t,anchor:"middle",size:he,fill:r.paint(ae===p?"ink":"muted"),weight:ae===p?700:400,children:G[p].label},p))}),B&&h.frontTotal[Se]>0?Ca():null]})]})}var ul=R(Y(),1);var sa=R(V(),1);function oa(e,t){return t===!1?e.map((n,r)=>r):Qr(e)}function aa(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ge(e,t,t,r,"max")}function ia(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]=Q(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?Q(e,"neutral"):Ft(e,1-a/Math.max(1,o.length-1))),r}function la(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ve(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function ca(e,t){return Ve(e,t+1,new Set)}var ml=R(Y(),1);var ma=R(V(),1);function ua(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!vo.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var _e=R(V(),1);function da(e,t,n){let r=Gt(e);return r?.type==="scatter"&&t?.size!==void 0&&!jt(n)?Gt("bubble"):r}function dl(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 fl(e,t,n,r=!1){let o=da(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&&Fn.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),u=c=>c.filter(d=>!l.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let c=Re(i.label,"label"),d=Vt(i.value,"value"),g=o.type==="waffle",f=t.map((x,_)=>({r:x,label:c(x,_),value:g?d(x,_):Yo(d(x,_))})),{kept:b,other:T}=g?{kept:f,other:null}:Uo(f,a.other,(x,_)=>({r:{},label:Xo(J(n),x),value:_})),k=ge(s,b.map(x=>x.r),b.map(x=>x.label),b.map(x=>x.value),g?"first":"max"),$=T?[...b,T]:b,S=Oe(x=>g?ke(x,$.length,k):Jo(x,$.length,k,a.colorMode)),F=g&&a.shape==="arc";return $.map((x,_)=>({label:x.label,color:S[_],...F&&{shape:"circle"}}))}if(o.type==="candlestick"){let c=Ko(Array.isArray(a.ma)?a.ma:void 0,t.length),d=Wo[J(n)];return[{label:d.up,color:a.upColor??"accent"},{label:d.down,color:a.downColor??"neutralStrong"},...c.map((g,f)=>({label:d.maLegend(g),color:Vn[f],shape:"line"}))]}if(o.type==="network"){let c=la(a.groups);if(c.length<2)return[];let d=Oe(g=>ca(g,c.length));return c.map((g,f)=>({label:g,color:d[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let c=Re(i.group,"group"),d=ve(t.map((f,b)=>c(f,b)).filter(Boolean));if(d.length<2)return[];let g=Oe(f=>Ve(f,d.length,new Set));return d.map((f,b)=>({label:f,color:g[b],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||jt(a))return[];let c=Re(i.series,"series"),d=ve(t.map((b,T)=>c(b,T)));if(d.length<2)return[];let g=Vo(s,t,d,c),f=Oe(b=>Ve(b,d.length,g));return u(d.map((b,T)=>({label:b,color:f[T],shape:"circle"})))}if(o.type==="timeline"){let c=typeof i.group!="string",d=c?i.status:i.group;if(typeof d!="string")return[];let g=Po(t,d,c),f=Oe(b=>ke(b,g.length,ua(s,g)));return u(g.map((b,T)=>({label:b,color:f[T],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 S=Re(i.series,"series");c=ve(t.map((F,x)=>S(F,x)))}let d=_n(o.type,i,a);if(d.length){let S=ge(s,c,c,c.map(()=>0),"none"),F=Oe(_=>ke(_,c.length,S)),x=c.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:c.map((_,z)=>({label:_,color:F[z]}));return[...u(x),...d.map((_,z)=>({label:_,color:Go(z),shape:"line"}))]}if(c.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?Zr(c.length,Array.isArray(a.negative)?a.negative.map(S=>c.indexOf(String(S))):[],typeof a.neutral=="string"?c.indexOf(a.neutral):-1):-1,b=f>=0?new Set([f]):ge(s,c,c,c.map(()=>0),"first");if(o.type==="radar")return u(c.map((S,F)=>({label:S,color:b.has(F)?"accent":"neutralStrong",shape:"square"})));let T=a.colorMode,k=S=>ke(S,c.length,b);if((o.type==="line"||o.type==="area")&&(k=S=>jo(S,c.length,b,o.type==="area",T)),o.type==="stream"){let S=He(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),F=oa(S.values,a.reorder),x=aa(s,S.series,S.values);k=_=>ia(_,F,x)}let $=Oe(k);return u(c.map((S,F)=>({label:S,color:$[F],...o.type==="line"&&{shape:"line"}})))}return[]}function hl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Vr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function gl(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:u,...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:u}}function fa(e,t){let{spec:n}=e,r=da(n.type,n.encoding,n.options),o=(0,xt.useMemo)(()=>Do(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Gr(n,e.locale),s=ce(a),l=J(s),u=To(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=Xr(n),c=(0,xt.useMemo)(()=>m?Fo(m,s):void 0,[m,s]),d=n.options?.hidden,g=Array.isArray(d)?d.map(String):[],f=g.join(""),[b,T]=(0,xt.useState)(null);if(!r)return(0,_e.jsx)(Rn,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let k=o??u.data,$=t[r.type],S={...n.options??{}},F={...dl(r,n.encoding),...S,...c?{tooltip:c}:{},data:k,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:a},x=n.card?.legend==="toggle"&&Kr(r.type,n.encoding??{},S),_=b&&b.base===f?b.hidden:g;x&&(F.hidden=_);let z=N=>T(C=>{let v=C&&C.base===f?C.hidden:g;return{base:f,hidden:v.includes(N)?v.filter(h=>h!==N):[...v,N]}}),I=F.height??220,O=hl(n,r.type),B=i&&!k.length&&(u.loading||u.error||u.empty)?(0,_e.jsx)(Rn,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:I,locale:a}):O?(0,_e.jsx)($o,{chart:$,...gl(r.type,O,F)}):(0,_e.jsx)($,{...F});if(n.card){let N=n.card,C=N.legend==="auto"||N.legend==="toggle"?fl(n,k,s,x):N.legend,v=C?.length?x?(0,_e.jsx)(Nn,{items:C,hidden:_,onToggle:z,locale:a}):C:void 0,h=N.download?(0,_e.jsx)(Ro,{data:k,columns:Ur(n),filename:N.title??r.type,formats:Array.isArray(N.download)?N.download:void 0,locale:a}):void 0;B=(0,_e.jsx)(Ir,{number:N.number,title:N.title??jr(r,l),subtitle:N.subtitle,legend:v,actions:h,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:B})}let E=e.theme??n.theme;return E&&(B=(0,_e.jsx)(Ot,{theme:E,children:B})),B}function pl({cfg:e,components:t}){let n=et();return fa({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ga(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ha.hydrateRoot)(r,(0,Yn.createElement)(Ot,{theme:o.theme,cssVars:!0},(0,Yn.createElement)(pl,{cfg:o,components:{[e]:t}})))}ga("skyline",Un);})();
|