ztd-charts-cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/api.js +1 -1
  3. package/dist/{chunk-KNBUVTZ2.js → chunk-LR5X5LI2.js} +3 -3
  4. package/dist/cli.js +1 -1
  5. package/dist/client/area.js +6 -6
  6. package/dist/client/bar.js +6 -6
  7. package/dist/client/barRace.js +6 -6
  8. package/dist/client/beeswarm.js +7 -7
  9. package/dist/client/box.js +6 -6
  10. package/dist/client/bubble.js +6 -6
  11. package/dist/client/bullet.js +6 -6
  12. package/dist/client/bump.js +6 -6
  13. package/dist/client/calendar.js +10 -10
  14. package/dist/client/candlestick.js +6 -6
  15. package/dist/client/chord.js +7 -7
  16. package/dist/client/choropleth.js +9 -9
  17. package/dist/client/cohort.js +28 -0
  18. package/dist/client/donut.js +6 -6
  19. package/dist/client/dumbbell.js +6 -6
  20. package/dist/client/flowMap.js +7 -7
  21. package/dist/client/funnel.js +6 -6
  22. package/dist/client/gauge.js +6 -6
  23. package/dist/client/heatmap.js +9 -9
  24. package/dist/client/histogram.js +6 -6
  25. package/dist/client/horizon.js +28 -0
  26. package/dist/client/line.js +6 -6
  27. package/dist/client/lollipop.js +6 -6
  28. package/dist/client/marimekko.js +6 -6
  29. package/dist/client/network.js +6 -6
  30. package/dist/client/parallel.js +6 -6
  31. package/dist/client/pareto.js +6 -6
  32. package/dist/client/pie.js +6 -6
  33. package/dist/client/radar.js +6 -6
  34. package/dist/client/radialBar.js +6 -6
  35. package/dist/client/ridgeline.js +6 -6
  36. package/dist/client/sankey.js +6 -6
  37. package/dist/client/scatter.js +6 -6
  38. package/dist/client/segmented.js +6 -6
  39. package/dist/client/skyline.js +10 -10
  40. package/dist/client/slope.js +6 -6
  41. package/dist/client/sparkTable.js +28 -0
  42. package/dist/client/sparkline.js +6 -6
  43. package/dist/client/stream.js +7 -7
  44. package/dist/client/sunburst.js +7 -7
  45. package/dist/client/symbolMap.js +7 -7
  46. package/dist/client/tileMap.js +6 -6
  47. package/dist/client/timeline.js +6 -6
  48. package/dist/client/tree.js +6 -6
  49. package/dist/client/treemap.js +7 -7
  50. package/dist/client/waffle.js +7 -7
  51. package/dist/client/waterfall.js +6 -6
  52. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- (()=>{var fa=Object.create;var Br=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var pa=Object.getPrototypeOf,ba=Object.prototype.hasOwnProperty;var Dn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ya=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ga(t))!ba.call(e,o)&&o!==n&&Br(e,o,{get:()=>t[o],enumerable:!(r=ha(t,o))||r.enumerable});return e};var D=(e,t,n)=>(n=e!=null?fa(pa(e)):{},ya(t||!e||!e.__esModule?Br(n,"default",{value:e,enumerable:!0}):n,e));var Z=Dn((Kl,Hr)=>{Hr.exports=globalThis.__ztdReact.react});var Gr=Dn((Xl,jr)=>{jr.exports=globalThis.__ztdReact["react-dom/client"]});var H=Dn((sc,bo)=>{bo.exports=globalThis.__ztdReact["react/jsx-runtime"]});var wr=D(Z(),1),Qi=D(Gr(),1);var Et=D(Z(),1);var nn=D(Z(),1);var Vr=D(Z(),1),ut=(0,Vr.createContext)(void 0);var Ur=D(Z(),1);var xa=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Wr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Kr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Ue={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Wr,monoFamily:Kr,radius:18,radiusCode:14,radiusMark:4},Ln={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Wr,monoFamily:Kr,radius:18,radiusCode:14,radiusMark:4},En={dark:Ue,light:Ln};function Gt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function On(e){let t={};for(let n of xa){let r=e[n];typeof r=="string"&&(t[Gt(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 In(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 ka=`
1
+ (()=>{var fa=Object.create;var Br=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var pa=Object.getPrototypeOf,ba=Object.prototype.hasOwnProperty;var Dn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ya=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ga(t))!ba.call(e,o)&&o!==n&&Br(e,o,{get:()=>t[o],enumerable:!(r=ha(t,o))||r.enumerable});return e};var D=(e,t,n)=>(n=e!=null?fa(pa(e)):{},ya(t||!e||!e.__esModule?Br(n,"default",{value:e,enumerable:!0}):n,e));var Z=Dn((Yl,Hr)=>{Hr.exports=globalThis.__ztdReact.react});var Gr=Dn((Jl,jr)=>{jr.exports=globalThis.__ztdReact["react-dom/client"]});var H=Dn((uc,bo)=>{bo.exports=globalThis.__ztdReact["react/jsx-runtime"]});var wr=D(Z(),1),Qi=D(Gr(),1);var Et=D(Z(),1);var nn=D(Z(),1);var Vr=D(Z(),1),ut=(0,Vr.createContext)(void 0);var Ur=D(Z(),1);var xa=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Kr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Wr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Ue={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Kr,monoFamily:Wr,radius:18,radiusCode:14,radiusMark:4},Ln={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Kr,monoFamily:Wr,radius:18,radiusCode:14,radiusMark:4},En={dark:Ue,light:Ln};function Gt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function On(e){let t={};for(let n of xa){let r=e[n];typeof r=="string"&&(t[Gt(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 In(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 ka=`
2
2
  .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
3
  .ztd-root:focus{outline:none}
4
4
  .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Ue.accent});outline-offset:3px;border-radius:6px}
@@ -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 Yr(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 Jr(e,t){let[n]=(0,Ur.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var Xr=!1;function Mt(){if(Xr||typeof document>"u"||(Xr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=ka,document.head.appendChild(e)}var Vt=D(Z(),1),Fe=typeof window<"u"&&typeof document<"u",Ee=Fe?Vt.useLayoutEffect:Vt.useEffect;function Wt(){return typeof performance<"u"?performance.now():Date.now()}function q(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Be(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Zr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},qr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var wa=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],va={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function $a(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Ma(e){return $a(wa,e)}function Qr(e,t){let n=Ma(e);return{text:n?n[t]:e,...va[n?.id??"basic"]}}var eo={white:"#ffffff",black:"#000000",transparent:"#00000000"};function mt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),eo[t.toLowerCase()]&&(t=eo[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function ro(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 Bn(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 dt(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function to(e){return .2126*dt(e[0])+.7152*dt(e[1])+.0722*dt(e[2])}function Hn(e,t,n){let r=typeof e=="string"?mt(e):e,o=typeof t=="string"?mt(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?mt(n):n:null;o[3]<1&&a&&(o=Bn(o,a));let i=r[3]<1?Bn(r,o):r,s=to(i),l=to(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Ta(e){return[dt(e[0]),dt(e[1]),dt(e[2])]}function zn(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 no(e){let[t,n,r]=Ta(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function Ca([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[zn(4.0767416621*o-3.3077115913*a+.2309699292*i),zn(-1.2684380046*o+2.6097574011*a-.3413193965*i),zn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Kt(e,t,n){let r=mt(e),o=mt(t);if(!r||!o)return e;let a=no(r),i=no(o),s=Math.max(0,Math.min(1,n));return ro(Ca([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function jn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Hn(a,e,n);i>o&&(o=i,r=a)}return r}function ee(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 Sa(e,t){let n=jn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Hn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):jn(t,["#FFFFFF","#000000"])}function Xt(e,t){let n=Kt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Sa(e,n),raw:n}}function he(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=ee(e,"neutral");else if(s===0)r[i]=ee(e,"ink");else if(s===a-1)r[i]=ee(e,"neutral");else if(a===3)r[i]=ee(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?ee(e,"strong"):Xt(e,1-l)}}),r}var Gn="mix:";function Ye(e){return e({theme:Ln,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Gn}${o}`}).map(n=>n.fill)}function oo(e,t){return t?.startsWith(Gn)?e.mix("neutralStrong","neutral",Number(t.slice(Gn.length))):e.color(t)}function Tt(e,t,n){return he(e,t+1,n).slice(0,t)}function io(e,t,n,r="neutral"){let o=ee(e,"accent"),a=ee(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function ao(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=ee(e,"neutral"):s===0?r[i]=ee(e,"strong"):s===a-1?r[i]=ee(e,"neutral"):r[i]=Xt(e,1-s/(a-1))}),r}var Pe=D(Z(),1);var ft=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),de="en-US",so=new Map;function Wn(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=so.get(r);return o||(o=new Intl.NumberFormat(e,n),so.set(r,o)),o}function Kn(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function rt(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;return Kn(Wn(n,r).format(e))}var Xn=e=>e!==0&&Math.abs(e)<.05,Un=(e,t,n="")=>`${rt(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ut(e,t={}){if(!Number.isFinite(e))return"-";if(Xn(e)&&t.maximumFractionDigits===void 0)return Un(e,t.locale??de,"%");let n=Math.abs(e);return`${rt(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function mo(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;if(q(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,l]=a[i],c=o/s,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**h)/10**h;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+rt(u,{locale:n,...r,maximumFractionDigits:h})+l}}return Kn(Wn(n,{notation:"compact",...r}).format(e))}var Aa=(e,t=q(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function ot(e,t=de,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Wn(t,o);return l=>Number.isFinite(l)?`${i}${Kn(s.format(l))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Ut(o,{locale:t});case"ratio":return o=>Ut(o*100,{locale:t});case"compact":return o=>mo(o,{locale:t});case"currency":return r(Aa(t));default:{let o=r({maximumFractionDigits:1});return a=>Xn(a)?Un(a,t):o(a)}}}function Yt(e,t=de,n=0){return e!==void 0?ot(e,t):n>=1e5?r=>Xn(r)?Un(r,t):mo(r,{locale:t}):r=>rt(r,{locale:t})}function Ra(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Yn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Na=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Fa=["january","february","march","april","may","june","july","august","september","october","november","december"],lo=e=>{let t=e.toLowerCase();return t.length<3?0:Fa.findIndex(n=>n.startsWith(t))+1},co=e=>+e+(+e<30?2e3:1900);function fo(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Pa=[/^(\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})일)?$/],ho=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,go=/\{([^{}]+)\}/g;function Jt(e,t){let n;for(let r of Pa)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?[co(n[3]),+n[2],+n[1],1]:[co(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=ho.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=lo(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=lo(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Zt=e=>Na.test(e)||Jt(e)!==null;function qt(e){let t;for(let n of e){let r=typeof n=="string"?ho.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function ht(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(Yn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return ht(`${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=Jt(n,t);if(r)return Ra(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 Vn=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function po(e,t=de){if(!Number.isFinite(e))return"-";let n=Math.abs(e),r=e<0?"-":"",o=(a,i,s="short",l=0)=>rt(i,{locale:t,style:"unit",unit:a,unitDisplay:s,maximumFractionDigits:l});if(n>=864e5*365)return r+o("year",n/(864e5*365.25),"short",1);for(let a=0;a<Vn.length;a++){let[i,s]=Vn[a];if(n<s)continue;let l=Math.floor(n/s),c=Vn[a+1];if(l>=10||!c)return r+o(i,i==="second"&&l<10?n/s:Math.round(n/s),"short",i==="second"?1:0);let h=Math.round((n-l*s)/c[1]);return h*c[1]>=s&&(l++,h=0),r+(h?`${o(i,l,"narrow")} ${o(c[0],h,"narrow")}`:o(i,l))}return r+o("millisecond",n)}var uo=new Map;function He(e,t={month:"short",day:"numeric"}){let n=ht(e);if(!n)return"-";let{locale:r=de,...o}=t,a=r+JSON.stringify(o),i=uo.get(a);return i||(i=new Intl.DateTimeFormat(r,o),uo.set(a,i)),i.format(n)}var Jn=D(H(),1),Qt=(0,Pe.createContext)({theme:Ue,cssVars:!0});function _a(e,t=Ue){return e?typeof e=="string"?En[e]??t:In(t,e):t}function en(e){let t=(0,Pe.useContext)(Qt),n=e.base?En[e.base]:t.theme,r=(0,Pe.useMemo)(()=>_a(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,Pe.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,Pe.useMemo)(()=>On(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Jn.jsx)(Qt.Provider,{value:i,children:(0,Jn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Da=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function yo(e){return Da.has(e)}function La(e,t){let n=r=>t?`var(${Gt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?yo(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?yo(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:Kt(e[r],e[o],a)}}}function _e(e){let t=(0,Pe.useContext)(Qt);return(0,Pe.useMemo)(()=>{let n=In(t.theme,e);return La(n,t.cssVars)},[t.theme,t.cssVars,e])}function be(e){let t=(0,Pe.useContext)(Qt);return e??t.locale??de}function xo(e){return e?On(e):{}}var tn=D(Z(),1),Zn=(0,tn.createContext)(void 0);function ko(e){let t=(0,tn.useContext)(Zn);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var L=D(H(),1),Ea={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`},Oa={en:Ea,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Ia={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},qn=e=>Oa[q(be(e))];function Qn(e){let t=_e(e.theme),n=qn(e.locale),[r,o]=(0,nn.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(h=>!s.has(h.label)).length,c=(0,L.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((h,u)=>{let m=!s.has(h.label),g=m&&l===1,d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(za,{p:t,item:h,off:!m}),(0,L.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,L.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,L.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":g||void 0,onClick:()=>{g||(i(h.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:d}):d},u)})});return i?(0,L.jsxs)(L.Fragment,{children:[c,(0,L.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Ia,children:r?n.shown(l,e.items.length):""})]}):c}function za({p:e,item:t,off:n}){let r=oo(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,L.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,L.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,L.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,L.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 Ba(e){let t=_e(e.theme),n=Qr(e.level,q(be(e.locale)));return(0,L.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Ha(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,L.jsxs)(L.Fragment,{children:[e.slice(0,r),(0,L.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function wo(e){let t=_e(e.theme),n=qn(e.locale),[r,o]=(0,nn.useState)(0);Ee(()=>Mt(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,L.jsx)(Qn,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,h=e.source!==void 0||e.note!==void 0?(0,L.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,L.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,L.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,L.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,L.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,L.jsx)(Ba,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,L.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,L.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,L.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,L.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Ha(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,L.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,L.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,L.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,L.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,L.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,L.jsx)("span",{}),i]}):null]}),(0,L.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,L.jsx)(Zn.Provider,{value:r,children:(0,L.jsx)(ut.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,L.jsxs)(L.Fragment,{children:[h,u]}):u]})}function er(e){let t=_e(e.theme),n=qn(e.locale),r=e.height??220;if(Ee(()=>Mt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,L.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,L.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,L.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,L.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,L.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,L.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,L.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,L.jsx)(L.Fragment,{children:e.children})}var yt=D(Z(),1);var ye=D(Z(),1);var W=D(H(),1),rn=60;var on={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function vo(e){let{c:t,events:n}=e,r=(0,ye.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,Ee(()=>{Mt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,ye.useContext)(ut),c=e.ariaLabel??l??e.kind,h=(0,ye.useMemo)(()=>s?`${n.length}${n.slice(0,rn).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),u=(0,ye.useMemo)(()=>(0,W.jsx)(ja,{label:c,events:n,t:t.t}),[c,h,t.t]),m=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{let w=()=>{m.current=null};return window.addEventListener("scroll",w,{capture:!0,passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w,{capture:!0}),window.removeEventListener("resize",w)}},[]),(0,ye.useEffect)(()=>{m.current=null},[t.width,t.height]);let g=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let N=t.active,O;switch(w.key){case"ArrowRight":case"ArrowDown":O=N===null?0:(N+1)%i;break;case"ArrowLeft":case"ArrowUp":O=N===null?i-1:(N-1+i)%i;break;case"Home":O=0;break;case"End":O=i-1;break;case"Escape":if(N===null)return;O=null;break;case"Enter":case" ":N!==null&&(w.preventDefault(),t.click(N));return;default:return}w.preventDefault(),t.setActive(O,"keyboard")},{via:d,node:p,setActive:C}=t;(0,ye.useEffect)(()=>{if(d!=="touch"||!p)return;let w=N=>{p.contains(N.target)||C(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[d,p,C]);let x=t.active!==null?n[t.active]:null,S=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,P=typeof e.renderTip=="function"&&x?e.renderTip(x):null,y=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),F;if(S){let w=S.x*$,N=t.width*$,O=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(N-w-4).toFixed(1)}px - 100%))`,G=S.y<64;F={position:"absolute",left:w,top:S.y*$,transform:`translate(${O}, ${G?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*$-8)}}let z=w=>{m.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},I=w=>w?N=>{let O=m.current??(m.current=N.currentTarget.getBoundingClientRect());O.width&&w((N.clientX-O.left)/O.width*t.width,(N.clientY-O.top)/O.height*t.height,N)}:void 0,E=I(e.onPointerMove),B=I(e.onPointerDown),v=E||B?w=>{w.pointerType==="touch"&&E?.(w),B?.(w)}:void 0,M=I(e.onPointerUp),A=xo(e.theme);return(0,W.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?g:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:z,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...A,...e.style},children:[t.pending?null:e.underlay,(0,W.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:v,onPointerUp:M,onPointerCancel:M,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,W.jsx)("title",{id:o,children:c}),(0,W.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,W.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,S?(0,W.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:F,children:P??(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:S.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),S.rows.map((w,N)=>(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,W.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(w.strong?"ink":"muted")},children:[w.color?(0,W.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:w.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,w.label]}),(0,W.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},N))]})}):null,(0,W.jsx)("span",{className:"ztd-sr",style:on,"aria-live":"polite","aria-atomic":"true",children:y}),s&&!t.pending?u:null]})}function ja({label:e,events:t,t:n}){return(0,W.jsx)("div",{className:"ztd-sr",style:on,children:(0,W.jsxs)("table",{children:[(0,W.jsx)("caption",{children:n.table(e)}),(0,W.jsxs)("tbody",{children:[t.slice(0,rn).map((r,o)=>(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,W.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>rn?(0,W.jsx)("tr",{children:(0,W.jsx)("td",{colSpan:2,children:n.more(t.length-rn)})}):null]})]})})}function xe(e){let t=e.baseline??"central";return(0,W.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ve=b("label","string",!0,"Item name field"),le=b("value","number",!0,"Value field"),Ga=[ve,le],Va=[ve,le],Wa=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],Ka=[ve,le],Xa=[b("label","string",!0,"Leaf (lowest level) name"),le,b("group","string",!1,"Parent group field")],Ua=[b("label","string",!0,"Leaf name"),le,b("group","string",!1,"Parent group field")],Ya=[ve,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],Ja=[ve,le],Za=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),le],qa=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),le],Qa=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],es=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],Mo=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ts=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Mo],ns=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),Mo],rs=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],os=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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})],is=[ve,le],as=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],ss=[ve,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],ls=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],cs=[ve,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],us=[ve,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],ms=[ve,le],ds=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],fs=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],hs=[b("source","string",!1,"Source node"),b("target","string",!1,"Target node"),b("dimensions","string",!1,"Stage columns of a wide table, left to right (2 to 6). Each row is one path, so source and target are not used. Without value, each row counts 1",{multi:!0}),b("value","number",!1,"Value field")],gs=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),le],ps=[b("date","date",!0,"Date field"),le],bs=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],ys=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],xs=[b("label","string",!1,"Row name field")],ks=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],ws=[ve,le],vs=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],$s=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],Ms=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),le],Ts=[ve,le,b("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")],Cs=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],Ss=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("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")],As=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Rs=[b("region","string",!0,"Region name or code, matched to a region of options.map"),le],Ns=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Fs=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],Ps=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],$o={pie:Ga,donut:Va,funnel:Wa,waffle:Ka,treemap:Xa,sunburst:Ua,waterfall:Ya,pareto:Ja,marimekko:Za,heatmap:qa,radar:Qa,bubble:es,line:ts,area:ns,stream:rs,bar:os,radialBar:is,gauge:as,bullet:ss,sparkline:ls,slope:cs,dumbbell:us,lollipop:ms,beeswarm:ds,ridgeline:fs,sankey:hs,chord:gs,calendar:ps,bump:bs,box:ys,parallel:xs,candlestick:ks,segmented:ws,skyline:vs,histogram:$s,scatter:Ps,tileMap:Ms,barRace:Ts,network:Cs,timeline:Ss,tree:As,choropleth:Rs,symbolMap:Ns,flowMap:Fs},gt={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 To(e,t){return t==="ko"?e.nameKo:e.name}function Co(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var So=["line","area","bar","scatter"],Ao=24,tr=["line","area","bar","scatter","timeline"];function nr(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Ro(e,t,n){return tr.includes(e)&&!nr(e,t,n).length&&!(e==="scatter"&&an(n))}function an(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function No(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var _s={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",butterfly:"bar",pyramid:"bar",populationPyramid:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",raincloud:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap",alluvial:"sankey",parallelSets:"sankey"};function sn(e){let t=$o[e]?e:_s[e]??Object.keys(gt).find(n=>n.toLowerCase()===e.toLowerCase()||gt[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!gt[t]))return{type:t,component:gt[t].component,name:gt[t].name,nameKo:gt[t].nameKo,encoding:$o[t]}}function Fo(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of sn(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function Po(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Ds(e,t){if(e==null||typeof e!="object")return;let n=e;if(Po(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Po(r,o))return;r=r[o]}return r}}function $e(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 je(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Ds(r,n)}function ln(e,t){let n=je(e,t);return(r,o)=>$e(n(r,o))}function Me(e,t){let n=je(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function De(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Ls(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
- `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var Es=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function _o(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Es.test(t)||/^[-+]?\.\d+$/.test(t)){let n=$e(t);if(Number.isFinite(n))return n}return t}function it(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Ls(o),i=[],s=[],l="",c=!1;for(let d=0;d<o.length;d++){let p=o[d];c?p==='"'?o[d+1]==='"'?(l+='"',d++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===a?(s.push(l),l=""):p===`
22
+ `;function Yr(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 Jr(e,t){let[n]=(0,Ur.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var Xr=!1;function Tt(){if(Xr||typeof document>"u"||(Xr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=ka,document.head.appendChild(e)}var Vt=D(Z(),1),Fe=typeof window<"u"&&typeof document<"u",Ee=Fe?Vt.useLayoutEffect:Vt.useEffect;function Kt(){return typeof performance<"u"?performance.now():Date.now()}function q(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Be(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Zr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},qr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var wa=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],va={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function $a(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Ta(e){return $a(wa,e)}function Qr(e,t){let n=Ta(e);return{text:n?n[t]:e,...va[n?.id??"basic"]}}var eo={white:"#ffffff",black:"#000000",transparent:"#00000000"};function mt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),eo[t.toLowerCase()]&&(t=eo[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function ro(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 Bn(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 dt(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function to(e){return .2126*dt(e[0])+.7152*dt(e[1])+.0722*dt(e[2])}function Hn(e,t,n){let r=typeof e=="string"?mt(e):e,o=typeof t=="string"?mt(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?mt(n):n:null;o[3]<1&&a&&(o=Bn(o,a));let i=r[3]<1?Bn(r,o):r,s=to(i),l=to(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Ma(e){return[dt(e[0]),dt(e[1]),dt(e[2])]}function zn(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 no(e){let[t,n,r]=Ma(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function Ca([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[zn(4.0767416621*o-3.3077115913*a+.2309699292*i),zn(-1.2684380046*o+2.6097574011*a-.3413193965*i),zn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Wt(e,t,n){let r=mt(e),o=mt(t);if(!r||!o)return e;let a=no(r),i=no(o),s=Math.max(0,Math.min(1,n));return ro(Ca([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function jn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Hn(a,e,n);i>o&&(o=i,r=a)}return r}function ee(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 Sa(e,t){let n=jn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Hn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):jn(t,["#FFFFFF","#000000"])}function Xt(e,t){let n=Wt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Sa(e,n),raw:n}}function he(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=ee(e,"neutral");else if(s===0)r[i]=ee(e,"ink");else if(s===a-1)r[i]=ee(e,"neutral");else if(a===3)r[i]=ee(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?ee(e,"strong"):Xt(e,1-l)}}),r}var Gn="mix:";function Ye(e){return e({theme:Ln,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Gn}${o}`}).map(n=>n.fill)}function oo(e,t){return t?.startsWith(Gn)?e.mix("neutralStrong","neutral",Number(t.slice(Gn.length))):e.color(t)}function Mt(e,t,n){return he(e,t+1,n).slice(0,t)}function io(e,t,n,r="neutral"){let o=ee(e,"accent"),a=ee(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function ao(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=ee(e,"neutral"):s===0?r[i]=ee(e,"strong"):s===a-1?r[i]=ee(e,"neutral"):r[i]=Xt(e,1-s/(a-1))}),r}var _e=D(Z(),1);var ft=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),de="en-US",so=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=so.get(r);return o||(o=new Intl.NumberFormat(e,n),so.set(r,o)),o}function Wn(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function rt(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;return Wn(Kn(n,r).format(e))}var Xn=e=>e!==0&&Math.abs(e)<.05,Un=(e,t,n="")=>`${rt(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ut(e,t={}){if(!Number.isFinite(e))return"-";if(Xn(e)&&t.maximumFractionDigits===void 0)return Un(e,t.locale??de,"%");let n=Math.abs(e);return`${rt(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function mo(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;if(q(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,l]=a[i],c=o/s,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**h)/10**h;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+rt(u,{locale:n,...r,maximumFractionDigits:h})+l}}return Wn(Kn(n,{notation:"compact",...r}).format(e))}var Aa=(e,t=q(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function ot(e,t=de,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Kn(t,o);return l=>Number.isFinite(l)?`${i}${Wn(s.format(l))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Ut(o,{locale:t});case"ratio":return o=>Ut(o*100,{locale:t});case"compact":return o=>mo(o,{locale:t});case"currency":return r(Aa(t));default:{let o=r({maximumFractionDigits:1});return a=>Xn(a)?Un(a,t):o(a)}}}function Yt(e,t=de,n=0){return e!==void 0?ot(e,t):n>=1e5?r=>Xn(r)?Un(r,t):mo(r,{locale:t}):r=>rt(r,{locale:t})}function Ra(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Yn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Na=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Fa=["january","february","march","april","may","june","july","august","september","october","november","december"],lo=e=>{let t=e.toLowerCase();return t.length<3?0:Fa.findIndex(n=>n.startsWith(t))+1},co=e=>+e+(+e<30?2e3:1900);function fo(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var _a=[/^(\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})일)?$/],ho=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,go=/\{([^{}]+)\}/g;function Jt(e,t){let n;for(let r of _a)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?[co(n[3]),+n[2],+n[1],1]:[co(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=ho.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=lo(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=lo(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Zt=e=>Na.test(e)||Jt(e)!==null;function qt(e){let t;for(let n of e){let r=typeof n=="string"?ho.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function ht(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(Yn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return ht(`${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=Jt(n,t);if(r)return Ra(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 Vn=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function po(e,t=de){if(!Number.isFinite(e))return"-";let n=Math.abs(e),r=e<0?"-":"",o=(a,i,s="short",l=0)=>rt(i,{locale:t,style:"unit",unit:a,unitDisplay:s,maximumFractionDigits:l});if(n>=864e5*365)return r+o("year",n/(864e5*365.25),"short",1);for(let a=0;a<Vn.length;a++){let[i,s]=Vn[a];if(n<s)continue;let l=Math.floor(n/s),c=Vn[a+1];if(l>=10||!c)return r+o(i,i==="second"&&l<10?n/s:Math.round(n/s),"short",i==="second"?1:0);let h=Math.round((n-l*s)/c[1]);return h*c[1]>=s&&(l++,h=0),r+(h?`${o(i,l,"narrow")} ${o(c[0],h,"narrow")}`:o(i,l))}return r+o("millisecond",n)}var uo=new Map;function He(e,t={month:"short",day:"numeric"}){let n=ht(e);if(!n)return"-";let{locale:r=de,...o}=t,a=r+JSON.stringify(o),i=uo.get(a);return i||(i=new Intl.DateTimeFormat(r,o),uo.set(a,i)),i.format(n)}var Jn=D(H(),1),Qt=(0,_e.createContext)({theme:Ue,cssVars:!0});function Pa(e,t=Ue){return e?typeof e=="string"?En[e]??t:In(t,e):t}function en(e){let t=(0,_e.useContext)(Qt),n=e.base?En[e.base]:t.theme,r=(0,_e.useMemo)(()=>Pa(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,_e.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,_e.useMemo)(()=>On(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Jn.jsx)(Qt.Provider,{value:i,children:(0,Jn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Da=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function yo(e){return Da.has(e)}function La(e,t){let n=r=>t?`var(${Gt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?yo(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?yo(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:Wt(e[r],e[o],a)}}}function Pe(e){let t=(0,_e.useContext)(Qt);return(0,_e.useMemo)(()=>{let n=In(t.theme,e);return La(n,t.cssVars)},[t.theme,t.cssVars,e])}function be(e){let t=(0,_e.useContext)(Qt);return e??t.locale??de}function xo(e){return e?On(e):{}}var tn=D(Z(),1),Zn=(0,tn.createContext)(void 0);function ko(e){let t=(0,tn.useContext)(Zn);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var L=D(H(),1),Ea={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`},Oa={en:Ea,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Ia={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},qn=e=>Oa[q(be(e))];function Qn(e){let t=Pe(e.theme),n=qn(e.locale),[r,o]=(0,nn.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(h=>!s.has(h.label)).length,c=(0,L.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((h,u)=>{let m=!s.has(h.label),g=m&&l===1,d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(za,{p:t,item:h,off:!m}),(0,L.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,L.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,L.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":g||void 0,onClick:()=>{g||(i(h.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:d}):d},u)})});return i?(0,L.jsxs)(L.Fragment,{children:[c,(0,L.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Ia,children:r?n.shown(l,e.items.length):""})]}):c}function za({p:e,item:t,off:n}){let r=oo(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,L.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,L.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,L.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,L.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 Ba(e){let t=Pe(e.theme),n=Qr(e.level,q(be(e.locale)));return(0,L.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Ha(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,L.jsxs)(L.Fragment,{children:[e.slice(0,r),(0,L.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function wo(e){let t=Pe(e.theme),n=qn(e.locale),[r,o]=(0,nn.useState)(0);Ee(()=>Tt(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,L.jsx)(Qn,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,h=e.source!==void 0||e.note!==void 0?(0,L.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,L.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,L.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,L.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,L.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,L.jsx)(Ba,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,L.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,L.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,L.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,L.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Ha(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,L.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,L.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,L.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,L.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,L.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,L.jsx)("span",{}),i]}):null]}),(0,L.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,L.jsx)(Zn.Provider,{value:r,children:(0,L.jsx)(ut.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,L.jsxs)(L.Fragment,{children:[h,u]}):u]})}function er(e){let t=Pe(e.theme),n=qn(e.locale),r=e.height??220;if(Ee(()=>Tt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,L.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,L.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,L.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,L.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,L.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,L.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,L.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,L.jsx)(L.Fragment,{children:e.children})}var yt=D(Z(),1);var ye=D(Z(),1);var K=D(H(),1),rn=60;var on={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function vo(e){let{c:t,events:n}=e,r=(0,ye.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,Ee(()=>{Tt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,ye.useContext)(ut),c=e.ariaLabel??l??e.kind,h=(0,ye.useMemo)(()=>s?`${n.length}${n.slice(0,rn).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),u=(0,ye.useMemo)(()=>(0,K.jsx)(ja,{label:c,events:n,t:t.t}),[c,h,t.t]),m=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{let w=()=>{m.current=null};return window.addEventListener("scroll",w,{capture:!0,passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w,{capture:!0}),window.removeEventListener("resize",w)}},[]),(0,ye.useEffect)(()=>{m.current=null},[t.width,t.height]);let g=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let N=t.active,O;switch(w.key){case"ArrowRight":case"ArrowDown":O=N===null?0:(N+1)%i;break;case"ArrowLeft":case"ArrowUp":O=N===null?i-1:(N-1+i)%i;break;case"Home":O=0;break;case"End":O=i-1;break;case"Escape":if(N===null)return;O=null;break;case"Enter":case" ":N!==null&&(w.preventDefault(),t.click(N));return;default:return}w.preventDefault(),t.setActive(O,"keyboard")},{via:d,node:p,setActive:C}=t;(0,ye.useEffect)(()=>{if(d!=="touch"||!p)return;let w=N=>{p.contains(N.target)||C(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[d,p,C]);let x=t.active!==null?n[t.active]:null,S=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,_=typeof e.renderTip=="function"&&x?e.renderTip(x):null,y=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),F;if(S){let w=S.x*$,N=t.width*$,O=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(N-w-4).toFixed(1)}px - 100%))`,G=S.y<64;F={position:"absolute",left:w,top:S.y*$,transform:`translate(${O}, ${G?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*$-8)}}let z=w=>{m.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},I=w=>w?N=>{let O=m.current??(m.current=N.currentTarget.getBoundingClientRect());O.width&&w((N.clientX-O.left)/O.width*t.width,(N.clientY-O.top)/O.height*t.height,N)}:void 0,E=I(e.onPointerMove),B=I(e.onPointerDown),v=E||B?w=>{w.pointerType==="touch"&&E?.(w),B?.(w)}:void 0,T=I(e.onPointerUp),A=xo(e.theme);return(0,K.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?g:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:z,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...A,...e.style},children:[t.pending?null:e.underlay,(0,K.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:v,onPointerUp:T,onPointerCancel:T,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,K.jsx)("title",{id:o,children:c}),(0,K.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,K.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,S?(0,K.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:F,children:_??(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:S.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),S.rows.map((w,N)=>(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,K.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(w.strong?"ink":"muted")},children:[w.color?(0,K.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:w.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,w.label]}),(0,K.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},N))]})}):null,(0,K.jsx)("span",{className:"ztd-sr",style:on,"aria-live":"polite","aria-atomic":"true",children:y}),s&&!t.pending?u:null]})}function ja({label:e,events:t,t:n}){return(0,K.jsx)("div",{className:"ztd-sr",style:on,children:(0,K.jsxs)("table",{children:[(0,K.jsx)("caption",{children:n.table(e)}),(0,K.jsxs)("tbody",{children:[t.slice(0,rn).map((r,o)=>(0,K.jsxs)("tr",{children:[(0,K.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,K.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>rn?(0,K.jsx)("tr",{children:(0,K.jsx)("td",{colSpan:2,children:n.more(t.length-rn)})}):null]})]})})}function xe(e){let t=e.baseline??"central";return(0,K.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 b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ve=b("label","string",!0,"Item name field"),se=b("value","number",!0,"Value field"),Ga=[ve,se],Va=[ve,se],Ka=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],Wa=[ve,se],Xa=[b("label","string",!0,"Leaf (lowest level) name"),se,b("group","string",!1,"Parent group field")],Ua=[b("label","string",!0,"Leaf name"),se,b("group","string",!1,"Parent group field")],Ya=[ve,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],Ja=[ve,se],Za=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),se],qa=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),se],Qa=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],es=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],To=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ts=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),To],ns=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),To],rs=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],os=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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})],is=[ve,se],as=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],ss=[ve,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],ls=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],cs=[ve,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],us=[ve,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],ms=[ve,se],ds=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],fs=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],hs=[b("source","string",!1,"Source node"),b("target","string",!1,"Target node"),b("dimensions","string",!1,"Stage columns of a wide table, left to right (2 to 6). Each row is one path, so source and target are not used. Without value, each row counts 1",{multi:!0}),b("value","number",!1,"Value field")],gs=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),se],ps=[b("date","date",!0,"Date field"),se],bs=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],ys=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],xs=[b("label","string",!1,"Row name field")],ks=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],ws=[ve,se],vs=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],$s=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],Ts=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),se],Ms=[ve,se,b("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")],Cs=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],Ss=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("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")],As=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Rs=[b("region","string",!0,"Region name or code, matched to a region of options.map"),se],Ns=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Fs=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],_s=[b("cohort","any",!0,"Cohort: a name or a start date. Cohorts go in date order when all read as dates, otherwise in order of first appearance"),b("period","any",!0,"Periods since the cohort started: 0, 1, 2 ... In number order when all are numbers"),b("value","number",!0,"People still active, or the share still active (see options.valueType)"),b("size","number",!1,"Cohort size. The first value of each cohort counts")],Ps=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)")],Ds=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],Ls=[b("label","string",!0,"Row name field (one row per metric)"),b("x","any",!0,"Period field (date, number or category). Every row shares the same period axis"),se,b("target","number",!1,"Target field. Each row uses its last filled value")],$o={pie:Ga,donut:Va,funnel:Ka,waffle:Wa,treemap:Xa,sunburst:Ua,waterfall:Ya,pareto:Ja,marimekko:Za,heatmap:qa,radar:Qa,bubble:es,line:ts,area:ns,stream:rs,bar:os,radialBar:is,gauge:as,bullet:ss,sparkline:ls,slope:cs,dumbbell:us,lollipop:ms,beeswarm:ds,ridgeline:fs,sankey:hs,chord:gs,calendar:ps,bump:bs,box:ys,parallel:xs,candlestick:ks,segmented:ws,skyline:vs,histogram:$s,scatter:Ds,tileMap:Ts,barRace:Ms,network:Cs,timeline:Ss,tree:As,choropleth:Rs,symbolMap:Ns,flowMap:Fs,sparkTable:Ls,cohort:_s,horizon:Ps},gt={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:"흐름 지도"},sparkTable:{component:"SparkTable",name:"KPI table",nameKo:"지표 표"},cohort:{component:"CohortChart",name:"Cohort chart",nameKo:"코호트 차트"},horizon:{component:"HorizonChart",name:"Horizon chart",nameKo:"호라이즌 차트"}};function Mo(e,t){return t==="ko"?e.nameKo:e.name}function Co(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var So=["line","area","bar","scatter"],Ao=24;var tr=["line","area","bar","scatter","timeline"];function nr(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Ro(e,t,n){return tr.includes(e)&&!nr(e,t,n).length&&!(e==="scatter"&&an(n))}function an(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function No(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Es={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",butterfly:"bar",pyramid:"bar",populationPyramid:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",raincloud:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap",alluvial:"sankey",parallelSets:"sankey",kpiTable:"sparkTable",metricTable:"sparkTable",sparklineTable:"sparkTable",retention:"cohort",cohortTable:"cohort",retentionTable:"cohort",horizonChart:"horizon",horizonGraph:"horizon"};function sn(e){let t=$o[e]?e:Es[e]??Object.keys(gt).find(n=>n.toLowerCase()===e.toLowerCase()||gt[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!gt[t]))return{type:t,component:gt[t].component,name:gt[t].name,nameKo:gt[t].nameKo,encoding:$o[t]}}function Fo(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of sn(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function _o(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Os(e,t){if(e==null||typeof e!="object")return;let n=e;if(_o(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!_o(r,o))return;r=r[o]}return r}}function $e(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 je(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Os(r,n)}function ln(e,t){let n=je(e,t);return(r,o)=>$e(n(r,o))}function Te(e,t){let n=je(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function De(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Is(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
+ `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var zs=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Po(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(zs.test(t)||/^[-+]?\.\d+$/.test(t)){let n=$e(t);if(Number.isFinite(n))return n}return t}function it(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Is(o),i=[],s=[],l="",c=!1;for(let d=0;d<o.length;d++){let p=o[d];c?p==='"'?o[d+1]==='"'?(l+='"',d++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===a?(s.push(l),l=""):p===`
24
24
  `||p==="\r"?(p==="\r"&&o[d+1]===`
25
- `&&d++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let h=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!h.length)return[];let u=d=>n?_o(d):d;if(!r)return h.map(d=>Object.fromEntries(d.map((p,C)=>[String(C),u(p)])));let m=[],g=new Set;return h[0].forEach((d,p)=>{let C=d.trim()||`col${p+1}`,x=C;for(let S=2;g.has(x);S++)x=`${C}_${S}`;g.add(x),m.push(x)}),h.slice(1).map(d=>Object.fromEntries(m.map((p,C)=>[p,u(d[C]??"")])))}function rr(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof i[l]=="string"?_o(i[l]):i[l]??null])))}function Os(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Do(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 Je(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Je(JSON.parse(t))}catch{}return it(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?rr(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)?Je(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?rr(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)?Je(t.rows):Array.isArray(t.values)?rr(t.values):Array.isArray(t.items)?Je(t.items):Array.isArray(t.results)?Je(t.results):Os(t)}return[]}function cn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function or(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let h=e[l][c];return Number.isFinite(h)&&h>0?h:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let h=0,u=0;for(let m=0;m<n;m++){let g=i(m,c),d=g-i(m,c-1),p=0;for(let C=0;C<m;C++)p+=i(C,c)-i(C,c-1);h+=g,u+=(d/2+p)*g}h&&(l-=u/h),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,m=0;for(let g=0;g<n;g++){let d=e[g][l],p=Number.isFinite(d)?d:0;p>=0?(o[g][l]=u,u+=p,a[g][l]=u):(o[g][l]=m,m+=p,a[g][l]=m)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let h=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let m=i(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=h,h+=m,a[u][l]=h}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let h=0;for(let u=0;u<r;u++)h+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;h/=r;for(let u=0;u<n;u++)for(let m=0;m<r;m++)o[u][m]-=h,a[u][m]-=h}return{y0:o,y1:a}}function Lo(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 Eo(e){let t=e.length,n=e.map(c=>{let h=0,u=-1/0;return c.forEach((m,g)=>{m>u&&(u=m,h=g)}),h}),r=e.map(c=>c.reduce((h,u)=>h+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,h)=>h).sort((c,h)=>n[c]-n[h]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var Is=Math.PI*2;function Oo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ir(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function un(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function zo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Io(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 mn=new Map;function oe(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=mn.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);zo(c)?i+=Io(c):s+=Io(c)}a=i+s*(n>=600?1.07:1),mn.size>5e3&&mn.clear(),mn.set(o,a)}return a*t}function at(e,t,n,r=400){if(e=e.trim(),oe(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;oe(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(zo(s.charCodeAt(0))?2:3)?"":s+o}function Bo(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}var Ct=D(H(),1),zs=e=>Array.isArray(e)&&e.length===2;function Ho(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&zs(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Bs=(e,t)=>oe(e,10.5,t?700:500)+8;function dn(e,t,n,r="start",o){let a=Bs(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function jo({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=dn(r,t,n,o,a);return(0,Ct.jsxs)("g",{children:[(0,Ct.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,Ct.jsx)(xe,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}var Wo=D(H(),1),pt=10.5;function Hs(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>rt(i,{locale:n,maximumFractionDigits:a}))}function Go(e,t,n){let r=18;for(let o of Hs(e,t,n))r=Math.max(r,oe(o,pt));return Math.ceil(r+8)}function Vo(e,t,n){let r=[],o=-1/0;for(let a of e){let i=oe(a.label,pt),s=Math.max(a.x-i/2,0);s<o+8||a.x-i/2<t||a.x+i/2>n||(r.push(a),o=s+i)}return r}function ar(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,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=ar(i,n),c=[o,a];for(let h=0;h<4;h++){let u=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let g=ar(c[1]-c[0],n);if(g===l)break;l=g}return c}function Ko(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=ar(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function St(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>Ko(n,r,l),s}function sr(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=Ze(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function js(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,h=1)=>{let u=[];for(let m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%h))for(let g of c){let d=Number((g*10**m).toPrecision(12));d>=e*(1-1e-9)&&d<=t*(1+1e-9)&&u.push(d)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:Ko(e,t,3)}function Xo(e,t){let n=St([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=()=>js(e[0],e[1],Math.abs(t[1]-t[0])),r}function At(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 Gs=864e5;function fn(e,t,n,r=de){let o=t-e;if(!(o>0))return[{t:e,label:He(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Gs,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(h,u,m,g=!1)=>{let d=new Date(h),p=-1,C=0;for(;d.getTime()<=t&&C++<500;){if(d.getTime()>=e){let x=d.getFullYear(),S=g&&!l&&x!==p;i.push({t:d.getTime(),label:He(d,{locale:r,...m,...S?{year:"numeric"}:{}})}),p=x}u(d)}};if(a<=1.5){let h=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(g=>g>=h)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,g=>g.setHours(g.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(h,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()+(8-h.getDay())%7),c(h,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let h=a/30.44,u=Math.max(1,Math.ceil(h/Math.max(1,n))),m=[1,2,3,6,12,24,60].find(g=>g>=u)??120;if(m>=12){let g=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(g,d=>d.setFullYear(d.getFullYear()+m/12),{year:"numeric"})}else{let g=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),d=g.getMonth()%m;d&&g.setMonth(g.getMonth()+(m-d)),c(g,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function Uo(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var Vs=(e,t,n)=>e==="date"?ht(t,n)?.getTime()??NaN:$e(t);function Ws(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Zt(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Rt(e,t,n,r,o={}){let a=je(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:je(n,"y"),c=!i&&r!==void 0?je(r,"series"):null,h=e.map((A,w)=>a(A,w)),u=o.xType??Ws(h),m=o.locale??de,g,d,p;if(u==="band"){let A=h.map(N=>String(N??""));g=De(A);let w=new Map(g.map((N,O)=>[N,O]));d=g.map((N,O)=>O),p=Int32Array.from(A,N=>w.get(N)??-1)}else{let A=u==="date"?o.dayFirst??qt(h):void 0,w=h.map(G=>Vs(u,G,A)),N=Array.from(new Set(w.filter(G=>Number.isFinite(G)))).sort((G,fe)=>G-fe),O=new Map(N.map((G,fe)=>[G,fe]));d=N,g=N.map(String),p=Int32Array.from(w,G=>O.get(G)??-1)}let C=o.dateFormat,x=A=>typeof A=="string"?Jt(A.trim())?.[3]:void 0,S=u==="date"&&h.length<5e3?x(h[0]):void 0,$=(S===2||S===3)&&h.every(A=>x(A)===S),P=$&&S===3;if(u==="date"&&!C){let A=d.length>1?d[d.length-1]-d[0]:0;C=$&&S===2||A>864e5*120?{month:"short"}:A<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},A>864e5*800&&(C={year:"numeric",month:"short"})}let y;if(u==="band")y=g;else if(P&&!o.dateFormat){let A=q(m)==="ko";y=d.map(w=>{let N=new Date(w),O=Math.floor(N.getMonth()/3)+1;return A?`${N.getFullYear()}년 ${O}분기`:`Q${O} ${N.getFullYear()}`})}else{let A=d.every(Yn),w=u==="date"?new Intl.DateTimeFormat(m,C):new Intl.NumberFormat(m,A?{useGrouping:!1}:{maximumFractionDigits:6});y=d.length>1e3?Uo(d.length,N=>w.format(d[N])):d.map(N=>w.format(N))}let F=s?[...s]:c?De(e.map((A,w)=>String(c(A,w)??""))):[""],z=new Map(F.map((A,w)=>[A,w])),I=F.map(()=>new Array(g.length).fill(NaN)),E=F.map(()=>new Array(g.length).fill(null)),B=o.aggregate??"sum",v=B==="mean"?F.map(()=>new Uint32Array(g.length)):null,M=(A,w,N,O)=>{let G=I[A][w];B==="last"?I[A][w]=N:B==="count"?I[A][w]=(Number.isFinite(G)?G:0)+1:B==="mean"?Number.isFinite(N)&&(I[A][w]=(Number.isFinite(G)?G:0)+N,v[A][w]++):I[A][w]=Number.isFinite(G)?G+(Number.isFinite(N)?N:0):N,E[A][w]=O};for(let A=0;A<e.length;A++){let w=p[A];if(w<0)continue;let N=e[A];if(s)for(let O=0;O<s.length;O++)M(O,w,$e(N[s[O]]),N);else{let O=c?z.get(String(c(N,A)??""))??0:0;M(O,w,$e(l(N,A)),N)}}if(v)for(let A=0;A<I.length;A++)for(let w=0;w<g.length;w++)v[A][w]>1&&(I[A][w]/=v[A][w]);return{type:u,keys:g,xnum:d,labels:y,series:F,values:I,rows:E}}var Ks=140,Ft=12,Yo=14,lr=20,Jo=12.5;function Xs(e,t,n=Ao){let r=Me(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function Us(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Ft)/(Ks+Ft))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ys(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Ft)/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 Nt=e=>e.filter(Number.isFinite);function hn(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=ln(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return Nt(n)}function Zo(e,t,n,r,o,a){return Rt(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Js(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let y=t.flat(),F=r.refLines??{},[z,I]=At([...hn(y,r.x??"x"),...Nt([Number(F.x)])]),[E,B]=At([...hn(y,r.y??"y"),...Nt([Number(F.y)])].filter(M=>!s||M>0)),v=r.zero??!1;return{y:c??(s?sr(E,B,i):Ze(E,B,i,{zero:v,pad:.08})),x:r.xDomain??Ze(z,I,Math.max(2,Math.round(o/110)),{zero:v,pad:.06}),sameKeys:!0}}let h=e==="bar",u=h&&r.orientation==="horizontal",m=n[0]?.keys.join(""),g=n.every(y=>y.keys.join("")===m),d=n.length>0&&n.every(y=>y.type!=="band"&&y.type===n[0].type),p=r.xDomain??(!h&&d?At(n.flatMap(y=>Nt(y.xnum))):void 0),C=h?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(C==="percent")return{x:p,sameKeys:g};if(c)return{y:c,x:p,sameKeys:g};let x=[];t.forEach((y,F)=>{let z=n[F];if(C==="stacked"||C==="auto"&&z.series.length>1){let E=or(z.values,"zero");E.y0.forEach(B=>x.push(...B)),E.y1.forEach(B=>x.push(...B))}else z.values.forEach(E=>x.push(...E));h&&!u&&r.line!==void 0&&Zo(e,y,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>x.push(...E)),h||x.push(...hn(y,r.lower),...hn(y,r.upper))}),h&&x.push(0),u||x.push(...Ho(r.annotations));for(let y of r.referenceLines??[])x.push(y.y);r.signColors&&x.push(Number(r.baseline??0));let[S,$]=At(Nt(x).filter(y=>!s||y>0));return{y:s?sr(S,$,i):h?Ze(S,$,u?Math.max(2,Math.round(o/120)):i):Ze(S,$,i,{zero:r.zero??e==="area"}),x:p,sameKeys:g}}function Zs(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Rt(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?Xo:St)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),h=Go(c,Yt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(y=>y.series),m=r.endLabels??n.some(y=>y.series.length>1),g=h+6,d=a-(m?Math.min(a*.28,Math.max(...u.map(y=>oe(y,11,700)),20)+14):10),p=l.keys.length,[C,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,S=l.type==="number"?p>12:p>fn(C,x,Math.max(2,Math.floor((d-g)/64)),s).length;if(l.type==="band"||!p||S)return;let $=y=>g+(l.xnum[y]-C)/(x-C)*(d-g),P=y=>oe(l.labels[y],pt);for(let y=1;;y++){let F=Array.from({length:Math.ceil(p/y)},(z,I)=>I*y);if(y>=p||F.every((z,I)=>!I||$(z)-$(F[I-1])>=(P(z)+P(F[I-1]))/2+8))return F.map(z=>({value:l.xnum[z],label:l.labels[z]}))}}function qs(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 Qs(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${qs(`${e}|${t}|${o}|${cn(r)}`)}`}function el(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 tl={en:{intro:(e,t)=>`${Be(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:"(빈 값)"}},cr=18;function qo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Xs(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Us(s,i,e.columns),{pw:c,ph:h}=Ys(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(v=>Zo(t,v,n,n.y,n.series,n.aggregate)),g=u?Js(t,o,m,n,c,h):{sameKeys:!1},d=u?Zs(t,o,m,n,g,c,h,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",C=u&&(!p||g.sameKeys),x=u&&(p||g.x!==void 0||g.sameKeys),S=new Set(el(e.highlight,r)?[e.highlight].flat():[]),$=S.size>0,P=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,y=e.syncId??Qs(t,e.by,n,e.data),F=ft(ot(n.format,e.locale),n.unit),z=tl[e.lang],I=[],E=r.map(v=>v===""?z.blank:v);return{panels:r.map((v,M)=>{let A=o[M],w=E[M],N=M%l,O;if(t!=="scatter"){let fe=m[M],We=Y=>fe.values.reduce((ge,Ke)=>ge+(Number.isFinite(Ke[Y])?Ke[Y]:0),0),X=fe.keys.map((Y,ge)=>ge).filter(Y=>fe.values.some(ge=>Number.isFinite(ge[Y]))),se=X[X.length-1];I.push({first:X.length?We(X[0]):NaN,last:X.length?We(se):NaN,total:X.reduce((Y,ge)=>Y+We(ge),0)}),t!=="bar"&&fe.series.length===1&&se!==void 0&&(O=F(fe.values[0][se]))}else I.push({first:NaN,last:NaN,total:A.length});let G={data:A,width:c,height:h,ariaLabel:e.title?`${e.title}, ${w}`:w,syncId:y,highlight:$?S.has(v)?P?()=>!0:void 0:"none":e.highlight,showYAxis:!C||N===0,showXAxis:!x||M+l>=i};return g.y&&(G.yDomain=g.y),g.x&&(G.xDomain=g.x),d&&(G.xTicks=d),{value:v,label:w,props:G,last:O,isPicked:S.has(v)}}),cols:l,pw:c,ph:h,isPanelPick:$,description:nl(t,e.by,E,I,a,F,z)}}function nl(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>un(r.map(h=>h[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let h=n.filter((u,m)=>r[m].last<r[m].first);s+=h.length?i.falling(`${h.slice(0,5).join(", ")}${h.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var ke=D(Z(),1);function rl(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function ol(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 gn={threshold:.25,enoughPx:96,rootMargin:"0px"};function ti(e,t=!0){let[n,r]=(0,ke.useState)({visible:!t,near:!t});return(0,ke.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=ol(i[i.length-1],gn.threshold,gn.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:rl(gn.threshold),rootMargin:gn.rootMargin}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Qo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function pn(e){let[t,n]=(0,ke.useState)(null),[r,o]=(0,ke.useState)(e??null),a=(0,ke.useCallback)(i=>{n(i),i&&e===void 0&&o(Qo(i))},[e]);return Ee(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(h=>h!==null&&Math.abs(h-c)<.5?h:c),s=()=>i(Qo(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let h=c[c.length-1]?.contentRect;h?i(h.width>0?Math.round(h.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var il=()=>()=>{};function bt(){return(0,ke.useSyncExternalStore)(il,()=>!0,()=>!1)}var ei="(prefers-reduced-motion: reduce)";function bn(e="auto"){let[t,n]=(0,ke.useState)(()=>Fe&&typeof window.matchMedia=="function"?window.matchMedia(ei).matches:!1);return(0,ke.useEffect)(()=>{if(e!=="auto"||!Fe||typeof window.matchMedia!="function")return;let r=window.matchMedia(ei),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Le=D(H(),1),al=60,sl=420;function ni(e){let t=_e(),n=e.chartProps??{},[,r,o]=pn(e.width),a=e.width??(o||480),i=be(e.locale??n.locale),s=q(i),l=(0,yt.useContext)(ut),c=e.title??l,h=e.chart.facetPlan,u=(0,yt.useMemo)(()=>{let x=qo({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return h?h(x,n,i):x},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(x,S)=>typeof S=="function"?String(S):S),e.highlight,e.syncId,a,e.height,c,i,s,h]),m=`${(0,yt.useId)().replace(/:/g,"")}fd`,g=bn(n.reducedMotion??"auto"),d=bt(),p=Jr({motion:{enabled:n.animate!==!1&&!g&&Fe},hydrated:d},{waiting:!1,generation:0}),C=e.chart;return(0,Le.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Le.jsx)("p",{id:m,style:on,children:e.description??u.description}),(0,Le.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:Ft,rowGap:Yo,...u.legend?{marginTop:cr}:null},children:u.panels.map((x,S)=>{let $=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Le.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...Yr(p,!1,"fade",S*al,sl)},children:[(0,Le.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:lr,fontSize:Jo,fontWeight:700,lineHeight:`${lr}px`,color:$},children:[(0,Le.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,Le.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,Le.jsx)(C,{...n,...x.props})]},x.value)})}),u.legend?(0,Le.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:cr},children:u.legend}):null]})}var ri=["max","min","first","last","none"];function Oe(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let h=-1,u=c==="max"?-1/0:1/0;r.forEach((m,g)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,h=g)}),h>=0&&a.add(h)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,h)=>{h<i&&c!==null&&c!==void 0&&e(c,h)&&a.add(h)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((h,u)=>{h===c&&a.add(u)});return a}var Te=D(Z(),1);async function ll(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(q(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return it(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return it(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):it(a)}async function cl(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await ll(a,t.parse,o,t.locale)}return t.select&&(r=Do(r,t.select)),t.transform?t.transform(r):Je(r)}function oi(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Te.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Te.useState)(0),c=be(t.locale),h=(0,Te.useRef)(t);h.current={...t,locale:c};let u=(0,Te.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",g=t.deps??[],d=JSON.stringify(g.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),p=(0,Te.useRef)(!1);(0,Te.useEffect)(()=>{let x=u.current;if(!x||!r){i(P=>P.status==="loading"?{...P,status:"idle"}:P);return}let S=new AbortController,$=!0;return p.current=!0,i(P=>({...P,data:o?P.data:[],status:"loading",error:null})),cl(x,{...h.current,signal:S.signal}).then(P=>{$&&i({data:P,status:"success",error:null,updatedAt:Date.now()})}).catch(P=>{!$||S.signal.aborted||i(y=>({...y,status:"error",error:P instanceof Error?P:new Error(String(P))}))}).finally(()=>{$&&(p.current=!1)}),()=>{$=!1,p.current=!1,S.abort()}},[m,r,s,d,o]),(0,Te.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{p.current||l(S=>S+1)},n);return()=>clearInterval(x)},[n,r]);let C=(0,Te.useCallback)(()=>l(x=>x+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:C}}var mr=D(H(),1),ul=["csv","svg","png"],ml=/^[=+\-@\t\r\n=+-@]/,dl=/var\(|color-mix\(/;function ii(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?fo(e.getTime()):String(e);return`"${(ml.test(t)&&!Number.isFinite($e(t))?`'${t}`:t).replace(/"/g,'""')}"`}function fl(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function hl(e,t){return`\uFEFF${[t.map(ii),...e.map(r=>t.map(o=>ii(r[o])))].map(r=>r.join(",")).join(`\r
25
+ `&&d++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let h=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!h.length)return[];let u=d=>n?Po(d):d;if(!r)return h.map(d=>Object.fromEntries(d.map((p,C)=>[String(C),u(p)])));let m=[],g=new Set;return h[0].forEach((d,p)=>{let C=d.trim()||`col${p+1}`,x=C;for(let S=2;g.has(x);S++)x=`${C}_${S}`;g.add(x),m.push(x)}),h.slice(1).map(d=>Object.fromEntries(m.map((p,C)=>[p,u(d[C]??"")])))}function rr(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof i[l]=="string"?Po(i[l]):i[l]??null])))}function Bs(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Do(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 Je(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Je(JSON.parse(t))}catch{}return it(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?rr(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)?Je(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?rr(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)?Je(t.rows):Array.isArray(t.values)?rr(t.values):Array.isArray(t.items)?Je(t.items):Array.isArray(t.results)?Je(t.results):Bs(t)}return[]}function cn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function or(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let h=e[l][c];return Number.isFinite(h)&&h>0?h:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let h=0,u=0;for(let m=0;m<n;m++){let g=i(m,c),d=g-i(m,c-1),p=0;for(let C=0;C<m;C++)p+=i(C,c)-i(C,c-1);h+=g,u+=(d/2+p)*g}h&&(l-=u/h),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,m=0;for(let g=0;g<n;g++){let d=e[g][l],p=Number.isFinite(d)?d:0;p>=0?(o[g][l]=u,u+=p,a[g][l]=u):(o[g][l]=m,m+=p,a[g][l]=m)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let h=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let m=i(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=h,h+=m,a[u][l]=h}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let h=0;for(let u=0;u<r;u++)h+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;h/=r;for(let u=0;u<n;u++)for(let m=0;m<r;m++)o[u][m]-=h,a[u][m]-=h}return{y0:o,y1:a}}function Lo(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 Eo(e){let t=e.length,n=e.map(c=>{let h=0,u=-1/0;return c.forEach((m,g)=>{m>u&&(u=m,h=g)}),h}),r=e.map(c=>c.reduce((h,u)=>h+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,h)=>h).sort((c,h)=>n[c]-n[h]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var Hs=Math.PI*2;function Oo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ir(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function un(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function zo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Io(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 mn=new Map;function oe(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=mn.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);zo(c)?i+=Io(c):s+=Io(c)}a=i+s*(n>=600?1.07:1),mn.size>5e3&&mn.clear(),mn.set(o,a)}return a*t}function at(e,t,n,r=400){if(e=e.trim(),oe(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;oe(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(zo(s.charCodeAt(0))?2:3)?"":s+o}function Bo(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}var Ct=D(H(),1),js=e=>Array.isArray(e)&&e.length===2;function Ho(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&js(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Gs=(e,t)=>oe(e,10.5,t?700:500)+8;function dn(e,t,n,r="start",o){let a=Gs(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function jo({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=dn(r,t,n,o,a);return(0,Ct.jsxs)("g",{children:[(0,Ct.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,Ct.jsx)(xe,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}var Ko=D(H(),1),pt=10.5;function Vs(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>rt(i,{locale:n,maximumFractionDigits:a}))}function Go(e,t,n){let r=18;for(let o of Vs(e,t,n))r=Math.max(r,oe(o,pt));return Math.ceil(r+8)}function Vo(e,t,n){let r=[],o=-1/0;for(let a of e){let i=oe(a.label,pt),s=Math.max(a.x-i/2,0);s<o+8||a.x-i/2<t||a.x+i/2>n||(r.push(a),o=s+i)}return r}function ar(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,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=ar(i,n),c=[o,a];for(let h=0;h<4;h++){let u=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let g=ar(c[1]-c[0],n);if(g===l)break;l=g}return c}function Wo(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=ar(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function St(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>Wo(n,r,l),s}function sr(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=Ze(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function Ks(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,h=1)=>{let u=[];for(let m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%h))for(let g of c){let d=Number((g*10**m).toPrecision(12));d>=e*(1-1e-9)&&d<=t*(1+1e-9)&&u.push(d)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:Wo(e,t,3)}function Xo(e,t){let n=St([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=()=>Ks(e[0],e[1],Math.abs(t[1]-t[0])),r}function At(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 Ws=864e5;function fn(e,t,n,r=de){let o=t-e;if(!(o>0))return[{t:e,label:He(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ws,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(h,u,m,g=!1)=>{let d=new Date(h),p=-1,C=0;for(;d.getTime()<=t&&C++<500;){if(d.getTime()>=e){let x=d.getFullYear(),S=g&&!l&&x!==p;i.push({t:d.getTime(),label:He(d,{locale:r,...m,...S?{year:"numeric"}:{}})}),p=x}u(d)}};if(a<=1.5){let h=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(g=>g>=h)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,g=>g.setHours(g.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(h,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()+(8-h.getDay())%7),c(h,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let h=a/30.44,u=Math.max(1,Math.ceil(h/Math.max(1,n))),m=[1,2,3,6,12,24,60].find(g=>g>=u)??120;if(m>=12){let g=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(g,d=>d.setFullYear(d.getFullYear()+m/12),{year:"numeric"})}else{let g=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),d=g.getMonth()%m;d&&g.setMonth(g.getMonth()+(m-d)),c(g,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function Uo(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var Xs=(e,t,n)=>e==="date"?ht(t,n)?.getTime()??NaN:$e(t);function Us(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Zt(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Rt(e,t,n,r,o={}){let a=je(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:je(n,"y"),c=!i&&r!==void 0?je(r,"series"):null,h=e.map((A,w)=>a(A,w)),u=o.xType??Us(h),m=o.locale??de,g,d,p;if(u==="band"){let A=h.map(N=>String(N??""));g=De(A);let w=new Map(g.map((N,O)=>[N,O]));d=g.map((N,O)=>O),p=Int32Array.from(A,N=>w.get(N)??-1)}else{let A=u==="date"?o.dayFirst??qt(h):void 0,w=h.map(G=>Xs(u,G,A)),N=Array.from(new Set(w.filter(G=>Number.isFinite(G)))).sort((G,fe)=>G-fe),O=new Map(N.map((G,fe)=>[G,fe]));d=N,g=N.map(String),p=Int32Array.from(w,G=>O.get(G)??-1)}let C=o.dateFormat,x=A=>typeof A=="string"?Jt(A.trim())?.[3]:void 0,S=u==="date"&&h.length<5e3?x(h[0]):void 0,$=(S===2||S===3)&&h.every(A=>x(A)===S),_=$&&S===3;if(u==="date"&&!C){let A=d.length>1?d[d.length-1]-d[0]:0;C=$&&S===2||A>864e5*120?{month:"short"}:A<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},A>864e5*800&&(C={year:"numeric",month:"short"})}let y;if(u==="band")y=g;else if(_&&!o.dateFormat){let A=q(m)==="ko";y=d.map(w=>{let N=new Date(w),O=Math.floor(N.getMonth()/3)+1;return A?`${N.getFullYear()}년 ${O}분기`:`Q${O} ${N.getFullYear()}`})}else{let A=d.every(Yn),w=u==="date"?new Intl.DateTimeFormat(m,C):new Intl.NumberFormat(m,A?{useGrouping:!1}:{maximumFractionDigits:6});y=d.length>1e3?Uo(d.length,N=>w.format(d[N])):d.map(N=>w.format(N))}let F=s?[...s]:c?De(e.map((A,w)=>String(c(A,w)??""))):[""],z=new Map(F.map((A,w)=>[A,w])),I=F.map(()=>new Array(g.length).fill(NaN)),E=F.map(()=>new Array(g.length).fill(null)),B=o.aggregate??"sum",v=B==="mean"?F.map(()=>new Uint32Array(g.length)):null,T=(A,w,N,O)=>{let G=I[A][w];B==="last"?I[A][w]=N:B==="count"?I[A][w]=(Number.isFinite(G)?G:0)+1:B==="mean"?Number.isFinite(N)&&(I[A][w]=(Number.isFinite(G)?G:0)+N,v[A][w]++):I[A][w]=Number.isFinite(G)?G+(Number.isFinite(N)?N:0):N,E[A][w]=O};for(let A=0;A<e.length;A++){let w=p[A];if(w<0)continue;let N=e[A];if(s)for(let O=0;O<s.length;O++)T(O,w,$e(N[s[O]]),N);else{let O=c?z.get(String(c(N,A)??""))??0:0;T(O,w,$e(l(N,A)),N)}}if(v)for(let A=0;A<I.length;A++)for(let w=0;w<g.length;w++)v[A][w]>1&&(I[A][w]/=v[A][w]);return{type:u,keys:g,xnum:d,labels:y,series:F,values:I,rows:E}}var Ys=140,Ft=12,Yo=14,lr=20,Jo=12.5;function Js(e,t,n=Ao){let r=Te(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function Zs(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Ft)/(Ys+Ft))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function qs(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Ft)/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 Nt=e=>e.filter(Number.isFinite);function hn(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=ln(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return Nt(n)}function Zo(e,t,n,r,o,a){return Rt(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Qs(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let y=t.flat(),F=r.refLines??{},[z,I]=At([...hn(y,r.x??"x"),...Nt([Number(F.x)])]),[E,B]=At([...hn(y,r.y??"y"),...Nt([Number(F.y)])].filter(T=>!s||T>0)),v=r.zero??!1;return{y:c??(s?sr(E,B,i):Ze(E,B,i,{zero:v,pad:.08})),x:r.xDomain??Ze(z,I,Math.max(2,Math.round(o/110)),{zero:v,pad:.06}),sameKeys:!0}}let h=e==="bar",u=h&&r.orientation==="horizontal",m=n[0]?.keys.join(""),g=n.every(y=>y.keys.join("")===m),d=n.length>0&&n.every(y=>y.type!=="band"&&y.type===n[0].type),p=r.xDomain??(!h&&d?At(n.flatMap(y=>Nt(y.xnum))):void 0),C=h?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(C==="percent")return{x:p,sameKeys:g};if(c)return{y:c,x:p,sameKeys:g};let x=[];t.forEach((y,F)=>{let z=n[F];if(C==="stacked"||C==="auto"&&z.series.length>1){let E=or(z.values,"zero");E.y0.forEach(B=>x.push(...B)),E.y1.forEach(B=>x.push(...B))}else z.values.forEach(E=>x.push(...E));h&&!u&&r.line!==void 0&&Zo(e,y,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>x.push(...E)),h||x.push(...hn(y,r.lower),...hn(y,r.upper))}),h&&x.push(0),u||x.push(...Ho(r.annotations));for(let y of r.referenceLines??[])x.push(y.y);r.signColors&&x.push(Number(r.baseline??0));let[S,$]=At(Nt(x).filter(y=>!s||y>0));return{y:s?sr(S,$,i):h?Ze(S,$,u?Math.max(2,Math.round(o/120)):i):Ze(S,$,i,{zero:r.zero??e==="area"}),x:p,sameKeys:g}}function el(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Rt(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?Xo:St)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),h=Go(c,Yt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(y=>y.series),m=r.endLabels??n.some(y=>y.series.length>1),g=h+6,d=a-(m?Math.min(a*.28,Math.max(...u.map(y=>oe(y,11,700)),20)+14):10),p=l.keys.length,[C,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,S=l.type==="number"?p>12:p>fn(C,x,Math.max(2,Math.floor((d-g)/64)),s).length;if(l.type==="band"||!p||S)return;let $=y=>g+(l.xnum[y]-C)/(x-C)*(d-g),_=y=>oe(l.labels[y],pt);for(let y=1;;y++){let F=Array.from({length:Math.ceil(p/y)},(z,I)=>I*y);if(y>=p||F.every((z,I)=>!I||$(z)-$(F[I-1])>=(_(z)+_(F[I-1]))/2+8))return F.map(z=>({value:l.xnum[z],label:l.labels[z]}))}}function tl(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 nl(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${tl(`${e}|${t}|${o}|${cn(r)}`)}`}function rl(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 ol={en:{intro:(e,t)=>`${Be(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:"(빈 값)"}},cr=18;function qo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Js(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Zs(s,i,e.columns),{pw:c,ph:h}=qs(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(v=>Zo(t,v,n,n.y,n.series,n.aggregate)),g=u?Qs(t,o,m,n,c,h):{sameKeys:!1},d=u?el(t,o,m,n,g,c,h,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",C=u&&(!p||g.sameKeys),x=u&&(p||g.x!==void 0||g.sameKeys),S=new Set(rl(e.highlight,r)?[e.highlight].flat():[]),$=S.size>0,_=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,y=e.syncId??nl(t,e.by,n,e.data),F=ft(ot(n.format,e.locale),n.unit),z=ol[e.lang],I=[],E=r.map(v=>v===""?z.blank:v);return{panels:r.map((v,T)=>{let A=o[T],w=E[T],N=T%l,O;if(t!=="scatter"){let fe=m[T],Ke=Y=>fe.values.reduce((ge,We)=>ge+(Number.isFinite(We[Y])?We[Y]:0),0),X=fe.keys.map((Y,ge)=>ge).filter(Y=>fe.values.some(ge=>Number.isFinite(ge[Y]))),le=X[X.length-1];I.push({first:X.length?Ke(X[0]):NaN,last:X.length?Ke(le):NaN,total:X.reduce((Y,ge)=>Y+Ke(ge),0)}),t!=="bar"&&fe.series.length===1&&le!==void 0&&(O=F(fe.values[0][le]))}else I.push({first:NaN,last:NaN,total:A.length});let G={data:A,width:c,height:h,ariaLabel:e.title?`${e.title}, ${w}`:w,syncId:y,highlight:$?S.has(v)?_?()=>!0:void 0:"none":e.highlight,showYAxis:!C||N===0,showXAxis:!x||T+l>=i};return g.y&&(G.yDomain=g.y),g.x&&(G.xDomain=g.x),d&&(G.xTicks=d),{value:v,label:w,props:G,last:O,isPicked:S.has(v)}}),cols:l,pw:c,ph:h,isPanelPick:$,description:il(t,e.by,E,I,a,F,z)}}function il(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>un(r.map(h=>h[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let h=n.filter((u,m)=>r[m].last<r[m].first);s+=h.length?i.falling(`${h.slice(0,5).join(", ")}${h.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var ke=D(Z(),1);function al(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function sl(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 gn={threshold:.25,enoughPx:96,rootMargin:"0px"};function ti(e,t=!0){let[n,r]=(0,ke.useState)({visible:!t,near:!t});return(0,ke.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=sl(i[i.length-1],gn.threshold,gn.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:al(gn.threshold),rootMargin:gn.rootMargin}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Qo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function pn(e){let[t,n]=(0,ke.useState)(null),[r,o]=(0,ke.useState)(e??null),a=(0,ke.useCallback)(i=>{n(i),i&&e===void 0&&o(Qo(i))},[e]);return Ee(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(h=>h!==null&&Math.abs(h-c)<.5?h:c),s=()=>i(Qo(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let h=c[c.length-1]?.contentRect;h?i(h.width>0?Math.round(h.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var ll=()=>()=>{};function bt(){return(0,ke.useSyncExternalStore)(ll,()=>!0,()=>!1)}var ei="(prefers-reduced-motion: reduce)";function bn(e="auto"){let[t,n]=(0,ke.useState)(()=>Fe&&typeof window.matchMedia=="function"?window.matchMedia(ei).matches:!1);return(0,ke.useEffect)(()=>{if(e!=="auto"||!Fe||typeof window.matchMedia!="function")return;let r=window.matchMedia(ei),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Le=D(H(),1),cl=60,ul=420;function ni(e){let t=Pe(),n=e.chartProps??{},[,r,o]=pn(e.width),a=e.width??(o||480),i=be(e.locale??n.locale),s=q(i),l=(0,yt.useContext)(ut),c=e.title??l,h=e.chart.facetPlan,u=(0,yt.useMemo)(()=>{let x=qo({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return h?h(x,n,i):x},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(x,S)=>typeof S=="function"?String(S):S),e.highlight,e.syncId,a,e.height,c,i,s,h]),m=`${(0,yt.useId)().replace(/:/g,"")}fd`,g=bn(n.reducedMotion??"auto"),d=bt(),p=Jr({motion:{enabled:n.animate!==!1&&!g&&Fe},hydrated:d},{waiting:!1,generation:0}),C=e.chart;return(0,Le.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Le.jsx)("p",{id:m,style:on,children:e.description??u.description}),(0,Le.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:Ft,rowGap:Yo,...u.legend?{marginTop:cr}:null},children:u.panels.map((x,S)=>{let $=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Le.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...Yr(p,!1,"fade",S*cl,ul)},children:[(0,Le.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:lr,fontSize:Jo,fontWeight:700,lineHeight:`${lr}px`,color:$},children:[(0,Le.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,Le.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,Le.jsx)(C,{...n,...x.props})]},x.value)})}),u.legend?(0,Le.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:cr},children:u.legend}):null]})}var ri=["max","min","first","last","none"];function Oe(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let h=-1,u=c==="max"?-1/0:1/0;r.forEach((m,g)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,h=g)}),h>=0&&a.add(h)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,h)=>{h<i&&c!==null&&c!==void 0&&e(c,h)&&a.add(h)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((h,u)=>{h===c&&a.add(u)});return a}var Me=D(Z(),1);async function ml(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(q(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return it(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return it(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):it(a)}async function dl(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await ml(a,t.parse,o,t.locale)}return t.select&&(r=Do(r,t.select)),t.transform?t.transform(r):Je(r)}function oi(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Me.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Me.useState)(0),c=be(t.locale),h=(0,Me.useRef)(t);h.current={...t,locale:c};let u=(0,Me.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",g=t.deps??[],d=JSON.stringify(g.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),p=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{let x=u.current;if(!x||!r){i(_=>_.status==="loading"?{..._,status:"idle"}:_);return}let S=new AbortController,$=!0;return p.current=!0,i(_=>({..._,data:o?_.data:[],status:"loading",error:null})),dl(x,{...h.current,signal:S.signal}).then(_=>{$&&i({data:_,status:"success",error:null,updatedAt:Date.now()})}).catch(_=>{!$||S.signal.aborted||i(y=>({...y,status:"error",error:_ instanceof Error?_:new Error(String(_))}))}).finally(()=>{$&&(p.current=!1)}),()=>{$=!1,p.current=!1,S.abort()}},[m,r,s,d,o]),(0,Me.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{p.current||l(S=>S+1)},n);return()=>clearInterval(x)},[n,r]);let C=(0,Me.useCallback)(()=>l(x=>x+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:C}}var mr=D(H(),1),fl=["csv","svg","png"],hl=/^[=+\-@\t\r\n=+-@]/,gl=/var\(|color-mix\(/;function ii(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?fo(e.getTime()):String(e);return`"${(hl.test(t)&&!Number.isFinite($e(t))?`'${t}`:t).replace(/"/g,'""')}"`}function pl(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function bl(e,t){return`\uFEFF${[t.map(ii),...e.map(r=>t.map(o=>ii(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function gl(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function ur(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var ai=2,qe=16;function si(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function li(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 ci(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,l]=[a+qe*2,i+qe*2],c=o.cloneNode(!0),h=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,p)=>{let C;for(let x of Array.from(d.attributes)){if(!dl.test(x.value))continue;let S=(C??(C=getComputedStyle(d))).getPropertyValue(x.name);S&&h[p].setAttribute(x.name,si(S,u))}}),c.removeAttribute("style");for(let[d,p]of Object.entries({viewBox:`${-qe} ${-qe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(d,String(p));let m=si(getComputedStyle(r).backgroundColor,u),g=o.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(li("rect",{x:-qe,y:-qe,width:s,height:l,fill:m}),d),g&&c.insertBefore(li("image",{href:g.toDataURL(),width:a,height:i}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:m,canvas:g}}function pl(e,t){let n=ci(e,ai,!1);if(!n)return;let r=ai,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,qe*r,qe*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(l=>l&&ur(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function ui(e){let t=_e(e.theme),n=q(be(e.locale))==="ko",r=gl(e.filename),o=(a,i)=>{if(a==="csv")return ur(new Blob([hl(e.data,e.columns?.length?e.columns:fl(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return pl(i,r);let s=ci(i,1,!0);s&&ur(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,mr.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:ul.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,mr.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,l.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var di=D(H(),1);function mi(e,t=de){let n=ot(void 0,t),r=e.split(`
28
- `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?He(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(go,(h,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,di.jsx)("div",{children:s},l)):null}}var hi=e=>e==null||e==="";function dr(e){if(hi(e))return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"x":"d";if(typeof e=="number")return Number.isFinite(e)?"n":"x";if(typeof e=="string"){let t=e.trim();return Zt(t)?"d":Number.isFinite($e(t))?"n":t?"x":""}return"x"}function gi(e,t,n={}){let r=Me(t.label,"label"),o=je(t.start,"start"),a=je(t.end,"end"),i=t.group===void 0?null:Me(t.group,"group"),s=t.status===void 0?null:Me(t.status,"status"),l=e.map((v,M)=>o(v,M)),c=e.map((v,M)=>a(v,M)),h=l.concat(c),u=n.xType,m=0,g=0;if(!u){for(let v of h){let M=dr(v);M==="d"?m++:M==="n"&&g++}u=m>g?"date":"number"}let d=!n.xType,p=u==="date"?n.dayFirst??qt(h):void 0,C=u==="date"?"d":"n",x=v=>d&&dr(v)!==C?NaN:u==="date"?ht(v,p)?.getTime()??NaN:$e(v),S=v=>d&&dr(v)===(C==="d"?"n":"d"),$={swapped:0,open:0,noStart:0,badEnd:0,mixed:0,duplicate:0},P=[],y=-1/0;for(let v=0;v<e.length;v++){let M=x(l[v]),A=x(c[v]);if(!Number.isFinite(M)){S(l[v])?$.mixed++:$.noStart++;continue}let w=!Number.isFinite(A)&&hi(c[v]);if(!Number.isFinite(A)&&!w){S(c[v])?$.mixed++:$.badEnd++;continue}w?$.open++:A<M&&([M,A]=[A,M],$.swapped++),y=Math.max(y,w?M:A);let N=e[v];P.push({i:v,label:r(N,v),start:M,end:A,open:w,point:!w&&A===M,group:i?i(N,v):"",status:s?s(N,v):"",datum:N})}let F=n.now===void 0?NaN:x(n.now),z=new Set;for(let v of P){v.open&&(v.end=Number.isFinite(F)&&F>=v.start?F:Math.max(y,v.start),v.point=v.end===v.start);let M=`${v.label}${v.start}${v.end}${v.group}`;z.has(M)?$.duplicate++:z.add(M)}let I=u==="date",E=I&&P.length>0&&P.every(v=>fi(v.start)&&fi(v.end)),B=I&&!E&&P.some(v=>new Date(v.start).getSeconds()||new Date(v.end).getSeconds());return{kind:u,items:P,issues:$,dateOnly:E,hasSeconds:B,read:x}}function Pt(e,t,n=!1){let r=Me(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=De(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}var st=864e5;function pi(e){let t=1/0,n=-1/0;for(let o of e.items)o.start<t&&(t=o.start),o.end>n&&(n=o.end);if(t===1/0)return[0,1];if(e.kind==="number")return Ze(t,n,5,{zero:!1});let r=e.dateOnly?st:st/2;return t===n?[t-r,n+r]:[t,n]}var fi=e=>{let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0&&t.getMilliseconds()===0};function bi(e,t="none"){let n=new Map;e.forEach((i,s)=>{let l=n.get(i.label);l?l.push(s):n.set(i.label,[s])});let r=new Int32Array(e.length),o=[];for(let[i,s]of n){s.sort((h,u)=>e[h].start-e[u].start||e[h].end-e[u].end||h-u);let l=[],c=[];for(let h of s){let u=e[h],m=0;for(;m<l.length&&!(l[m]<u.start||l[m]===u.start&&!(c[m]&&u.point));)m++;l[m]=u.end,c[m]=u.point,r[h]=m}o.push({label:i,items:s,lanes:l.length,lane0:0})}if(t==="start")o.sort((i,s)=>e[i.items[0]].start-e[s.items[0]].start);else if(t==="duration"){let i=l=>l.items.reduce((c,h)=>c+e[h].end-e[h].start,0),s=new Map(o.map(l=>[l,i(l)]));o.sort((l,c)=>s.get(c)-s.get(l))}let a=0;for(let i of o)i.lane0=a,a+=i.lanes;return{rows:o,lane:r}}function yi(e,t){let n=t.filter(l=>e[l].status&&!e[l].point).sort((l,c)=>e[l].start-e[c].start||l-c),r=Array.from(new Set(n.flatMap(l=>[e[l].start,e[l].end]))).sort((l,c)=>l-c),o=[],a=[],i=0;for(let l=0;l+1<r.length;l++){let c=r[l];for(;i<n.length&&e[n[i]].start<=c;)a.push(n[i++]);for(;a.length&&e[a[a.length-1]].end<=c;)a.pop();a.length&&o.push({t0:c,t1:r[l+1],k:a[a.length-1]})}let s=[];for(let l of o){let c=e[l.k],h=s[s.length-1];h&&h.status===c.status&&h.t1===l.t0?(h.t1=l.t1,h.open=c.open&&l.t1===c.end):s.push({status:c.status,t0:l.t0,t1:l.t1,open:c.open&&l.t1===c.end})}return{spans:s,pieces:o,points:t.filter(l=>e[l].status&&e[l].point)}}function xi(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 it(t.csv)}return null}var Ri=D(Z(),1);var lt=D(Z(),1);var Ce=D(H(),1),bl={zoomHint:" Press Enter to zoom in.",pickHint:" Press Enter to select.",high:"High",low:"Low",resetLabel:"Show all (reset zoom)",reset:"Show all",extremes:(e,t)=>`, high ${e}, low ${t}`,range:(e,t)=>`${e} to ${t}`},yl={en:bl,ko:{zoomHint:" Enter를 누르면 확대해요.",pickHint:" Enter를 누르면 이 구간을 골라요.",high:"최고",low:"최저",resetLabel:"전체 보기(확대 풀기)",reset:"전체 보기",extremes:(e,t)=>`, 최고 ${e}, 최저 ${t}`,range:(e,t)=>`${e}~${t}`}},xl=4;function kl(e){let[t,n]=(0,lt.useState)(null),[r,o]=(0,lt.useState)(!1),a=(0,lt.useRef)(null),i=(0,lt.useRef)(null),s=()=>{a.current=null,i.current=null,o(!1),n(null)},l=(m,g,d)=>!e.enabled||e.count<2||d.pointerType==="touch"||d.button!==0||!e.inPlot(m,g)?!1:(a.current={i:e.indexAt(m),x:m,moved:!1},d.currentTarget.setPointerCapture?.(d.pointerId),!0),c=m=>{let g=a.current;if(!g)return!1;if(!g.moved&&Math.abs(m-g.x)<xl)return!0;g.moved=!0;let d=e.indexAt(m),p=Math.min(g.i,d),C=Math.max(g.i,d);return o(!0),n(x=>x?.from===p&&x.to===C?x:{from:p,to:C}),!0},h=(m,g,d)=>{let p=a.current;if(a.current=null,d.currentTarget.hasPointerCapture?.(d.pointerId)&&d.currentTarget.releasePointerCapture(d.pointerId),!p)return;if(o(!1),!p.moved||d.type==="pointercancel"){t&&(n(null),e.onCommit(null));return}let C=e.indexAt(m),x={from:Math.min(p.i,C),to:Math.max(p.i,C)},S=x.to>x.from;n(S&&e.keep!==!1?x:null),e.onCommit(S?x:null)},u=(m,g)=>{if(!e.enabled)return!1;if(m.key==="Escape"&&t)return s(),e.onCommit(null),!0;if(m.key==="Enter"&&t&&i.current!==null)return i.current=null,e.keep===!1&&n(null),e.onCommit(t),!0;if(!m.shiftKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight"||e.count<2)return!1;let d=m.key==="ArrowRight"?1:-1,p=i.current??g??(d>0?0:e.count-1),C=t&&i.current!==null?t.from===p?t.to:t.from:p,x=Math.max(0,Math.min(e.count-1,C+d));return i.current=p,n(x===p?null:{from:Math.min(p,x),to:Math.max(p,x)}),!0};return{range:t,dragging:r,keyboard:t!==null&&i.current!==null,down:l,move:c,up:h,key:u}}function ki(e){let[t,n]=(0,lt.useState)(null);return t&&t.sig!==e&&n(null),{view:t&&t.sig===e?t.range:null,zoomTo:r=>n({sig:e,range:r}),reset:()=>n(null)}}function wi(e,t,n){let r=yl[n.lang],o=e.brush==="zoom"?"zoom":e.brush?"select":null,a=kl({enabled:o!==null,count:n.count,indexAt:n.indexAt,inPlot:n.inPlot,keep:o!=="zoom",onCommit:l=>{let c=l?n.toXRange(l):null;e.onBrush?.(c),o==="zoom"&&c&&c.to>c.from&&t.zoomTo([c.from,c.to])}}),i={onPointerDown:o?a.down:void 0,onPointerUp:o?a.up:void 0,onKey:o?l=>l.key==="Escape"&&t.view&&!a.range?(t.reset(),!0):a.key(l,n.active):void 0,overlay:t.view?(0,Ce.jsx)(wl,{p:n.p,onReset:t.reset,text:r}):null},s=a.keyboard?o==="zoom"?r.zoomHint:r.pickHint:"";return{brush:a,frame:i,hint:s,text:r}}function vi(e){let{p:t,top:n,bottom:r}=e,o=Math.min(e.x0,e.x1),a=Math.max(e.x0,e.x1),i=oe(e.main,11.5,800),s=oe(e.sub,10.5,500)+6,l=i+s+16,c=Math.max(2,Math.min(e.width-l-2,(o+a)/2-l/2)),h=n+4;return(0,Ce.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,Ce.jsx)("rect",{x:o,y:n,width:Math.max(1,a-o),height:Math.max(0,r-n),fill:t.paint("accent"),opacity:e.dragging?.1:.14}),(0,Ce.jsx)("line",{x1:o,x2:o,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,Ce.jsx)("line",{x1:a,x2:a,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,Ce.jsx)("rect",{x:c,y:h,width:l,height:22,rx:8,fill:t.paint("panel"),stroke:t.paint("line")}),(0,Ce.jsx)(xe,{x:c+8,y:h+11,size:11.5,weight:800,fill:t.paint("ink"),children:e.main}),(0,Ce.jsx)(xe,{x:c+8+i+6,y:h+11,size:10.5,weight:500,fill:t.paint("muted"),children:e.sub})]})}function wl(e){let{p:t}=e;return(0,Ce.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onReset,"aria-label":e.text.resetLabel,style:{position:"absolute",top:0,right:0,height:24,padding:"0 10px",borderRadius:12,border:`1px solid ${t.paint("line")}`,background:t.paint("panel"),color:t.paint("muted"),fontSize:11.5,fontWeight:600,zIndex:4},children:e.text.reset})}var te=D(Z(),1);function $i(e,t){let n=_e(e.theme),[r,o,a]=pn(e.width),i=bt(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,h=bn(e.reducedMotion??"auto"),u=e.animate!==!1&&!h&&Fe,m=ti(r,e.animateOnView!==!1&&u),g=be(e.locale),d=q(g),p=(0,te.useMemo)(()=>ot(e.format,g,t.format),[e.format,g,t.format]),C=(0,te.useCallback)(X=>Ut(X,{locale:g}),[g]),x=(0,te.useMemo)(()=>ft(p,e.unit),[p,e.unit]),S=(0,te.useMemo)(()=>cn(e.data),[e.data]),[$,P]=(0,te.useState)(null),[y,F]=(0,te.useState)(null),z=(0,te.useRef)([]),I=(0,te.useRef)(e.onHover);I.current=e.onHover;let E=(0,te.useRef)(e.onClick);E.current=e.onClick;let B=(0,te.useRef)(null),v=(0,te.useRef)(null),M=(0,te.useRef)(null),A=(0,te.useCallback)((X,se="pointer")=>{if(M.current!==X){M.current=X;let Y=X===null?null:z.current[X]??null;queueMicrotask(()=>I.current?.(Y)),v.current?.(X)}B.current=X===null?null:se,P(X),F(B.current)},[]),w=(0,te.useCallback)(X=>{B.current!=="keyboard"&&(B.current=X===null?null:"sync",P(X),F(B.current))},[]),N=(0,te.useCallback)(X=>{let se=z.current[X];se&&E.current?.(se)},[]),O=ko(e.replayKey),G=e.width!==void 0||(a??0)>0,fe={enabled:u,active:m.visible&&G,near:m.near,replayKey:O,dataKey:S,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},We=(0,te.useCallback)((X,se=1)=>$===null||$===X?se:se*.38,[$]);return{p:n,width:s,height:c,measured:G,responsive:e.width===void 0,pending:Fe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:fe,fv:x,fmt:p,pct:C,locale:g,lang:d,t:d==="ko"?qr:Zr,active:$,via:y,setActive:A,click:N,events:z,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:We,sig:S,description:e.description,reduced:h,publish:v,applySync:w}}var Q=D(Z(),1);function vl(e){return 1-Math.pow(1-e,3)}function $l(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Ml(e){return e==="easeInOut"?$l:e==="linear"?t=>t:vl}function Tl(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 xt(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function yn(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 Mi(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 Ti(e,t,n,r){if(!t||!n||t.length!==n.length)return xt(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let l of xt(s,n[i]))o.push(l)}return o.length===r?o:xt(e,r)}var xn=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||!yn(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Mi(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=yn(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=Ti(s.cur,s.parts,i.parts,c),s.vel=Ti(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),Mi(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=yn(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=yn(c.from,c.to),this.tracks.set(i.key,c)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=xt(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Ml(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=xt(s.from,c)),s.vel.length!==c&&(s.vel=xt(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let u=Math.exp(-a*l),m=a*l>=8&&a*l<20,g=0;for(let d=0;d<c;d++){let p=s.from[d]-s.to[d],C=s.vel[d]+a*p;s.cur[d]=s.to[d]+(p+C*l)*u,s.curVel[d]=(s.vel[d]-a*C*l)*u,m&&g<.15&&(g=Math.max(g,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/a)))}h=a*l>=20||m&&g<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),m=r(u),g=Tl(this.easing,u)/o;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*m,s.curVel[d]=(s.to[d]-s.from[d])*g;h=u>=1,s.progress=m}if(h){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},_t=new Set,kn=0;function Ci(e){kn=0;let t=Array.from(_t);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||_t.delete(n)}_t.size&&typeof requestAnimationFrame<"u"&&(kn=requestAnimationFrame(Ci))}function Si(e){return _t.add(e),!kn&&typeof requestAnimationFrame<"u"&&(kn=requestAnimationFrame(Ci)),()=>{_t.delete(e)}}function Cl(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 Ai(e,t){let n=(0,Q.useMemo)(()=>Cl(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:h=0}=t,u=(0,Q.useRef)(null),m=(0,Q.useRef)("init"),g=(0,Q.useRef)(null),d=(0,Q.useRef)(s),p=(0,Q.useRef)(i),C=(0,Q.useRef)(!1),x=(0,Q.useRef)(0),[,S]=(0,Q.useState)(0),$=(0,Q.useRef)(null),P=(0,Q.useRef)(!0);u.current||(u.current=new xn,u.current.configure(l,c),u.current.snap(n),g.current=n);let y=u.current;if(y.configure(l,c),g.current!==n){let v=m.current,M=!Object.is(d.current,s);y.sameTargets(n)?y.refreshData(n):!r||v==="init"?y.snap(n):v==="idle"?y.hold(n):v==="running"||M?y.update(n,Wt(),h):y.snap(n),g.current=n,d.current=s}let F=(0,Q.useRef)(()=>!1);F.current=v=>{if(!P.current)return!1;let M=y.step(v);return!M&&m.current==="running"&&(m.current="done"),S(A=>(A+1)%1e9),M||($.current=null),M};let z=(0,Q.useCallback)(()=>{if(!Fe||$.current||!y.animating)return;let v=M=>F.current(M);$.current=Si(v)},[y]);Ee(()=>{let v=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||y.animating)&&(y.snap(g.current??n),m.current="done",S(M=>M+1));return}m.current==="init"||v&&a?(y.hold(g.current??n),m.current="idle",C.current=!1,S(M=>M+1)):v&&(C.current=!0)},[r,i]),Ee(()=>{!r||!a||!C.current||(C.current=!1,y.hold(g.current??n),m.current="idle",S(v=>v+1))},[a,r]),(0,Q.useEffect)(()=>{r&&o&&m.current==="idle"&&(y.start(Wt()),x.current+=1,m.current="running",z(),S(v=>v+1))},[r,o,i,y,z]),(0,Q.useEffect)(()=>{y.animating&&z()}),(0,Q.useEffect)(()=>(P.current=!0,()=>{P.current=!1,$.current?.(),$.current=null}),[]);let I=Wt(),E=y.elapsed(I),B=r&&m.current==="idle";return{items:y.items(),get:v=>y.get(v),elapsed:B?0:E,fade:(v,M=320)=>B?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-v)/M)):1,waiting:B,animating:y.animating,generation:x.current}}var fr=D(H(),1);function Ni(e,t,n,r,o){if(r)return o==="categorical"?he(e,t,n):ao(e,t,n);if(o==="categorical")return he(e,t,n);let a=ee(e,"strong"),i=ee(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var Sl=D(Z(),1);var hr=D(H(),1);var Fi=e=>e?"neutralStrong":"accent";var gr=D(H(),1);function Pi(e,t,n,r){if(typeof e!="function")return Oe(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var Al=D(Z(),1);var br=D(H(),1),Rl={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}, ${Be(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},_i={en:Rl,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}일 이동평균`}},pr=["ink","muted","dim"];function Di(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,pr.length)}var Nl=D(Z(),1);var zi=D(H(),1),Fl={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Be(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Pl={en:Fl,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Li=(e,t)=>Pl[e].other(t);function Ei(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,Oo(o.map(a=>a.value)))}}var Oi=e=>Number.isFinite(e)&&e>0?e:0;function Ii(e,t,n,r){return r==="emphasis"?io(e,t,n):he(e,t,n)}var _l=D(Z(),1);var Gi=D(H(),1);function Bi(e,t){return t===!1?e.map((n,r)=>r):Eo(e)}function Hi(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return Oe(e,t,t,r,"max")}function ji(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=ee(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?ee(e,"neutral"):Xt(e,1-i/Math.max(1,o.length-1))),r}function Vi(e){return!e||typeof e!="object"||Array.isArray(e)?[]:De(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Wi(e,t){return Tt(e,t+1,new Set)}var V=D(Z(),1);var K=D(H(),1),Dl={kind:"Timeline",start:"Start",end:"End",at:"At",duration:"Duration",status:"Status",group:"Group",open:"open",now:"Now",range:(e,t)=>`${e} to ${t}`,desc:(e,t,n,r)=>`${Be(e,"item")} on ${Be(t,"row")}, from ${n} to ${r}`,longest:(e,t)=>`Longest: ${e}, ${t}`,lines:"Reference lines",strip:(e,t)=>`Status strip: ${e}${t?`, and ${t} more`:""}.`},Ll={en:Dl,ko:{kind:"타임라인",start:"시작",end:"끝",at:"시각",duration:"걸린 시간",status:"상태",group:"묶음",open:"진행 중",now:"지금",range:(e,t)=>`${e}~${t}`,desc:(e,t,n,r)=>`항목 ${e}개, 줄 ${t}개, ${n}부터 ${r}까지`,longest:(e,t)=>`가장 긴 항목은 ${e}, ${t}`,lines:"기준선",strip:(e,t)=>`상태 띠: ${e}${t?` 외 ${t}개`:""}.`}},Lt=26,El=520,Ol=2,Ki=22,Dt=11.5,Xi=13,Il=14,Ge=11,Ui=7,Yi=.28,wn=3,yr=600,xr=6,kr=Lt*.62;function zl(e,t,n,r){let o=(t-e)/Math.max(1,n);if(t>e&&o>st*30.44*6){let c=new Date(e).getFullYear(),h=new Date(t).getFullYear()-c,u=[1,2,5,10,20,50,100,200,500,1e3].find(g=>h/g<=n)??1e3,m=[];for(let g=Math.ceil(c/u)*u,d=0;d<500;g+=u,d++){let p=new Date(g,0,1).getTime();if(p>t)break;p>=e&&m.push({t:p,label:He(p,{locale:r,year:"numeric"})})}if(m.length>=2)return m}let a=[1,2,5,10,15,30,60,120,300,600,900,1800].map(c=>c*1e3).find(c=>c>=o);if(!(t>e)||a===void 0)return fn(e,t,n,r);let i=a<6e4?{hour:"numeric",minute:"2-digit",second:"2-digit"}:{hour:"numeric",minute:"2-digit"},s=new Date(e).getTimezoneOffset()*6e4,l=[];for(let c=Math.ceil((e-s)/a)*a+s,h=0;c<=t&&h<500;c+=a,h++)l.push({t:c,label:He(c,{locale:r,...i})});return l}function vn(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!ri.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}function Ji(e,t,n=!1){let r=0,o=e.length;for(;r<o;){let a=r+o>>1;(n?e[a]<=t:e[a]<t)?r=a+1:o=a}return r}function $n(e){let t=(0,V.useMemo)(()=>gi(e.data,{label:e.label,start:e.start,end:e.end,group:e.group,status:e.status},{xType:e.xType,dayFirst:e.dayFirst,now:e.now}),[e.data,e.label,e.start,e.end,e.group,e.status,e.xType,e.dayFirst,e.now]),{items:n,kind:r,dateOnly:o}=t,a=e.sort==="start"||e.sort==="duration"?e.sort:"none",{rows:i,lane:s}=(0,V.useMemo)(()=>bi(n,a),[n,a]),l=i.reduce((f,k)=>f+k.lanes,0),c=e.statusStrip===!0&&e.status!==void 0&&n.some(f=>f.status!==""),h=c?xr+Lt:0,u=Array.isArray(e.referenceLines)?e.referenceLines:[],m=u.length>0||e.now!==void 0?24:6,g=$i(e,{height:()=>m+Ki+h+Math.max(40,Math.min(l*Lt,El),l*Ol),duration:700,stagger:40}),{p:d,width:p,height:C,locale:x,fv:S}=g,$=Ll[g.lang],P=ki(g.sig),y=(0,V.useMemo)(()=>i.flatMap(f=>f.items),[i]),F=e.group===void 0,z=F?e.status:e.group,I=f=>F?f.status:f.group,E=(0,V.useMemo)(()=>z===void 0?[]:Pt(e.data,z,F),[e.data,z,F]),B=(0,V.useMemo)(()=>new Map(E.map((f,k)=>[f,k])),[E]),v=e.highlight,M=(0,V.useMemo)(()=>vn(v,E),[v,E]),A=E.length>0&&!(c&&F),w=(0,V.useMemo)(()=>{let f=y.map(R=>n[R].end-n[R].start),k=Oe(v,y.map(R=>n[R].datum),y.map(R=>n[R].label),f,A?"none":"max"),T=new Set([...k].map(R=>y[R]));return M.size&&n.forEach((R,_)=>M.has(B.get(I(R))??-1)&&T.add(_)),T},[v,y,n,A,B,M,F]),N=(0,V.useMemo)(()=>E.length?he(d,E.length,M):null,[d,E,M]),O=A?N:null,G=(0,V.useMemo)(()=>c?F?E:Pt(e.data,e.status,!0):[],[c,F,E,e.data,e.status]),fe=(0,V.useMemo)(()=>c?F&&N?N:he(d,G.length,vn(v,G)):[],[c,F,N,d,G,v]),We=(0,V.useMemo)(()=>new Map(G.map((f,k)=>[f,k])),[G]),X=Array.isArray(e.hidden)?e.hidden.join(""):"",se=(0,V.useMemo)(()=>new Set(E.length&&X?X.split(""):[]),[E.length,X]),Y=(0,V.useMemo)(()=>Array.from(new Set(n.flatMap(f=>[f.start,f.end]))).sort((f,k)=>f-k),[n]),ge=Y.length?Y[0]:0,Ke=Y.length?Y[Y.length-1]:1,vr=(0,V.useMemo)(()=>pi(t),[t]),Ot=P.view&&Y[P.view[1]]>Y[P.view[0]]?P.view:null,ce=Ot?Y[Ot[0]]:vr[0],ue=Ot?Y[Ot[1]]:vr[1],$r=(0,V.useMemo)(()=>{if(o)return new Date(ge).getFullYear()===new Date(Ke).getFullYear()?{month:"short",day:"numeric"}:{year:"numeric",month:"short",day:"numeric"};let f={hour:"numeric",minute:"2-digit",...t.hasSeconds?{second:"2-digit"}:{}};return Ke-ge<st*1.5?f:{month:"short",day:"numeric",...f}},[o,t.hasSeconds,ge,Ke]),ne=f=>r==="number"?S(f):He(f,{locale:x,...$r}),Mr=f=>r==="number"?S(f):po(o?Math.round(f/st)*st:f,x),Qe=(0,V.useMemo)(()=>{let f=n.map(k=>Mr(k.end-k.start));return{text:f,w:f.map(k=>oe(k,Ge,600)),wHi:f.map(k=>oe(k,Ge,800))}},[n,r,o,S,x]),Mn=c?$.status:"",ta=(0,V.useMemo)(()=>i.reduce((f,k)=>Math.max(f,oe(k.label,Dt,700)),Math.max(24,Mn?oe(Mn,Dt,700):0)),[i,Mn]),kt=Math.min(p*.32,ta+10),Se=kt+10,Ae=Math.max(Se+10,p-16),et=C-Ki,Tn=et-h,tt=Tn+xr+Lt/2,we=(Tn-m)/Math.max(1,l),wt=we>=6?Math.min(18,Math.max(4,we*.62)):Math.max(1,we*.8),re=St([ce,ue],[Se+Ui,Ae-Ui]),It=(0,V.useMemo)(()=>{let f=new Int32Array(n.length);return i.forEach((k,T)=>k.items.forEach(R=>f[R]=T)),f},[i,n.length]),Tr=f=>m+(i[It[f]].lane0+s[f]+.5)*we,ie=(0,V.useMemo)(()=>y.filter(f=>!se.has(I(n[f]))&&n[f].end>=ce&&n[f].start<=ue),[y,se,n,ce,ue,F]),nt=(0,V.useMemo)(()=>new Map(ie.map((f,k)=>[f,k])),[ie]),Ie=(0,V.useMemo)(()=>c?yi(n,ie):null,[c,n,ie]),zt=g.motion.stagger??40,Cn=g.showLabels&&we>=Il,Sn=(0,V.useMemo)(()=>{let f=new Map;return ie.map((k,T)=>{let R=n[k],_=(f.get(R.label)??0)+1;f.set(R.label,_);let j=Math.max(Se,Math.min(Ae,re(R.start))),ae=R.point?j:Math.max(j+wn,Math.min(Ae,re(R.end))),J=Tr(k);return{key:`${R.label}${_}`,to:[j,ae,1,J],from:[j,j,0,J],delay:Math.min(T*zt,yr),data:k}})},[ie,n,i,It,s,Se,Ae,ce,ue,m,we,zt]),An=Ai(Sn,g.motion),na=(0,V.useMemo)(()=>{let f=new Map;if(!Cn||c)return f;for(let k of Sn){let T=n[k.data];if(!T.status)continue;let R=T.point?T.status:at(T.status,Math.max(1,k.to[1]-k.to[0])-12,Ge,600);f.set(k.data,{text:R,w:oe(R,Ge,600)})}return f},[Sn,n,Cn,c]),Cr=f=>{let k=B.get(I(n[f]));return O&&k!==void 0?O[k]:ee(d,!O&&w.has(f)?"accent":"neutral")},Sr=(0,V.useMemo)(()=>{let f=new Float64Array(n.length).fill(p-2);for(let k of i){let T=new Map;for(let R of k.items){if(se.has(I(n[R])))continue;let _=T.get(s[R]);_!==void 0&&(f[_]=re(n[R].start)),T.set(s[R],R)}}return f},[i,n,s,se,p,Se,Ae,ce,ue,F]),Ar=(0,V.useMemo)(()=>ie.map((f,k)=>{let T=n[f],R=T.point?ne(T.start):`${$.range(ne(T.start),ne(T.end))}, ${Qe.text[f]}`;return{datum:T.datum,index:k,key:`${T.label}#${T.i}`,label:T.label,value:T.end-T.start,...T.group&&{series:T.group},formatted:`${R}${T.status?`, ${T.status}`:""}`}}),[ie,n,$,Qe,S,x,$r,r]),{b0:Rr,visB:ze,visX:ra}=(0,V.useMemo)(()=>{let f=Ji(Y,ce),k=Y.slice(f,Math.max(f,Ji(Y,ue,!0)));return{b0:f,visB:k,visX:k.map(T=>re(T))}},[Y,ce,ue,Se,Ae]),pe=g.active!==null?ie[g.active]:void 0,{brush:Xe,frame:Bt,hint:oa}=wi({brush:e.brush?"zoom":!1,onBrush:e.onBrush},P,{p:d,active:pe===void 0?null:Math.max(0,ir(ze,n[pe].start)),lang:g.lang,count:ze.length,indexAt:f=>ir(ra,f),inPlot:(f,k)=>f>=Se-4&&f<=Ae+4&&k>=m&&k<=et,toXRange:f=>({from:Rr+f.from,to:Rr+f.to,fromKey:String(ze[f.from]),toKey:String(ze[f.to]),fromLabel:ne(ze[f.from]),toLabel:ne(ze[f.to])})}),ia=(f,k)=>{if(Ie&&k>=Tn+xr/2&&k<=et){let U=Ie.points.find(Ne=>Math.abs(re(n[Ne].start)-f)<=6);if(U!==void 0)return nt.get(U)??null;let me=re.invert(f),Re=Ie.pieces.find(Ne=>Ne.t0<=me&&me<Ne.t1);return Re?nt.get(Re.k)??null:null}let T=Math.floor((k-m)/we);if(T<0||T>=l)return null;let R=0,_=i.length-1;for(;R<_;){let U=R+_+1>>1;i[U].lane0<=T?R=U:_=U-1}let j=i[R],ae=null,J=10;for(let U of j.items){let me=nt.get(U);if(me===void 0||s[U]!==T-j.lane0)continue;let Re=re(n[U].start),Ne=Math.max(0,Re-f,f-Math.max(re(n[U].end),n[U].point?Re:Re+wn));(Ne<J||Ne===0&&J===0)&&(J=Ne,ae=me)}return ae},aa=f=>{if(Bt.onKey?.(f))return!0;if(f.key!=="ArrowUp"&&f.key!=="ArrowDown"&&f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return!1;if(!ie.length)return!0;if(pe===void 0)return g.setActive(f.key==="ArrowUp"||f.key==="ArrowLeft"?ie.length-1:0,"keyboard"),!0;let k=It[pe],T=_=>i[_].items.filter(j=>nt.has(j));if(f.key==="ArrowLeft"||f.key==="ArrowRight"){let _=T(k),j=_[_.indexOf(pe)+(f.key==="ArrowRight"?1:-1)];return j!==void 0&&g.setActive(nt.get(j),"keyboard"),!0}let R=f.key==="ArrowDown"?1:-1;for(let _=k+R;_>=0&&_<i.length;_+=R){let j=T(_);if(!j.length)continue;let ae=n[pe].start,J=j.reduce((U,me)=>Math.abs(n[me].start-ae)<Math.abs(n[U].start-ae)?me:U,j[0]);g.setActive(nt.get(J),"keyboard");break}return!0},Nr=null,Rn="";if(pe!==void 0&&!Xe.dragging){let f=n[pe],k=Cr(pe),T=f.point?[{label:$.at,value:ne(f.start),color:k.fill}]:[{label:$.start,value:ne(f.start),strong:!1},{label:$.end,value:f.open?`${ne(f.end)} (${$.open})`:ne(f.end),strong:!1},{label:$.duration,value:Qe.text[pe],color:k.fill}];f.group&&T.push({label:$.group,value:f.group,strong:!1}),f.status&&T.push({label:$.status,value:f.status,strong:!1});let R=Math.max(Se,re(f.start)),_=Math.max(R+(f.point?0:wn),Math.min(Ae,re(f.end)));Nr={x:(R+_)/2,y:Tr(pe)-wt/2,title:f.label,rows:T},g.via==="keyboard"&&(Rn=`${f.label}, ${Ar[g.active].formatted}`)}let Fr=null;if(Xe.range&&Xe.range.to<ze.length){let f=ze[Xe.range.from],k=ze[Xe.range.to],T=Mr(k-f);Fr=(0,K.jsx)(vi,{p:d,x0:re(f),x1:re(k),top:m,bottom:et,width:p,main:T,sub:$.range(ne(f),ne(k)),dragging:Xe.dragging}),Xe.dragging||(Rn=`${$.range(ne(f),ne(k))}, ${T}.${oa}`)}let Nn=Math.max(2,Math.floor((Ae-Se)/(r==="number"?70:64))),Pr=e.format,_r=e.unit,sa=(0,V.useMemo)(()=>{let f=ft(Yt(Pr,x,Math.max(Math.abs(ce),Math.abs(ue))),_r);return Vo(r==="number"?re.ticks(Nn).map(k=>({x:re(k),label:f(k)})):zl(ce,ue,Nn,x).map(k=>({x:re(k.t),label:k.label})),-2,p+2)},[r,Nn,ce,ue,Se,Ae,p,Pr,_r,x]),Fn=[...u.map(f=>({t:t.read(f?.x),label:typeof f?.label=="string"?f.label:"",now:!1})),...e.now!==void 0?[{t:t.read(e.now),label:$.now,now:!0}]:[]].filter(f=>Number.isFinite(f.t)&&f.t>=ce&&f.t<=ue),Dr=[],la=Fn.map((f,k)=>{let T=re(f.t),R=f.label?at(f.label,140,10.5,f.now?700:500):"",_=T+dn(R,0,0,"start",f.now).w+2>p,j=R?dn(R,_?T-3:T+3,m-14,_?"end":"start",f.now):null,ae=j!==null&&j.x>=0&&!Dr.some(J=>Bo(j,J,4));return ae&&Dr.push(j),(0,K.jsxs)("g",{children:[(0,K.jsx)("line",{x1:T,x2:T,y1:m-(ae?14:2),y2:et,stroke:d.paint(f.now?"ink":"dim"),strokeOpacity:f.now?.55:1,strokeDasharray:f.now?"2 3":"4 3"}),ae?(0,K.jsx)(jo,{p:d,x:_?T-3:T+3,y:m-14,text:R,anchor:_?"end":"start",strong:f.now}):null]},k)}),Lr=pe===void 0?-1:It[pe],ca=(0,V.useMemo)(()=>{let f=i.reduce((_,j)=>Math.min(_,j.lanes),1/0),k=Math.max(1,Math.ceil(Xi/Math.max(.01,Math.min(f*we,Lt)))),T=i.some(_=>_.lanes>1),R=-1/0;return i.map((_,j)=>{let ae=m+(_.lane0+_.lanes/2)*we,J=j%k===0&&ae-R>=Xi;J&&(R=ae);let U=j===Lr||_.items.some(me=>w.has(me));return(0,K.jsxs)("g",{children:[T&&j?(0,K.jsx)("line",{x1:0,x2:p,y1:m+_.lane0*we,y2:m+_.lane0*we,stroke:d.paint("line"),opacity:.7}):null,J?(0,K.jsx)(xe,{x:kt,y:ae,anchor:"end",size:Dt,weight:U?700:600,fill:d.paint(U?"ink":"muted"),children:at(_.label,kt-4,Dt,700)}):null]},j)})},[i,we,m,kt,p,d,w,Lr]),Er=g.motion.duration??700,ua=Math.min(d.theme.radiusMark,wt/2),Ht=(0,V.useMemo)(()=>ie.length?ie[un(ie.map(f=>n[f].end-n[f].start))]:-1,[ie,n]),ma=Fn.length?` ${$.lines}: ${Fn.map(f=>`${f.label?`${f.label} `:""}${ne(f.t)}`).join(", ")}.`:"",Or="";if(Ie){let f=[...Ie.spans.map(k=>({t:k.t0,text:`${k.status} ${$.range(ne(k.t0),ne(k.t1))}`})),...Ie.points.map(k=>({t:n[k].start,text:`${n[k].status} ${ne(n[k].start)}`}))].sort((k,T)=>k.t-T.t);f.length&&(Or=` ${$.strip(f.slice(0,8).map(k=>k.text).join(", "),Math.max(0,f.length-8))}`)}let da=e.description??(ie.length?`${$.kind}. ${$.desc(ie.length,i.length,ne(ce>ge?ce:ge),ne(ue<Ke?ue:Ke))}. ${Ht>=0&&!n[Ht].point?`${$.longest(n[Ht].label,Qe.text[Ht])}.`:""}${ma}${Or}`.trim():"");return(0,K.jsxs)(vo,{c:g,kind:$.kind,ariaLabel:e.ariaLabel,description:da,events:Ar,tip:Nr,renderTip:e.tooltip,announce:Rn||void 0,className:e.className,style:e.style,theme:e.theme,onPointerDown:Bt.onPointerDown,onPointerUp:Bt.onPointerUp,overlay:Bt.overlay,onPointerMove:(f,k,T)=>{if(Xe.move(f))return;let R=ia(f,k);R!==g.active&&g.setActive(R,T.pointerType==="touch"?"touch":"pointer")},onKey:aa,children:[(0,K.jsxs)("g",{"aria-hidden":"true",children:[sa.map((f,k)=>(0,K.jsxs)("g",{children:[(0,K.jsx)("line",{x1:f.x,x2:f.x,y1:m,y2:et,stroke:d.paint("line")}),(0,K.jsx)(xe,{x:f.x,y:et+12,anchor:"middle",size:pt,fill:d.paint("muted"),children:f.label})]},k)),ca]}),An.items.map(f=>{if(f.exiting)return null;let k=f.data,T=nt.get(k);if(T===void 0)return null;let R=n[k],[_,j,ae,J]=f.v,U=Cr(k),me=w.has(k),Re=g.active===T&&g.via==="keyboard"||O!==null&&me&&!M.has(B.get(I(R))??-1),Ne=g.dim(T)*Math.min(1,ae*1.5),Pn=An.fade(Math.min(T*zt,yr)+Er*.4,260),vt=na.get(k);if(R.point){let ct=Math.max(3,Math.min(wt,12)/2+1);return(0,K.jsxs)("g",{opacity:Ne,children:[(0,K.jsx)("path",{d:`M${_} ${J-ct}L${_+ct} ${J}L${_} ${J+ct}L${_-ct} ${J}Z`,fill:U.fill,stroke:d.paint(Re?"ink":"panel"),strokeWidth:Re?2:1,className:"ztd-mark",onClick:()=>g.click(T)}),vt&&_+ct+6+vt.w<Sr[k]-4?(0,K.jsx)(xe,{x:_+ct+6,y:J,size:Ge,weight:600,fill:d.paint("muted"),opacity:Pn,children:vt.text}):null]},f.key)}let $t=Math.max(1,j-_),_n=Cn?Qe.text[k]:"",Ir=me?Qe.wHi[k]:Qe.w[k],jt=_n&&_+$t+6+Ir<Sr[k]-4,zr=_n&&!jt&&(c||!R.status)&&Ir+12<=$t;return(0,K.jsxs)("g",{opacity:Ne,children:[(0,K.jsx)("rect",{x:_,y:J-wt/2,width:$t,height:wt,rx:ua,fill:U.fill,fillOpacity:R.open?Yi:1,stroke:Re?d.paint("ink"):R.open?U.fill:"none",strokeWidth:Re?2:1,strokeDasharray:R.open?"3 2":void 0,className:"ztd-mark",onClick:()=>g.click(T)}),vt?.text?(0,K.jsx)(xe,{x:_+6,y:J,size:Ge,weight:600,fill:R.open?d.paint("ink"):U.text,opacity:Pn,children:vt.text}):null,jt||zr?(0,K.jsx)(xe,{x:jt?_+$t+6:_+$t-6,y:J,anchor:jt?"start":"end",size:Ge,weight:me?800:600,fill:zr?R.open?d.paint("ink"):U.text:d.paint(me?"ink":"muted"),opacity:Pn,children:_n}):null]},f.key)}),Ie?(0,K.jsxs)("g",{className:"ztd-strip","aria-hidden":"true",opacity:An.fade(Math.min(ie.length*zt,yr)+Er*.4,260),children:[(0,K.jsx)(xe,{x:kt,y:tt,anchor:"end",size:Dt,weight:600,fill:d.paint("muted"),children:$.status}),Ie.spans.map((f,k)=>{if(f.t1<ce||f.t0>ue)return null;let T=Math.max(Se,re(f.t0)),R=Math.max(wn,Math.min(Ae,re(f.t1))-T-2),_=fe[We.get(f.status)??0],j=g.showLabels?at(f.status,R-12,Ge,600):"";return(0,K.jsxs)("g",{children:[(0,K.jsx)("rect",{x:T,y:tt-kr/2,width:R,height:kr,rx:Math.min(d.theme.radiusMark,kr/2),fill:_.fill,fillOpacity:f.open?Yi:1,stroke:f.open?_.fill:"none",strokeDasharray:f.open?"3 2":void 0}),j?(0,K.jsx)(xe,{x:T+R/2,y:tt,anchor:"middle",size:Ge,weight:600,fill:f.open?d.paint("ink"):_.text,children:j}):null]},k)}),Ie.points.map(f=>{let k=n[f].start;if(k<ce||k>ue)return null;let T=re(k),R=7;return(0,K.jsx)("path",{d:`M${T} ${tt-R}L${T+R} ${tt}L${T} ${tt+R}L${T-R} ${tt}Z`,fill:fe[We.get(n[f].status)??0].fill,stroke:d.paint("panel")},`p${f}`)})]}):null,(0,K.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:la}),Fr]})}var Ve=D(H(),1);function Zi(e,t,n){let r=sn(e);return r?.type==="scatter"&&t?.size!==void 0&&!an(n)?sn("bubble"):r}function Bl(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Hl(e,t,n,r=!1){let o=Zi(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&tr.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(h.includes(o.type)){let u=Me(a.label,"label"),m=ln(a.value,"value"),g=o.type==="waffle",d=t.map((y,F)=>({r:y,label:u(y,F),value:g?m(y,F):Oi(m(y,F))})),{kept:p,other:C}=g?{kept:d,other:null}:Ei(d,i.other,(y,F)=>({r:{},label:Li(q(n),y),value:F})),x=Oe(s,p.map(y=>y.r),p.map(y=>y.label),p.map(y=>y.value),g?"first":"max"),S=C?[...p,C]:p,$=Ye(y=>g?he(y,S.length,x):Ii(y,S.length,x,i.colorMode)),P=g&&i.shape==="arc";return S.map((y,F)=>({label:y.label,color:$[F],...P&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Di(Array.isArray(i.ma)?i.ma:void 0,t.length),m=_i[q(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((g,d)=>({label:m.maLegend(g),color:pr[d],shape:"line"}))]}if(o.type==="network"){let u=Vi(i.groups);if(u.length<2)return[];let m=Ye(g=>Wi(g,u.length));return u.map((g,d)=>({label:g,color:m[d],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=Me(a.group,"group"),m=De(t.map((d,p)=>u(d,p)).filter(Boolean));if(m.length<2)return[];let g=Ye(d=>Tt(d,m.length,new Set));return m.map((d,p)=>({label:d,color:g[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||an(i))return[];let u=Me(a.series,"series"),m=De(t.map((p,C)=>u(p,C)));if(m.length<2)return[];let g=Pi(s,t,m,u),d=Ye(p=>Tt(p,m.length,g));return c(m.map((p,C)=>({label:p,color:d[C],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",m=u?a.status:a.group;if(typeof m!="string")return[];let g=Pt(t,m,u),d=Ye(p=>he(p,g.length,vn(s,g)));return c(g.map((p,C)=>({label:p,color:d[C],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let $=Me(a.series,"series");u=De(t.map((P,y)=>$(P,y)))}let m=nr(o.type,a,i);if(m.length){let $=Oe(s,u,u,u.map(()=>0),"none"),P=Ye(F=>he(F,u.length,$)),y=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((F,z)=>({label:F,color:P[z]}));return[...c(y),...m.map((F,z)=>({label:F,color:Fi(z),shape:"line"}))]}if(u.length<2)return[];let d=o.type==="bar"&&i.layout==="diverging"&&s===void 0?Lo(u.length,Array.isArray(i.negative)?i.negative.map($=>u.indexOf(String($))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=d>=0?new Set([d]):Oe(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map(($,P)=>({label:$,color:p.has(P)?"accent":"neutralStrong",shape:"square"})));let C=i.colorMode,x=$=>he($,u.length,p);if((o.type==="line"||o.type==="area")&&(x=$=>Ni($,u.length,p,o.type==="area",C)),o.type==="stream"){let $=Rt(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),P=Bi($.values,i.reorder),y=Hi(s,$.series,$.values);x=F=>ji(F,P,y)}let S=Ye(x);return c(u.map(($,P)=>({label:$,color:S[P],...o.type==="line"&&{shape:"line"}})))}return[]}function jl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&So.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Gl(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...h}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:h,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function qi(e,t){let{spec:n}=e,r=Zi(n.type,n.encoding,n.options),o=(0,Et.useMemo)(()=>xi(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Co(n,e.locale),s=be(i),l=q(s),c=oi(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),h=No(n),u=(0,Et.useMemo)(()=>h?mi(h,s):void 0,[h,s]),m=n.options?.hidden,g=Array.isArray(m)?m.map(String):[],d=g.join(""),[p,C]=(0,Et.useState)(null);if(!r)return(0,Ve.jsx)(er,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=o??c.data,S=t[r.type],$={...n.options??{}},P={...Bl(r,n.encoding),...$,...u?{tooltip:u}:{},data:x,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},y=n.card?.legend==="toggle"&&Ro(r.type,n.encoding??{},$),F=p&&p.base===d?p.hidden:g;y&&(P.hidden=F);let z=M=>C(A=>{let w=A&&A.base===d?A.hidden:g;return{base:d,hidden:w.includes(M)?w.filter(N=>N!==M):[...w,M]}}),I=P.height??220,E=jl(n,r.type),B=a&&!x.length&&(c.loading||c.error||c.empty)?(0,Ve.jsx)(er,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:I,locale:i}):E?(0,Ve.jsx)(ni,{chart:S,...Gl(r.type,E,P)}):(0,Ve.jsx)(S,{...P});if(n.card){let M=n.card,A=M.legend==="auto"||M.legend==="toggle"?Hl(n,x,s,y):M.legend,w=A?.length?y?(0,Ve.jsx)(Qn,{items:A,hidden:F,onToggle:z,locale:i}):A:void 0,N=M.download?(0,Ve.jsx)(ui,{data:x,columns:Fo(n),filename:M.title??r.type,formats:Array.isArray(M.download)?M.download:void 0,locale:i}):void 0;B=(0,Ve.jsx)(wo,{number:M.number,title:M.title??To(r,l),subtitle:M.subtitle,legend:w,actions:N,source:M.source||void 0,note:M.note||void 0,accent:M.accent,takeaway:M.takeaway,level:M.level,sample:M.sample,replay:M.replay!==!1,className:e.className,locale:i,children:B})}let v=e.theme??n.theme;return v&&(B=(0,Ve.jsx)(en,{theme:v,children:B})),B}function Vl({cfg:e,components:t}){let n=bt();return qi({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ea(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Qi.hydrateRoot)(r,(0,wr.createElement)(en,{theme:o.theme,cssVars:!0},(0,wr.createElement)(Vl,{cfg:o,components:{[e]:t}})))}ea("timeline",$n);})();
27
+ `}function yl(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function ur(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var ai=2,qe=16;function si(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function li(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 ci(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,l]=[a+qe*2,i+qe*2],c=o.cloneNode(!0),h=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,p)=>{let C;for(let x of Array.from(d.attributes)){if(!gl.test(x.value))continue;let S=(C??(C=getComputedStyle(d))).getPropertyValue(x.name);S&&h[p].setAttribute(x.name,si(S,u))}}),c.removeAttribute("style");for(let[d,p]of Object.entries({viewBox:`${-qe} ${-qe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(d,String(p));let m=si(getComputedStyle(r).backgroundColor,u),g=o.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(li("rect",{x:-qe,y:-qe,width:s,height:l,fill:m}),d),g&&c.insertBefore(li("image",{href:g.toDataURL(),width:a,height:i}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:m,canvas:g}}function xl(e,t){let n=ci(e,ai,!1);if(!n)return;let r=ai,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,qe*r,qe*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(l=>l&&ur(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function ui(e){let t=Pe(e.theme),n=q(be(e.locale))==="ko",r=yl(e.filename),o=(a,i)=>{if(a==="csv")return ur(new Blob([bl(e.data,e.columns?.length?e.columns:pl(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return xl(i,r);let s=ci(i,1,!0);s&&ur(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,mr.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:fl.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,mr.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,l.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var di=D(H(),1);function mi(e,t=de){let n=ot(void 0,t),r=e.split(`
28
+ `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?He(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(go,(h,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,di.jsx)("div",{children:s},l)):null}}var hi=e=>e==null||e==="";function dr(e){if(hi(e))return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"x":"d";if(typeof e=="number")return Number.isFinite(e)?"n":"x";if(typeof e=="string"){let t=e.trim();return Zt(t)?"d":Number.isFinite($e(t))?"n":t?"x":""}return"x"}function gi(e,t,n={}){let r=Te(t.label,"label"),o=je(t.start,"start"),a=je(t.end,"end"),i=t.group===void 0?null:Te(t.group,"group"),s=t.status===void 0?null:Te(t.status,"status"),l=e.map((v,T)=>o(v,T)),c=e.map((v,T)=>a(v,T)),h=l.concat(c),u=n.xType,m=0,g=0;if(!u){for(let v of h){let T=dr(v);T==="d"?m++:T==="n"&&g++}u=m>g?"date":"number"}let d=!n.xType,p=u==="date"?n.dayFirst??qt(h):void 0,C=u==="date"?"d":"n",x=v=>d&&dr(v)!==C?NaN:u==="date"?ht(v,p)?.getTime()??NaN:$e(v),S=v=>d&&dr(v)===(C==="d"?"n":"d"),$={swapped:0,open:0,noStart:0,badEnd:0,mixed:0,duplicate:0},_=[],y=-1/0;for(let v=0;v<e.length;v++){let T=x(l[v]),A=x(c[v]);if(!Number.isFinite(T)){S(l[v])?$.mixed++:$.noStart++;continue}let w=!Number.isFinite(A)&&hi(c[v]);if(!Number.isFinite(A)&&!w){S(c[v])?$.mixed++:$.badEnd++;continue}w?$.open++:A<T&&([T,A]=[A,T],$.swapped++),y=Math.max(y,w?T:A);let N=e[v];_.push({i:v,label:r(N,v),start:T,end:A,open:w,point:!w&&A===T,group:i?i(N,v):"",status:s?s(N,v):"",datum:N})}let F=n.now===void 0?NaN:x(n.now),z=new Set;for(let v of _){v.open&&(v.end=Number.isFinite(F)&&F>=v.start?F:Math.max(y,v.start),v.point=v.end===v.start);let T=`${v.label}${v.start}${v.end}${v.group}`;z.has(T)?$.duplicate++:z.add(T)}let I=u==="date",E=I&&_.length>0&&_.every(v=>fi(v.start)&&fi(v.end)),B=I&&!E&&_.some(v=>new Date(v.start).getSeconds()||new Date(v.end).getSeconds());return{kind:u,items:_,issues:$,dateOnly:E,hasSeconds:B,read:x}}function _t(e,t,n=!1){let r=Te(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=De(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}var st=864e5;function pi(e){let t=1/0,n=-1/0;for(let o of e.items)o.start<t&&(t=o.start),o.end>n&&(n=o.end);if(t===1/0)return[0,1];if(e.kind==="number")return Ze(t,n,5,{zero:!1});let r=e.dateOnly?st:st/2;return t===n?[t-r,n+r]:[t,n]}var fi=e=>{let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0&&t.getMilliseconds()===0};function bi(e,t="none"){let n=new Map;e.forEach((i,s)=>{let l=n.get(i.label);l?l.push(s):n.set(i.label,[s])});let r=new Int32Array(e.length),o=[];for(let[i,s]of n){s.sort((h,u)=>e[h].start-e[u].start||e[h].end-e[u].end||h-u);let l=[],c=[];for(let h of s){let u=e[h],m=0;for(;m<l.length&&!(l[m]<u.start||l[m]===u.start&&!(c[m]&&u.point));)m++;l[m]=u.end,c[m]=u.point,r[h]=m}o.push({label:i,items:s,lanes:l.length,lane0:0})}if(t==="start")o.sort((i,s)=>e[i.items[0]].start-e[s.items[0]].start);else if(t==="duration"){let i=l=>l.items.reduce((c,h)=>c+e[h].end-e[h].start,0),s=new Map(o.map(l=>[l,i(l)]));o.sort((l,c)=>s.get(c)-s.get(l))}let a=0;for(let i of o)i.lane0=a,a+=i.lanes;return{rows:o,lane:r}}function yi(e,t){let n=t.filter(l=>e[l].status&&!e[l].point).sort((l,c)=>e[l].start-e[c].start||l-c),r=Array.from(new Set(n.flatMap(l=>[e[l].start,e[l].end]))).sort((l,c)=>l-c),o=[],a=[],i=0;for(let l=0;l+1<r.length;l++){let c=r[l];for(;i<n.length&&e[n[i]].start<=c;)a.push(n[i++]);for(;a.length&&e[a[a.length-1]].end<=c;)a.pop();a.length&&o.push({t0:c,t1:r[l+1],k:a[a.length-1]})}let s=[];for(let l of o){let c=e[l.k],h=s[s.length-1];h&&h.status===c.status&&h.t1===l.t0?(h.t1=l.t1,h.open=c.open&&l.t1===c.end):s.push({status:c.status,t0:l.t0,t1:l.t1,open:c.open&&l.t1===c.end})}return{spans:s,pieces:o,points:t.filter(l=>e[l].status&&e[l].point)}}function xi(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 it(t.csv)}return null}var Ri=D(Z(),1);var lt=D(Z(),1);var Ce=D(H(),1),kl={zoomHint:" Press Enter to zoom in.",pickHint:" Press Enter to select.",high:"High",low:"Low",resetLabel:"Show all (reset zoom)",reset:"Show all",extremes:(e,t)=>`, high ${e}, low ${t}`,range:(e,t)=>`${e} to ${t}`},wl={en:kl,ko:{zoomHint:" Enter를 누르면 확대해요.",pickHint:" Enter를 누르면 이 구간을 골라요.",high:"최고",low:"최저",resetLabel:"전체 보기(확대 풀기)",reset:"전체 보기",extremes:(e,t)=>`, 최고 ${e}, 최저 ${t}`,range:(e,t)=>`${e}~${t}`}},vl=4;function $l(e){let[t,n]=(0,lt.useState)(null),[r,o]=(0,lt.useState)(!1),a=(0,lt.useRef)(null),i=(0,lt.useRef)(null),s=()=>{a.current=null,i.current=null,o(!1),n(null)},l=(m,g,d)=>!e.enabled||e.count<2||d.pointerType==="touch"||d.button!==0||!e.inPlot(m,g)?!1:(a.current={i:e.indexAt(m),x:m,moved:!1},d.currentTarget.setPointerCapture?.(d.pointerId),!0),c=m=>{let g=a.current;if(!g)return!1;if(!g.moved&&Math.abs(m-g.x)<vl)return!0;g.moved=!0;let d=e.indexAt(m),p=Math.min(g.i,d),C=Math.max(g.i,d);return o(!0),n(x=>x?.from===p&&x.to===C?x:{from:p,to:C}),!0},h=(m,g,d)=>{let p=a.current;if(a.current=null,d.currentTarget.hasPointerCapture?.(d.pointerId)&&d.currentTarget.releasePointerCapture(d.pointerId),!p)return;if(o(!1),!p.moved||d.type==="pointercancel"){t&&(n(null),e.onCommit(null));return}let C=e.indexAt(m),x={from:Math.min(p.i,C),to:Math.max(p.i,C)},S=x.to>x.from;n(S&&e.keep!==!1?x:null),e.onCommit(S?x:null)},u=(m,g)=>{if(!e.enabled)return!1;if(m.key==="Escape"&&t)return s(),e.onCommit(null),!0;if(m.key==="Enter"&&t&&i.current!==null)return i.current=null,e.keep===!1&&n(null),e.onCommit(t),!0;if(!m.shiftKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight"||e.count<2)return!1;let d=m.key==="ArrowRight"?1:-1,p=i.current??g??(d>0?0:e.count-1),C=t&&i.current!==null?t.from===p?t.to:t.from:p,x=Math.max(0,Math.min(e.count-1,C+d));return i.current=p,n(x===p?null:{from:Math.min(p,x),to:Math.max(p,x)}),!0};return{range:t,dragging:r,keyboard:t!==null&&i.current!==null,down:l,move:c,up:h,key:u}}function ki(e){let[t,n]=(0,lt.useState)(null);return t&&t.sig!==e&&n(null),{view:t&&t.sig===e?t.range:null,zoomTo:r=>n({sig:e,range:r}),reset:()=>n(null)}}function wi(e,t,n){let r=wl[n.lang],o=e.brush==="zoom"?"zoom":e.brush?"select":null,a=$l({enabled:o!==null,count:n.count,indexAt:n.indexAt,inPlot:n.inPlot,keep:o!=="zoom",onCommit:l=>{let c=l?n.toXRange(l):null;e.onBrush?.(c),o==="zoom"&&c&&c.to>c.from&&t.zoomTo([c.from,c.to])}}),i={onPointerDown:o?a.down:void 0,onPointerUp:o?a.up:void 0,onKey:o?l=>l.key==="Escape"&&t.view&&!a.range?(t.reset(),!0):a.key(l,n.active):void 0,overlay:t.view?(0,Ce.jsx)(Tl,{p:n.p,onReset:t.reset,text:r}):null},s=a.keyboard?o==="zoom"?r.zoomHint:r.pickHint:"";return{brush:a,frame:i,hint:s,text:r}}function vi(e){let{p:t,top:n,bottom:r}=e,o=Math.min(e.x0,e.x1),a=Math.max(e.x0,e.x1),i=oe(e.main,11.5,800),s=oe(e.sub,10.5,500)+6,l=i+s+16,c=Math.max(2,Math.min(e.width-l-2,(o+a)/2-l/2)),h=n+4;return(0,Ce.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,Ce.jsx)("rect",{x:o,y:n,width:Math.max(1,a-o),height:Math.max(0,r-n),fill:t.paint("accent"),opacity:e.dragging?.1:.14}),(0,Ce.jsx)("line",{x1:o,x2:o,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,Ce.jsx)("line",{x1:a,x2:a,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,Ce.jsx)("rect",{x:c,y:h,width:l,height:22,rx:8,fill:t.paint("panel"),stroke:t.paint("line")}),(0,Ce.jsx)(xe,{x:c+8,y:h+11,size:11.5,weight:800,fill:t.paint("ink"),children:e.main}),(0,Ce.jsx)(xe,{x:c+8+i+6,y:h+11,size:10.5,weight:500,fill:t.paint("muted"),children:e.sub})]})}function Tl(e){let{p:t}=e;return(0,Ce.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onReset,"aria-label":e.text.resetLabel,style:{position:"absolute",top:0,right:0,height:24,padding:"0 10px",borderRadius:12,border:`1px solid ${t.paint("line")}`,background:t.paint("panel"),color:t.paint("muted"),fontSize:11.5,fontWeight:600,zIndex:4},children:e.text.reset})}var te=D(Z(),1);function $i(e,t){let n=Pe(e.theme),[r,o,a]=pn(e.width),i=bt(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,h=bn(e.reducedMotion??"auto"),u=e.animate!==!1&&!h&&Fe,m=ti(r,e.animateOnView!==!1&&u),g=be(e.locale),d=q(g),p=(0,te.useMemo)(()=>ot(e.format,g,t.format),[e.format,g,t.format]),C=(0,te.useCallback)(X=>Ut(X,{locale:g}),[g]),x=(0,te.useMemo)(()=>ft(p,e.unit),[p,e.unit]),S=(0,te.useMemo)(()=>cn(e.data),[e.data]),[$,_]=(0,te.useState)(null),[y,F]=(0,te.useState)(null),z=(0,te.useRef)([]),I=(0,te.useRef)(e.onHover);I.current=e.onHover;let E=(0,te.useRef)(e.onClick);E.current=e.onClick;let B=(0,te.useRef)(null),v=(0,te.useRef)(null),T=(0,te.useRef)(null),A=(0,te.useCallback)((X,le="pointer")=>{if(T.current!==X){T.current=X;let Y=X===null?null:z.current[X]??null;queueMicrotask(()=>I.current?.(Y)),v.current?.(X)}B.current=X===null?null:le,_(X),F(B.current)},[]),w=(0,te.useCallback)(X=>{B.current!=="keyboard"&&(B.current=X===null?null:"sync",_(X),F(B.current))},[]),N=(0,te.useCallback)(X=>{let le=z.current[X];le&&E.current?.(le)},[]),O=ko(e.replayKey),G=e.width!==void 0||(a??0)>0,fe={enabled:u,active:m.visible&&G,near:m.near,replayKey:O,dataKey:S,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Ke=(0,te.useCallback)((X,le=1)=>$===null||$===X?le:le*.38,[$]);return{p:n,width:s,height:c,measured:G,responsive:e.width===void 0,pending:Fe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:fe,fv:x,fmt:p,pct:C,locale:g,lang:d,t:d==="ko"?qr:Zr,active:$,via:y,setActive:A,click:N,events:z,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Ke,sig:S,description:e.description,reduced:h,publish:v,applySync:w}}var Q=D(Z(),1);function Ml(e){return 1-Math.pow(1-e,3)}function Cl(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Sl(e){return e==="easeInOut"?Cl:e==="linear"?t=>t:Ml}function Al(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 xt(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function yn(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 Ti(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 Mi(e,t,n,r){if(!t||!n||t.length!==n.length)return xt(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let l of xt(s,n[i]))o.push(l)}return o.length===r?o:xt(e,r)}var xn=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||!yn(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Ti(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=yn(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=Mi(s.cur,s.parts,i.parts,c),s.vel=Mi(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),Ti(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=yn(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=yn(c.from,c.to),this.tracks.set(i.key,c)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=xt(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Sl(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=xt(s.from,c)),s.vel.length!==c&&(s.vel=xt(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let u=Math.exp(-a*l),m=a*l>=8&&a*l<20,g=0;for(let d=0;d<c;d++){let p=s.from[d]-s.to[d],C=s.vel[d]+a*p;s.cur[d]=s.to[d]+(p+C*l)*u,s.curVel[d]=(s.vel[d]-a*C*l)*u,m&&g<.15&&(g=Math.max(g,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/a)))}h=a*l>=20||m&&g<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),m=r(u),g=Al(this.easing,u)/o;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*m,s.curVel[d]=(s.to[d]-s.from[d])*g;h=u>=1,s.progress=m}if(h){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Pt=new Set,kn=0;function Ci(e){kn=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"&&(kn=requestAnimationFrame(Ci))}function Si(e){return Pt.add(e),!kn&&typeof requestAnimationFrame<"u"&&(kn=requestAnimationFrame(Ci)),()=>{Pt.delete(e)}}function Rl(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 Ai(e,t){let n=(0,Q.useMemo)(()=>Rl(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:h=0}=t,u=(0,Q.useRef)(null),m=(0,Q.useRef)("init"),g=(0,Q.useRef)(null),d=(0,Q.useRef)(s),p=(0,Q.useRef)(i),C=(0,Q.useRef)(!1),x=(0,Q.useRef)(0),[,S]=(0,Q.useState)(0),$=(0,Q.useRef)(null),_=(0,Q.useRef)(!0);u.current||(u.current=new xn,u.current.configure(l,c),u.current.snap(n),g.current=n);let y=u.current;if(y.configure(l,c),g.current!==n){let v=m.current,T=!Object.is(d.current,s);y.sameTargets(n)?y.refreshData(n):!r||v==="init"?y.snap(n):v==="idle"?y.hold(n):v==="running"||T?y.update(n,Kt(),h):y.snap(n),g.current=n,d.current=s}let F=(0,Q.useRef)(()=>!1);F.current=v=>{if(!_.current)return!1;let T=y.step(v);return!T&&m.current==="running"&&(m.current="done"),S(A=>(A+1)%1e9),T||($.current=null),T};let z=(0,Q.useCallback)(()=>{if(!Fe||$.current||!y.animating)return;let v=T=>F.current(T);$.current=Si(v)},[y]);Ee(()=>{let v=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||y.animating)&&(y.snap(g.current??n),m.current="done",S(T=>T+1));return}m.current==="init"||v&&a?(y.hold(g.current??n),m.current="idle",C.current=!1,S(T=>T+1)):v&&(C.current=!0)},[r,i]),Ee(()=>{!r||!a||!C.current||(C.current=!1,y.hold(g.current??n),m.current="idle",S(v=>v+1))},[a,r]),(0,Q.useEffect)(()=>{r&&o&&m.current==="idle"&&(y.start(Kt()),x.current+=1,m.current="running",z(),S(v=>v+1))},[r,o,i,y,z]),(0,Q.useEffect)(()=>{y.animating&&z()}),(0,Q.useEffect)(()=>(_.current=!0,()=>{_.current=!1,$.current?.(),$.current=null}),[]);let I=Kt(),E=y.elapsed(I),B=r&&m.current==="idle";return{items:y.items(),get:v=>y.get(v),elapsed:B?0:E,fade:(v,T=320)=>B?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-v)/T)):1,waiting:B,animating:y.animating,generation:x.current}}var fr=D(H(),1);function Ni(e,t,n,r,o){if(r)return o==="categorical"?he(e,t,n):ao(e,t,n);if(o==="categorical")return he(e,t,n);let a=ee(e,"strong"),i=ee(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var Nl=D(Z(),1);var hr=D(H(),1);var Fi=e=>e?"neutralStrong":"accent";var gr=D(H(),1);function _i(e,t,n,r){if(typeof e!="function")return Oe(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var Fl=D(Z(),1);var br=D(H(),1),_l={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}, ${Be(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Pi={en:_l,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}일 이동평균`}},pr=["ink","muted","dim"];function Di(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,pr.length)}var Pl=D(Z(),1);var zi=D(H(),1),Dl={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Be(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ll={en:Dl,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Li=(e,t)=>Ll[e].other(t);function Ei(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,Oo(o.map(a=>a.value)))}}var Oi=e=>Number.isFinite(e)&&e>0?e:0;function Ii(e,t,n,r){return r==="emphasis"?io(e,t,n):he(e,t,n)}var El=D(Z(),1);var Gi=D(H(),1);function Bi(e,t){return t===!1?e.map((n,r)=>r):Eo(e)}function Hi(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return Oe(e,t,t,r,"max")}function ji(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=ee(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?ee(e,"neutral"):Xt(e,1-i/Math.max(1,o.length-1))),r}function Vi(e){return!e||typeof e!="object"||Array.isArray(e)?[]:De(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Ki(e,t){return Mt(e,t+1,new Set)}var V=D(Z(),1);var W=D(H(),1),Ol={kind:"Timeline",start:"Start",end:"End",at:"At",duration:"Duration",status:"Status",group:"Group",open:"open",now:"Now",range:(e,t)=>`${e} to ${t}`,desc:(e,t,n,r)=>`${Be(e,"item")} on ${Be(t,"row")}, from ${n} to ${r}`,longest:(e,t)=>`Longest: ${e}, ${t}`,lines:"Reference lines",strip:(e,t)=>`Status strip: ${e}${t?`, and ${t} more`:""}.`},Il={en:Ol,ko:{kind:"타임라인",start:"시작",end:"끝",at:"시각",duration:"걸린 시간",status:"상태",group:"묶음",open:"진행 중",now:"지금",range:(e,t)=>`${e}~${t}`,desc:(e,t,n,r)=>`항목 ${e}개, 줄 ${t}개, ${n}부터 ${r}까지`,longest:(e,t)=>`가장 긴 항목은 ${e}, ${t}`,lines:"기준선",strip:(e,t)=>`상태 띠: ${e}${t?` 외 ${t}개`:""}.`}},Lt=26,zl=520,Bl=2,Wi=22,Dt=11.5,Xi=13,Hl=14,Ge=11,Ui=7,Yi=.28,wn=3,yr=600,xr=6,kr=Lt*.62;function jl(e,t,n,r){let o=(t-e)/Math.max(1,n);if(t>e&&o>st*30.44*6){let c=new Date(e).getFullYear(),h=new Date(t).getFullYear()-c,u=[1,2,5,10,20,50,100,200,500,1e3].find(g=>h/g<=n)??1e3,m=[];for(let g=Math.ceil(c/u)*u,d=0;d<500;g+=u,d++){let p=new Date(g,0,1).getTime();if(p>t)break;p>=e&&m.push({t:p,label:He(p,{locale:r,year:"numeric"})})}if(m.length>=2)return m}let a=[1,2,5,10,15,30,60,120,300,600,900,1800].map(c=>c*1e3).find(c=>c>=o);if(!(t>e)||a===void 0)return fn(e,t,n,r);let i=a<6e4?{hour:"numeric",minute:"2-digit",second:"2-digit"}:{hour:"numeric",minute:"2-digit"},s=new Date(e).getTimezoneOffset()*6e4,l=[];for(let c=Math.ceil((e-s)/a)*a+s,h=0;c<=t&&h<500;c+=a,h++)l.push({t:c,label:He(c,{locale:r,...i})});return l}function vn(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!ri.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}function Ji(e,t,n=!1){let r=0,o=e.length;for(;r<o;){let a=r+o>>1;(n?e[a]<=t:e[a]<t)?r=a+1:o=a}return r}function $n(e){let t=(0,V.useMemo)(()=>gi(e.data,{label:e.label,start:e.start,end:e.end,group:e.group,status:e.status},{xType:e.xType,dayFirst:e.dayFirst,now:e.now}),[e.data,e.label,e.start,e.end,e.group,e.status,e.xType,e.dayFirst,e.now]),{items:n,kind:r,dateOnly:o}=t,a=e.sort==="start"||e.sort==="duration"?e.sort:"none",{rows:i,lane:s}=(0,V.useMemo)(()=>bi(n,a),[n,a]),l=i.reduce((f,k)=>f+k.lanes,0),c=e.statusStrip===!0&&e.status!==void 0&&n.some(f=>f.status!==""),h=c?xr+Lt:0,u=Array.isArray(e.referenceLines)?e.referenceLines:[],m=u.length>0||e.now!==void 0?24:6,g=$i(e,{height:()=>m+Wi+h+Math.max(40,Math.min(l*Lt,zl),l*Bl),duration:700,stagger:40}),{p:d,width:p,height:C,locale:x,fv:S}=g,$=Il[g.lang],_=ki(g.sig),y=(0,V.useMemo)(()=>i.flatMap(f=>f.items),[i]),F=e.group===void 0,z=F?e.status:e.group,I=f=>F?f.status:f.group,E=(0,V.useMemo)(()=>z===void 0?[]:_t(e.data,z,F),[e.data,z,F]),B=(0,V.useMemo)(()=>new Map(E.map((f,k)=>[f,k])),[E]),v=e.highlight,T=(0,V.useMemo)(()=>vn(v,E),[v,E]),A=E.length>0&&!(c&&F),w=(0,V.useMemo)(()=>{let f=y.map(R=>n[R].end-n[R].start),k=Oe(v,y.map(R=>n[R].datum),y.map(R=>n[R].label),f,A?"none":"max"),M=new Set([...k].map(R=>y[R]));return T.size&&n.forEach((R,P)=>T.has(B.get(I(R))??-1)&&M.add(P)),M},[v,y,n,A,B,T,F]),N=(0,V.useMemo)(()=>E.length?he(d,E.length,T):null,[d,E,T]),O=A?N:null,G=(0,V.useMemo)(()=>c?F?E:_t(e.data,e.status,!0):[],[c,F,E,e.data,e.status]),fe=(0,V.useMemo)(()=>c?F&&N?N:he(d,G.length,vn(v,G)):[],[c,F,N,d,G,v]),Ke=(0,V.useMemo)(()=>new Map(G.map((f,k)=>[f,k])),[G]),X=Array.isArray(e.hidden)?e.hidden.join(""):"",le=(0,V.useMemo)(()=>new Set(E.length&&X?X.split(""):[]),[E.length,X]),Y=(0,V.useMemo)(()=>Array.from(new Set(n.flatMap(f=>[f.start,f.end]))).sort((f,k)=>f-k),[n]),ge=Y.length?Y[0]:0,We=Y.length?Y[Y.length-1]:1,vr=(0,V.useMemo)(()=>pi(t),[t]),Ot=_.view&&Y[_.view[1]]>Y[_.view[0]]?_.view:null,ce=Ot?Y[Ot[0]]:vr[0],ue=Ot?Y[Ot[1]]:vr[1],$r=(0,V.useMemo)(()=>{if(o)return new Date(ge).getFullYear()===new Date(We).getFullYear()?{month:"short",day:"numeric"}:{year:"numeric",month:"short",day:"numeric"};let f={hour:"numeric",minute:"2-digit",...t.hasSeconds?{second:"2-digit"}:{}};return We-ge<st*1.5?f:{month:"short",day:"numeric",...f}},[o,t.hasSeconds,ge,We]),ne=f=>r==="number"?S(f):He(f,{locale:x,...$r}),Tr=f=>r==="number"?S(f):po(o?Math.round(f/st)*st:f,x),Qe=(0,V.useMemo)(()=>{let f=n.map(k=>Tr(k.end-k.start));return{text:f,w:f.map(k=>oe(k,Ge,600)),wHi:f.map(k=>oe(k,Ge,800))}},[n,r,o,S,x]),Tn=c?$.status:"",ta=(0,V.useMemo)(()=>i.reduce((f,k)=>Math.max(f,oe(k.label,Dt,700)),Math.max(24,Tn?oe(Tn,Dt,700):0)),[i,Tn]),kt=Math.min(p*.32,ta+10),Se=kt+10,Ae=Math.max(Se+10,p-16),et=C-Wi,Mn=et-h,tt=Mn+xr+Lt/2,we=(Mn-m)/Math.max(1,l),wt=we>=6?Math.min(18,Math.max(4,we*.62)):Math.max(1,we*.8),re=St([ce,ue],[Se+Ui,Ae-Ui]),It=(0,V.useMemo)(()=>{let f=new Int32Array(n.length);return i.forEach((k,M)=>k.items.forEach(R=>f[R]=M)),f},[i,n.length]),Mr=f=>m+(i[It[f]].lane0+s[f]+.5)*we,ie=(0,V.useMemo)(()=>y.filter(f=>!le.has(I(n[f]))&&n[f].end>=ce&&n[f].start<=ue),[y,le,n,ce,ue,F]),nt=(0,V.useMemo)(()=>new Map(ie.map((f,k)=>[f,k])),[ie]),Ie=(0,V.useMemo)(()=>c?yi(n,ie):null,[c,n,ie]),zt=g.motion.stagger??40,Cn=g.showLabels&&we>=Hl,Sn=(0,V.useMemo)(()=>{let f=new Map;return ie.map((k,M)=>{let R=n[k],P=(f.get(R.label)??0)+1;f.set(R.label,P);let j=Math.max(Se,Math.min(Ae,re(R.start))),ae=R.point?j:Math.max(j+wn,Math.min(Ae,re(R.end))),J=Mr(k);return{key:`${R.label}${P}`,to:[j,ae,1,J],from:[j,j,0,J],delay:Math.min(M*zt,yr),data:k}})},[ie,n,i,It,s,Se,Ae,ce,ue,m,we,zt]),An=Ai(Sn,g.motion),na=(0,V.useMemo)(()=>{let f=new Map;if(!Cn||c)return f;for(let k of Sn){let M=n[k.data];if(!M.status)continue;let R=M.point?M.status:at(M.status,Math.max(1,k.to[1]-k.to[0])-12,Ge,600);f.set(k.data,{text:R,w:oe(R,Ge,600)})}return f},[Sn,n,Cn,c]),Cr=f=>{let k=B.get(I(n[f]));return O&&k!==void 0?O[k]:ee(d,!O&&w.has(f)?"accent":"neutral")},Sr=(0,V.useMemo)(()=>{let f=new Float64Array(n.length).fill(p-2);for(let k of i){let M=new Map;for(let R of k.items){if(le.has(I(n[R])))continue;let P=M.get(s[R]);P!==void 0&&(f[P]=re(n[R].start)),M.set(s[R],R)}}return f},[i,n,s,le,p,Se,Ae,ce,ue,F]),Ar=(0,V.useMemo)(()=>ie.map((f,k)=>{let M=n[f],R=M.point?ne(M.start):`${$.range(ne(M.start),ne(M.end))}, ${Qe.text[f]}`;return{datum:M.datum,index:k,key:`${M.label}#${M.i}`,label:M.label,value:M.end-M.start,...M.group&&{series:M.group},formatted:`${R}${M.status?`, ${M.status}`:""}`}}),[ie,n,$,Qe,S,x,$r,r]),{b0:Rr,visB:ze,visX:ra}=(0,V.useMemo)(()=>{let f=Ji(Y,ce),k=Y.slice(f,Math.max(f,Ji(Y,ue,!0)));return{b0:f,visB:k,visX:k.map(M=>re(M))}},[Y,ce,ue,Se,Ae]),pe=g.active!==null?ie[g.active]:void 0,{brush:Xe,frame:Bt,hint:oa}=wi({brush:e.brush?"zoom":!1,onBrush:e.onBrush},_,{p:d,active:pe===void 0?null:Math.max(0,ir(ze,n[pe].start)),lang:g.lang,count:ze.length,indexAt:f=>ir(ra,f),inPlot:(f,k)=>f>=Se-4&&f<=Ae+4&&k>=m&&k<=et,toXRange:f=>({from:Rr+f.from,to:Rr+f.to,fromKey:String(ze[f.from]),toKey:String(ze[f.to]),fromLabel:ne(ze[f.from]),toLabel:ne(ze[f.to])})}),ia=(f,k)=>{if(Ie&&k>=Mn+xr/2&&k<=et){let U=Ie.points.find(Ne=>Math.abs(re(n[Ne].start)-f)<=6);if(U!==void 0)return nt.get(U)??null;let me=re.invert(f),Re=Ie.pieces.find(Ne=>Ne.t0<=me&&me<Ne.t1);return Re?nt.get(Re.k)??null:null}let M=Math.floor((k-m)/we);if(M<0||M>=l)return null;let R=0,P=i.length-1;for(;R<P;){let U=R+P+1>>1;i[U].lane0<=M?R=U:P=U-1}let j=i[R],ae=null,J=10;for(let U of j.items){let me=nt.get(U);if(me===void 0||s[U]!==M-j.lane0)continue;let Re=re(n[U].start),Ne=Math.max(0,Re-f,f-Math.max(re(n[U].end),n[U].point?Re:Re+wn));(Ne<J||Ne===0&&J===0)&&(J=Ne,ae=me)}return ae},aa=f=>{if(Bt.onKey?.(f))return!0;if(f.key!=="ArrowUp"&&f.key!=="ArrowDown"&&f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return!1;if(!ie.length)return!0;if(pe===void 0)return g.setActive(f.key==="ArrowUp"||f.key==="ArrowLeft"?ie.length-1:0,"keyboard"),!0;let k=It[pe],M=P=>i[P].items.filter(j=>nt.has(j));if(f.key==="ArrowLeft"||f.key==="ArrowRight"){let P=M(k),j=P[P.indexOf(pe)+(f.key==="ArrowRight"?1:-1)];return j!==void 0&&g.setActive(nt.get(j),"keyboard"),!0}let R=f.key==="ArrowDown"?1:-1;for(let P=k+R;P>=0&&P<i.length;P+=R){let j=M(P);if(!j.length)continue;let ae=n[pe].start,J=j.reduce((U,me)=>Math.abs(n[me].start-ae)<Math.abs(n[U].start-ae)?me:U,j[0]);g.setActive(nt.get(J),"keyboard");break}return!0},Nr=null,Rn="";if(pe!==void 0&&!Xe.dragging){let f=n[pe],k=Cr(pe),M=f.point?[{label:$.at,value:ne(f.start),color:k.fill}]:[{label:$.start,value:ne(f.start),strong:!1},{label:$.end,value:f.open?`${ne(f.end)} (${$.open})`:ne(f.end),strong:!1},{label:$.duration,value:Qe.text[pe],color:k.fill}];f.group&&M.push({label:$.group,value:f.group,strong:!1}),f.status&&M.push({label:$.status,value:f.status,strong:!1});let R=Math.max(Se,re(f.start)),P=Math.max(R+(f.point?0:wn),Math.min(Ae,re(f.end)));Nr={x:(R+P)/2,y:Mr(pe)-wt/2,title:f.label,rows:M},g.via==="keyboard"&&(Rn=`${f.label}, ${Ar[g.active].formatted}`)}let Fr=null;if(Xe.range&&Xe.range.to<ze.length){let f=ze[Xe.range.from],k=ze[Xe.range.to],M=Tr(k-f);Fr=(0,W.jsx)(vi,{p:d,x0:re(f),x1:re(k),top:m,bottom:et,width:p,main:M,sub:$.range(ne(f),ne(k)),dragging:Xe.dragging}),Xe.dragging||(Rn=`${$.range(ne(f),ne(k))}, ${M}.${oa}`)}let Nn=Math.max(2,Math.floor((Ae-Se)/(r==="number"?70:64))),_r=e.format,Pr=e.unit,sa=(0,V.useMemo)(()=>{let f=ft(Yt(_r,x,Math.max(Math.abs(ce),Math.abs(ue))),Pr);return Vo(r==="number"?re.ticks(Nn).map(k=>({x:re(k),label:f(k)})):jl(ce,ue,Nn,x).map(k=>({x:re(k.t),label:k.label})),-2,p+2)},[r,Nn,ce,ue,Se,Ae,p,_r,Pr,x]),Fn=[...u.map(f=>({t:t.read(f?.x),label:typeof f?.label=="string"?f.label:"",now:!1})),...e.now!==void 0?[{t:t.read(e.now),label:$.now,now:!0}]:[]].filter(f=>Number.isFinite(f.t)&&f.t>=ce&&f.t<=ue),Dr=[],la=Fn.map((f,k)=>{let M=re(f.t),R=f.label?at(f.label,140,10.5,f.now?700:500):"",P=M+dn(R,0,0,"start",f.now).w+2>p,j=R?dn(R,P?M-3:M+3,m-14,P?"end":"start",f.now):null,ae=j!==null&&j.x>=0&&!Dr.some(J=>Bo(j,J,4));return ae&&Dr.push(j),(0,W.jsxs)("g",{children:[(0,W.jsx)("line",{x1:M,x2:M,y1:m-(ae?14:2),y2:et,stroke:d.paint(f.now?"ink":"dim"),strokeOpacity:f.now?.55:1,strokeDasharray:f.now?"2 3":"4 3"}),ae?(0,W.jsx)(jo,{p:d,x:P?M-3:M+3,y:m-14,text:R,anchor:P?"end":"start",strong:f.now}):null]},k)}),Lr=pe===void 0?-1:It[pe],ca=(0,V.useMemo)(()=>{let f=i.reduce((P,j)=>Math.min(P,j.lanes),1/0),k=Math.max(1,Math.ceil(Xi/Math.max(.01,Math.min(f*we,Lt)))),M=i.some(P=>P.lanes>1),R=-1/0;return i.map((P,j)=>{let ae=m+(P.lane0+P.lanes/2)*we,J=j%k===0&&ae-R>=Xi;J&&(R=ae);let U=j===Lr||P.items.some(me=>w.has(me));return(0,W.jsxs)("g",{children:[M&&j?(0,W.jsx)("line",{x1:0,x2:p,y1:m+P.lane0*we,y2:m+P.lane0*we,stroke:d.paint("line"),opacity:.7}):null,J?(0,W.jsx)(xe,{x:kt,y:ae,anchor:"end",size:Dt,weight:U?700:600,fill:d.paint(U?"ink":"muted"),children:at(P.label,kt-4,Dt,700)}):null]},j)})},[i,we,m,kt,p,d,w,Lr]),Er=g.motion.duration??700,ua=Math.min(d.theme.radiusMark,wt/2),Ht=(0,V.useMemo)(()=>ie.length?ie[un(ie.map(f=>n[f].end-n[f].start))]:-1,[ie,n]),ma=Fn.length?` ${$.lines}: ${Fn.map(f=>`${f.label?`${f.label} `:""}${ne(f.t)}`).join(", ")}.`:"",Or="";if(Ie){let f=[...Ie.spans.map(k=>({t:k.t0,text:`${k.status} ${$.range(ne(k.t0),ne(k.t1))}`})),...Ie.points.map(k=>({t:n[k].start,text:`${n[k].status} ${ne(n[k].start)}`}))].sort((k,M)=>k.t-M.t);f.length&&(Or=` ${$.strip(f.slice(0,8).map(k=>k.text).join(", "),Math.max(0,f.length-8))}`)}let da=e.description??(ie.length?`${$.kind}. ${$.desc(ie.length,i.length,ne(ce>ge?ce:ge),ne(ue<We?ue:We))}. ${Ht>=0&&!n[Ht].point?`${$.longest(n[Ht].label,Qe.text[Ht])}.`:""}${ma}${Or}`.trim():"");return(0,W.jsxs)(vo,{c:g,kind:$.kind,ariaLabel:e.ariaLabel,description:da,events:Ar,tip:Nr,renderTip:e.tooltip,announce:Rn||void 0,className:e.className,style:e.style,theme:e.theme,onPointerDown:Bt.onPointerDown,onPointerUp:Bt.onPointerUp,overlay:Bt.overlay,onPointerMove:(f,k,M)=>{if(Xe.move(f))return;let R=ia(f,k);R!==g.active&&g.setActive(R,M.pointerType==="touch"?"touch":"pointer")},onKey:aa,children:[(0,W.jsxs)("g",{"aria-hidden":"true",children:[sa.map((f,k)=>(0,W.jsxs)("g",{children:[(0,W.jsx)("line",{x1:f.x,x2:f.x,y1:m,y2:et,stroke:d.paint("line")}),(0,W.jsx)(xe,{x:f.x,y:et+12,anchor:"middle",size:pt,fill:d.paint("muted"),children:f.label})]},k)),ca]}),An.items.map(f=>{if(f.exiting)return null;let k=f.data,M=nt.get(k);if(M===void 0)return null;let R=n[k],[P,j,ae,J]=f.v,U=Cr(k),me=w.has(k),Re=g.active===M&&g.via==="keyboard"||O!==null&&me&&!T.has(B.get(I(R))??-1),Ne=g.dim(M)*Math.min(1,ae*1.5),_n=An.fade(Math.min(M*zt,yr)+Er*.4,260),vt=na.get(k);if(R.point){let ct=Math.max(3,Math.min(wt,12)/2+1);return(0,W.jsxs)("g",{opacity:Ne,children:[(0,W.jsx)("path",{d:`M${P} ${J-ct}L${P+ct} ${J}L${P} ${J+ct}L${P-ct} ${J}Z`,fill:U.fill,stroke:d.paint(Re?"ink":"panel"),strokeWidth:Re?2:1,className:"ztd-mark",onClick:()=>g.click(M)}),vt&&P+ct+6+vt.w<Sr[k]-4?(0,W.jsx)(xe,{x:P+ct+6,y:J,size:Ge,weight:600,fill:d.paint("muted"),opacity:_n,children:vt.text}):null]},f.key)}let $t=Math.max(1,j-P),Pn=Cn?Qe.text[k]:"",Ir=me?Qe.wHi[k]:Qe.w[k],jt=Pn&&P+$t+6+Ir<Sr[k]-4,zr=Pn&&!jt&&(c||!R.status)&&Ir+12<=$t;return(0,W.jsxs)("g",{opacity:Ne,children:[(0,W.jsx)("rect",{x:P,y:J-wt/2,width:$t,height:wt,rx:ua,fill:U.fill,fillOpacity:R.open?Yi:1,stroke:Re?d.paint("ink"):R.open?U.fill:"none",strokeWidth:Re?2:1,strokeDasharray:R.open?"3 2":void 0,className:"ztd-mark",onClick:()=>g.click(M)}),vt?.text?(0,W.jsx)(xe,{x:P+6,y:J,size:Ge,weight:600,fill:R.open?d.paint("ink"):U.text,opacity:_n,children:vt.text}):null,jt||zr?(0,W.jsx)(xe,{x:jt?P+$t+6:P+$t-6,y:J,anchor:jt?"start":"end",size:Ge,weight:me?800:600,fill:zr?R.open?d.paint("ink"):U.text:d.paint(me?"ink":"muted"),opacity:_n,children:Pn}):null]},f.key)}),Ie?(0,W.jsxs)("g",{className:"ztd-strip","aria-hidden":"true",opacity:An.fade(Math.min(ie.length*zt,yr)+Er*.4,260),children:[(0,W.jsx)(xe,{x:kt,y:tt,anchor:"end",size:Dt,weight:600,fill:d.paint("muted"),children:$.status}),Ie.spans.map((f,k)=>{if(f.t1<ce||f.t0>ue)return null;let M=Math.max(Se,re(f.t0)),R=Math.max(wn,Math.min(Ae,re(f.t1))-M-2),P=fe[Ke.get(f.status)??0],j=g.showLabels?at(f.status,R-12,Ge,600):"";return(0,W.jsxs)("g",{children:[(0,W.jsx)("rect",{x:M,y:tt-kr/2,width:R,height:kr,rx:Math.min(d.theme.radiusMark,kr/2),fill:P.fill,fillOpacity:f.open?Yi:1,stroke:f.open?P.fill:"none",strokeDasharray:f.open?"3 2":void 0}),j?(0,W.jsx)(xe,{x:M+R/2,y:tt,anchor:"middle",size:Ge,weight:600,fill:f.open?d.paint("ink"):P.text,children:j}):null]},k)}),Ie.points.map(f=>{let k=n[f].start;if(k<ce||k>ue)return null;let M=re(k),R=7;return(0,W.jsx)("path",{d:`M${M} ${tt-R}L${M+R} ${tt}L${M} ${tt+R}L${M-R} ${tt}Z`,fill:fe[Ke.get(n[f].status)??0].fill,stroke:d.paint("panel")},`p${f}`)})]}):null,(0,W.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:la}),Fr]})}var Ve=D(H(),1);function Zi(e,t,n){let r=sn(e);return r?.type==="scatter"&&t?.size!==void 0&&!an(n)?sn("bubble"):r}function Gl(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 Vl(e,t,n,r=!1){let o=Zi(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&tr.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(h.includes(o.type)){let u=Te(a.label,"label"),m=ln(a.value,"value"),g=o.type==="waffle",d=t.map((y,F)=>({r:y,label:u(y,F),value:g?m(y,F):Oi(m(y,F))})),{kept:p,other:C}=g?{kept:d,other:null}:Ei(d,i.other,(y,F)=>({r:{},label:Li(q(n),y),value:F})),x=Oe(s,p.map(y=>y.r),p.map(y=>y.label),p.map(y=>y.value),g?"first":"max"),S=C?[...p,C]:p,$=Ye(y=>g?he(y,S.length,x):Ii(y,S.length,x,i.colorMode)),_=g&&i.shape==="arc";return S.map((y,F)=>({label:y.label,color:$[F],..._&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Di(Array.isArray(i.ma)?i.ma:void 0,t.length),m=Pi[q(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((g,d)=>({label:m.maLegend(g),color:pr[d],shape:"line"}))]}if(o.type==="network"){let u=Vi(i.groups);if(u.length<2)return[];let m=Ye(g=>Ki(g,u.length));return u.map((g,d)=>({label:g,color:m[d],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=Te(a.group,"group"),m=De(t.map((d,p)=>u(d,p)).filter(Boolean));if(m.length<2)return[];let g=Ye(d=>Mt(d,m.length,new Set));return m.map((d,p)=>({label:d,color:g[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||an(i))return[];let u=Te(a.series,"series"),m=De(t.map((p,C)=>u(p,C)));if(m.length<2)return[];let g=_i(s,t,m,u),d=Ye(p=>Mt(p,m.length,g));return c(m.map((p,C)=>({label:p,color:d[C],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",m=u?a.status:a.group;if(typeof m!="string")return[];let g=_t(t,m,u),d=Ye(p=>he(p,g.length,vn(s,g)));return c(g.map((p,C)=>({label:p,color:d[C],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let $=Te(a.series,"series");u=De(t.map((_,y)=>$(_,y)))}let m=nr(o.type,a,i);if(m.length){let $=Oe(s,u,u,u.map(()=>0),"none"),_=Ye(F=>he(F,u.length,$)),y=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((F,z)=>({label:F,color:_[z]}));return[...c(y),...m.map((F,z)=>({label:F,color:Fi(z),shape:"line"}))]}if(u.length<2)return[];let d=o.type==="bar"&&i.layout==="diverging"&&s===void 0?Lo(u.length,Array.isArray(i.negative)?i.negative.map($=>u.indexOf(String($))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=d>=0?new Set([d]):Oe(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map(($,_)=>({label:$,color:p.has(_)?"accent":"neutralStrong",shape:"square"})));let C=i.colorMode,x=$=>he($,u.length,p);if((o.type==="line"||o.type==="area")&&(x=$=>Ni($,u.length,p,o.type==="area",C)),o.type==="stream"){let $=Rt(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),_=Bi($.values,i.reorder),y=Hi(s,$.series,$.values);x=F=>ji(F,_,y)}let S=Ye(x);return c(u.map(($,_)=>({label:$,color:S[_],...o.type==="line"&&{shape:"line"}})))}return[]}function Kl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&So.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Wl(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...h}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:h,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function qi(e,t){let{spec:n}=e,r=Zi(n.type,n.encoding,n.options),o=(0,Et.useMemo)(()=>xi(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Co(n,e.locale),s=be(i),l=q(s),c=oi(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),h=No(n),u=(0,Et.useMemo)(()=>h?mi(h,s):void 0,[h,s]),m=n.options?.hidden,g=Array.isArray(m)?m.map(String):[],d=g.join(""),[p,C]=(0,Et.useState)(null);if(!r)return(0,Ve.jsx)(er,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=o??c.data,S=t[r.type],$={...n.options??{}},_={...Gl(r,n.encoding),...$,...u?{tooltip:u}:{},data:x,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},y=n.card?.legend==="toggle"&&Ro(r.type,n.encoding??{},$),F=p&&p.base===d?p.hidden:g;y&&(_.hidden=F);let z=T=>C(A=>{let w=A&&A.base===d?A.hidden:g;return{base:d,hidden:w.includes(T)?w.filter(N=>N!==T):[...w,T]}}),I=_.height??220,E=Kl(n,r.type),B=a&&!x.length&&(c.loading||c.error||c.empty)?(0,Ve.jsx)(er,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:I,locale:i}):E?(0,Ve.jsx)(ni,{chart:S,...Wl(r.type,E,_)}):(0,Ve.jsx)(S,{..._});if(n.card){let T=n.card,A=T.legend==="auto"||T.legend==="toggle"?Vl(n,x,s,y):T.legend,w=A?.length?y?(0,Ve.jsx)(Qn,{items:A,hidden:F,onToggle:z,locale:i}):A:void 0,N=T.download?(0,Ve.jsx)(ui,{data:x,columns:Fo(n),filename:T.title??r.type,formats:Array.isArray(T.download)?T.download:void 0,locale:i}):void 0;B=(0,Ve.jsx)(wo,{number:T.number,title:T.title??Mo(r,l),subtitle:T.subtitle,legend:w,actions:N,source:T.source||void 0,note:T.note||void 0,accent:T.accent,takeaway:T.takeaway,level:T.level,sample:T.sample,replay:T.replay!==!1,className:e.className,locale:i,children:B})}let v=e.theme??n.theme;return v&&(B=(0,Ve.jsx)(en,{theme:v,children:B})),B}function Xl({cfg:e,components:t}){let n=bt();return qi({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ea(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Qi.hydrateRoot)(r,(0,wr.createElement)(en,{theme:o.theme,cssVars:!0},(0,wr.createElement)(Xl,{cfg:o,components:{[e]:t}})))}ea("timeline",$n);})();