yamchart 0.9.3 → 0.9.5

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 (23) hide show
  1. package/dist/{chunk-7CD6UQAV.js → chunk-DZVT6PHW.js} +9 -1
  2. package/dist/chunk-DZVT6PHW.js.map +1 -0
  3. package/dist/{dev-KDNXUNME.js → dev-GWXHBBWB.js} +22 -7
  4. package/dist/{dev-KDNXUNME.js.map → dev-GWXHBBWB.js.map} +1 -1
  5. package/dist/{dist-NGQG7Z4G.js → dist-MIKFZKSD.js} +2 -2
  6. package/dist/index.js +2 -2
  7. package/dist/public/assets/{EventManagement-B7leMxfo.js → EventManagement-CTuAJ0eF.js} +1 -1
  8. package/dist/public/assets/{ExplorePage-zI1OiYlH.js → ExplorePage-ZJ3zNjNQ.js} +1 -1
  9. package/dist/public/assets/{LoginPage-Dyk2ILmo.js → LoginPage-wygea4BI.js} +1 -1
  10. package/dist/public/assets/{PublicViewer-C2tNYBR2.js → PublicViewer-8YqGrVVB.js} +1 -1
  11. package/dist/public/assets/{SetupWizard-BzZSJlbt.js → SetupWizard-DqDBwHrF.js} +1 -1
  12. package/dist/public/assets/{ShareManagement-C7RIZRWe.js → ShareManagement-TAAdI_gY.js} +1 -1
  13. package/dist/public/assets/{UserManagement-BD-lLbVH.js → UserManagement-B4kZHyri.js} +1 -1
  14. package/dist/public/assets/{index-lklRbe2I.js → index-BgzSjgIu.js} +3 -3
  15. package/dist/public/assets/{index.es-CLyC5-GY.js → index.es-AB-GdGyc.js} +1 -1
  16. package/dist/public/assets/{jspdf.es.min-CTZVk96E.js → jspdf.es.min-ChRx2mOQ.js} +3 -3
  17. package/dist/public/index.html +1 -1
  18. package/dist/{reset-password-HDCLH7PZ.js → reset-password-YVCZKZPC.js} +2 -2
  19. package/dist/templates/default/docs/yamchart-reference.md +4 -0
  20. package/package.json +5 -5
  21. package/dist/chunk-7CD6UQAV.js.map +0 -1
  22. /package/dist/{dist-NGQG7Z4G.js.map → dist-MIKFZKSD.js.map} +0 -0
  23. /package/dist/{reset-password-HDCLH7PZ.js.map → reset-password-YVCZKZPC.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-Dyk2ILmo.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-BzZSJlbt.js","assets/UserManagement-BD-lLbVH.js","assets/ShareManagement-C7RIZRWe.js","assets/PublicViewer-C2tNYBR2.js","assets/EventManagement-B7leMxfo.js","assets/ExplorePage-zI1OiYlH.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-wygea4BI.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-DqDBwHrF.js","assets/UserManagement-B4kZHyri.js","assets/ShareManagement-TAAdI_gY.js","assets/PublicViewer-8YqGrVVB.js","assets/EventManagement-CTuAJ0eF.js","assets/ExplorePage-ZJ3zNjNQ.js"])))=>i.map(i=>d[i]);
2
2
  var rk=Object.defineProperty;var $g=e=>{throw TypeError(e)};var sk=(e,t,n)=>t in e?rk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qe=(e,t,n)=>sk(e,typeof t!="symbol"?t+"":t,n),Ph=(e,t,n)=>t.has(e)||$g("Cannot "+n);var $=(e,t,n)=>(Ph(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>t.has(e)?$g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Me=(e,t,n,r)=>(Ph(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),dt=(e,t,n)=>(Ph(e,t,"access private method"),n);var Sc=(e,t,n,r)=>({set _(s){Me(e,t,s,n)},get _(){return $(e,t,r)}});import{r as ma,a as C,R as Le,g as Ab,E as ok}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var jh={exports:{}},pl={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
@@ -89,7 +89,7 @@ Error generating stack: `+w.message+`
89
89
  border: 2px solid var(--yc-color-primary, #2563eb);
90
90
  }
91
91
  .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
92
- `;function b6({isOpen:e,onClose:t,events:n,allEvents:r,chartName:s,canEdit:i,eventsVisible:l,onToggleVisible:u,themePalette:f}){const h=qn(),[p,y]=C.useState(!1),[g,b]=C.useState(""),[O,k]=C.useState(""),[T,E]=C.useState(""),[_,S]=C.useState(""),[D,M]=C.useState(!1),[N,I]=C.useState(""),[A,F]=C.useState(!1),[j,B]=C.useState(!1),H=C.useRef(null),W=C.useRef(null),Y=C.useRef(null),[V,se]=C.useState(null),[ie,G]=C.useState(null),[de,P]=C.useState(""),te=C.useRef(null),[X,R]=C.useState(null),[fe,ne]=C.useState(null),J=C.useRef(null),ge=C.useRef(null),[ee,le]=C.useState(null);C.useEffect(()=>{var ye;p&&((ye=H.current)==null||ye.focus())},[p]),C.useEffect(()=>{var ye;ie&&((ye=te.current)==null||ye.focus())},[ie]),C.useEffect(()=>{if(!A)return;function ye(pe){W.current&&!W.current.contains(pe.target)&&F(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[A]),C.useEffect(()=>{if(!j)return;function ye(pe){Y.current&&!Y.current.contains(pe.target)&&B(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[j]),C.useEffect(()=>{if(X===null)return;function ye(pe){J.current&&!J.current.contains(pe.target)&&R(null)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[X]),C.useEffect(()=>{if(fe===null)return;function ye(pe){ge.current&&!ge.current.contains(pe.target)&&ne(null)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[fe]);const xe=Za({mutationFn:ye=>xt.createChartEvent(ye),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),Ye()}}),ve=Za({mutationFn:ye=>xt.deleteChartEvent(ye),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),je=Za({mutationFn:({index:ye,event:pe})=>xt.updateChartEvent(ye,pe),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),se(null),G(null)}});function Ye(){y(!1),b(""),k(""),E(""),S(""),M(!1),I(""),F(!1),B(!1)}function et(){!O.trim()||!g.trim()||xe.mutate({date:O.trim(),label:g.trim(),..._.trim()?{description:_.trim()}:{},...T.trim()?{color:T.trim()}:{},...D&&N.trim()?{endDate:N.trim()}:{},charts:[s]})}function nt(ye){return r.findIndex(pe=>pe.date===ye.date&&pe.label===ye.label&&(pe.description??"")===(ye.description??"")&&(pe.endDate??"")===(ye.endDate??""))}function Je(ye){le(ye)}function rt(){if(!ee)return;const ye=nt(ee);ye!==-1&&(ve.mutate(ye),le(null))}function ut(ye){if(V===null||!ie)return;const pe=nt(ye);if(pe===-1)return;const Ae=ye[ie]??"";if(de===Ae){se(null),G(null);return}je.mutate({index:pe,event:{...ye,[ie]:de}})}return e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),d.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[400px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Events"}),n.length>0&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.length})]}),d.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:"Show on chart"}),d.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:"Display event markers as dashed lines"})]}),d.jsx("button",{onClick:u,className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:l?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:l?22:2}})})]}),i&&!p&&d.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-sm rounded border border-dashed transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-primary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add event"]}),p&&d.jsxs("div",{className:"p-3 rounded space-y-2",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"text-xs font-medium mb-2",style:{color:"var(--yc-color-text-secondary)"},children:"New event"}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>F(!A),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:O?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:O||(D?"Start date":"Select date")}),A&&d.jsxs("div",{ref:W,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:O?ks(O,"yyyy-MM-dd",new Date):void 0,onSelect:ye=>{ye&&(k(dn(ye,"yyyy-MM-dd")),F(!1))}})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),d.jsx("button",{onClick:()=>{M(!D),D&&(I(""),B(!1))},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:D?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:D?22:2}})})]}),D&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>B(!j),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:N?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:N||"End date"}),j&&d.jsxs("div",{ref:Y,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:N?ks(N,"yyyy-MM-dd",new Date):void 0,onSelect:ye=>{ye&&(I(dn(ye,"yyyy-MM-dd")),B(!1))}})]})]}),d.jsx("input",{ref:H,type:"text",value:g,onChange:ye=>b(ye.target.value),onKeyDown:ye=>{ye.key==="Enter"&&et(),ye.key==="Escape"&&Ye()},placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{children:[d.jsx("textarea",{value:_,onChange:ye=>S(ye.target.value),onKeyDown:ye=>{ye.key==="Escape"&&Ye()},placeholder:"Description (optional)",rows:2,className:"w-full px-2 py-1.5 text-sm rounded border resize-y",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{className:"text-[10px] mt-0.5",style:{color:"var(--yc-color-text-muted)"},children:["Supports ",d.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:"Markdown"})]})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),d.jsx(sm,{value:T,onChange:E,themePalette:f})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[d.jsx("button",{onClick:Ye,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),d.jsx("button",{onClick:et,disabled:!O.trim()||!g.trim()||xe.isPending,className:"px-2 py-1 text-xs rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:xe.isPending?"Saving...":"Save"})]})]}),n.length===0?d.jsxs("div",{className:"text-center py-8",children:[d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No events for this chart"}),d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Events appear as dashed vertical lines on the chart"})]}):d.jsx("div",{className:"space-y-1",children:n.map((ye,pe)=>d.jsxs("div",{className:"group flex items-start gap-3 p-3 rounded transition-colors hover:bg-black/[0.03]",style:{border:"1px solid transparent"},children:[i?d.jsx("div",{className:"flex-shrink-0 mt-0.5",children:d.jsx(sm,{value:ye.color??"",onChange:Ae=>{const Pe=nt(ye);Pe!==-1&&je.mutate({index:Pe,event:{...ye,...Ae?{color:Ae}:{color:void 0}}})},themePalette:f,compact:!0})}):d.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:ye.color||"#6366f1"}}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"text-xs relative flex items-center gap-1",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),R(X===pe?null:pe),ne(null))},children:ye.date}),X===pe&&d.jsxs("div",{ref:J,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(ye.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(ye.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(R(null),Pe===ye.date)return;const ct=nt(ye);ct!==-1&&je.mutate({index:ct,event:{...ye,date:Pe}})}})]}),ye.endDate&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"→"}),d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),ne(fe===pe?null:pe),R(null))},children:ye.endDate}),fe===pe&&d.jsxs("div",{ref:ge,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(ye.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(ye.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(ne(null),Pe===ye.endDate)return;const ct=nt(ye);ct!==-1&&je.mutate({index:ct,event:{...ye,endDate:Pe}})}})]})]})]}),V===pe&&ie==="label"?d.jsx("input",{ref:te,type:"text",value:de,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(ye),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(ye),Ae.key==="Escape"&&(se(null),G(null))},className:"w-full py-0 text-sm font-medium border-0 border-b outline-none",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-sm font-medium truncate",style:{color:"var(--yc-color-text)",cursor:i?"pointer":"default"},onClick:()=>{i&&(se(pe),G("label"),P(ye.label))},children:ye.label}),V===pe&&ie==="description"?d.jsx("input",{ref:te,type:"text",value:de,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(ye),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(ye),Ae.key==="Escape"&&(se(null),G(null))},placeholder:"Add description",className:"w-full py-0 text-xs border-0 border-b outline-none mt-0.5",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:ye.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(se(pe),G("description"),P(ye.description??""))},children:ye.description||(i?"Add description":"")}),ye.charts&&ye.charts.length>0&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:ye.charts.length===1&&ye.charts[0]===s?"This chart only":`${ye.charts.length} charts`})]}),i&&d.jsx("button",{onClick:()=>Je(ye),className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-black/5 transition-all flex-shrink-0",style:{color:"var(--yc-color-danger, #ef4444)"},title:"Delete event",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]},`${ye.date}-${ye.label}-${pe}`))})]})]}),d.jsx(x6,{open:ee!==null,title:"Delete event",message:`Delete "${ee==null?void 0:ee.label}"? This cannot be undone.`,onConfirm:rt,onCancel:()=>le(null)})]}):null}async function v6(e,t,n="png"){const{default:r}=await Yr(async()=>{const{default:l}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:l}},[]),i=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);rd(i,`${t}.${n}`)}async function E6(e,t,n){const[{default:r},{jsPDF:s}]=await Promise.all([Yr(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Yr(()=>import("./jspdf.es.min-CTZVk96E.js").then(D=>D.j),[])]),i=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=i.toDataURL("image/png"),u=i.width,f=i.height,p=u/f>1,y=new s({orientation:p?"landscape":"portrait",unit:"mm"}),g=y.internal.pageSize.getWidth(),b=y.internal.pageSize.getHeight();let O=0;n&&(O=8,y.setFontSize(16),y.text(n,g/2,O,{align:"center"}),O=14);const k=g,T=b-O;let E=k,_=f/u*E;_>T&&(_=T,E=u/f*_);const S=(g-E)/2;y.addImage(l,"PNG",S,O,E,_),y.save(`${t}.pdf`)}async function T6(e,t,n){const{jsPDF:r}=await Yr(async()=>{const{jsPDF:T}=await import("./jspdf.es.min-CTZVk96E.js").then(E=>E.j);return{jsPDF:T}},[]),s=new Image;s.src=e,await new Promise(T=>{s.onload=T});const l=s.width/s.height>1.2,u=new r({orientation:l?"landscape":"portrait",unit:"mm"}),f=u.internal.pageSize.getWidth(),h=u.internal.pageSize.getHeight();let p=15;n&&(u.setFontSize(14),u.text(n,f/2,10,{align:"center"}));const y=f-20,g=h-p-15;let b=y,O=s.height/s.width*b;O>g&&(O=g,b=s.width/s.height*O);const k=(f-b)/2;u.addImage(e,"PNG",k,p,b,O),u.save(`${t}.pdf`)}function Ad(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),s=e.map(l=>t.map(u=>{const f=l[u.name];if(f==null)return"";const h=String(f);return h.includes(",")||h.includes('"')||h.includes(`
92
+ `;function b6({isOpen:e,onClose:t,events:n,allEvents:r,chartName:s,canEdit:i,eventsVisible:l,onToggleVisible:u,themePalette:f}){const h=qn(),[p,y]=C.useState(!1),[g,b]=C.useState(""),[O,k]=C.useState(""),[T,E]=C.useState(""),[_,S]=C.useState(""),[D,M]=C.useState(!1),[N,I]=C.useState(""),[A,F]=C.useState(!1),[j,B]=C.useState(!1),H=C.useRef(null),W=C.useRef(null),Y=C.useRef(null),[V,se]=C.useState(null),[ie,G]=C.useState(null),[de,P]=C.useState(""),te=C.useRef(null),[X,R]=C.useState(null),[fe,ne]=C.useState(null),J=C.useRef(null),ge=C.useRef(null),[ee,le]=C.useState(null);C.useEffect(()=>{var ye;p&&((ye=H.current)==null||ye.focus())},[p]),C.useEffect(()=>{var ye;ie&&((ye=te.current)==null||ye.focus())},[ie]),C.useEffect(()=>{if(!A)return;function ye(pe){W.current&&!W.current.contains(pe.target)&&F(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[A]),C.useEffect(()=>{if(!j)return;function ye(pe){Y.current&&!Y.current.contains(pe.target)&&B(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[j]),C.useEffect(()=>{if(X===null)return;function ye(pe){J.current&&!J.current.contains(pe.target)&&R(null)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[X]),C.useEffect(()=>{if(fe===null)return;function ye(pe){ge.current&&!ge.current.contains(pe.target)&&ne(null)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[fe]);const xe=Za({mutationFn:ye=>xt.createChartEvent(ye),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),Ye()}}),ve=Za({mutationFn:ye=>xt.deleteChartEvent(ye),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),je=Za({mutationFn:({index:ye,event:pe})=>xt.updateChartEvent(ye,pe),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),se(null),G(null)}});function Ye(){y(!1),b(""),k(""),E(""),S(""),M(!1),I(""),F(!1),B(!1)}function et(){!O.trim()||!g.trim()||xe.mutate({date:O.trim(),label:g.trim(),..._.trim()?{description:_.trim()}:{},...T.trim()?{color:T.trim()}:{},...D&&N.trim()?{endDate:N.trim()}:{},charts:[s]})}function nt(ye){return r.findIndex(pe=>pe.date===ye.date&&pe.label===ye.label&&(pe.description??"")===(ye.description??"")&&(pe.endDate??"")===(ye.endDate??""))}function Je(ye){le(ye)}function rt(){if(!ee)return;const ye=nt(ee);ye!==-1&&(ve.mutate(ye),le(null))}function ut(ye){if(V===null||!ie)return;const pe=nt(ye);if(pe===-1)return;const Ae=ye[ie]??"";if(de===Ae){se(null),G(null);return}je.mutate({index:pe,event:{...ye,[ie]:de}})}return e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),d.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[400px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Events"}),n.length>0&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.length})]}),d.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:"Show on chart"}),d.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:"Display event markers as dashed lines"})]}),d.jsx("button",{onClick:u,className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:l?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:l?22:2}})})]}),i&&!p&&d.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-sm rounded border border-dashed transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-primary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add event"]}),p&&d.jsxs("div",{className:"p-3 rounded space-y-2",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"text-xs font-medium mb-2",style:{color:"var(--yc-color-text-secondary)"},children:"New event"}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>F(!A),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:O?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:O||(D?"Start date":"Select date")}),A&&d.jsxs("div",{ref:W,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:O?ks(O,"yyyy-MM-dd",new Date):void 0,onSelect:ye=>{ye&&(k(dn(ye,"yyyy-MM-dd")),F(!1))}})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),d.jsx("button",{onClick:()=>{M(!D),D&&(I(""),B(!1))},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:D?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:D?22:2}})})]}),D&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>B(!j),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:N?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:N||"End date"}),j&&d.jsxs("div",{ref:Y,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:N?ks(N,"yyyy-MM-dd",new Date):void 0,onSelect:ye=>{ye&&(I(dn(ye,"yyyy-MM-dd")),B(!1))}})]})]}),d.jsx("input",{ref:H,type:"text",value:g,onChange:ye=>b(ye.target.value),onKeyDown:ye=>{ye.key==="Enter"&&et(),ye.key==="Escape"&&Ye()},placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{children:[d.jsx("textarea",{value:_,onChange:ye=>S(ye.target.value),onKeyDown:ye=>{ye.key==="Escape"&&Ye()},placeholder:"Description (optional)",rows:2,className:"w-full px-2 py-1.5 text-sm rounded border resize-y",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{className:"text-[10px] mt-0.5",style:{color:"var(--yc-color-text-muted)"},children:["Supports ",d.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:"Markdown"})]})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),d.jsx(sm,{value:T,onChange:E,themePalette:f})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[d.jsx("button",{onClick:Ye,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),d.jsx("button",{onClick:et,disabled:!O.trim()||!g.trim()||xe.isPending,className:"px-2 py-1 text-xs rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:xe.isPending?"Saving...":"Save"})]})]}),n.length===0?d.jsxs("div",{className:"text-center py-8",children:[d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No events for this chart"}),d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Events appear as dashed vertical lines on the chart"})]}):d.jsx("div",{className:"space-y-1",children:n.map((ye,pe)=>d.jsxs("div",{className:"group flex items-start gap-3 p-3 rounded transition-colors hover:bg-black/[0.03]",style:{border:"1px solid transparent"},children:[i?d.jsx("div",{className:"flex-shrink-0 mt-0.5",children:d.jsx(sm,{value:ye.color??"",onChange:Ae=>{const Pe=nt(ye);Pe!==-1&&je.mutate({index:Pe,event:{...ye,...Ae?{color:Ae}:{color:void 0}}})},themePalette:f,compact:!0})}):d.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:ye.color||"#6366f1"}}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"text-xs relative flex items-center gap-1",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),R(X===pe?null:pe),ne(null))},children:ye.date}),X===pe&&d.jsxs("div",{ref:J,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(ye.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(ye.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(R(null),Pe===ye.date)return;const ct=nt(ye);ct!==-1&&je.mutate({index:ct,event:{...ye,date:Pe}})}})]}),ye.endDate&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"→"}),d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),ne(fe===pe?null:pe),R(null))},children:ye.endDate}),fe===pe&&d.jsxs("div",{ref:ge,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(ye.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(ye.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(ne(null),Pe===ye.endDate)return;const ct=nt(ye);ct!==-1&&je.mutate({index:ct,event:{...ye,endDate:Pe}})}})]})]})]}),V===pe&&ie==="label"?d.jsx("input",{ref:te,type:"text",value:de,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(ye),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(ye),Ae.key==="Escape"&&(se(null),G(null))},className:"w-full py-0 text-sm font-medium border-0 border-b outline-none",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-sm font-medium truncate",style:{color:"var(--yc-color-text)",cursor:i?"pointer":"default"},onClick:()=>{i&&(se(pe),G("label"),P(ye.label))},children:ye.label}),V===pe&&ie==="description"?d.jsx("input",{ref:te,type:"text",value:de,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(ye),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(ye),Ae.key==="Escape"&&(se(null),G(null))},placeholder:"Add description",className:"w-full py-0 text-xs border-0 border-b outline-none mt-0.5",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:ye.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(se(pe),G("description"),P(ye.description??""))},children:ye.description||(i?"Add description":"")}),ye.charts&&ye.charts.length>0&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:ye.charts.length===1&&ye.charts[0]===s?"This chart only":`${ye.charts.length} charts`})]}),i&&d.jsx("button",{onClick:()=>Je(ye),className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-black/5 transition-all flex-shrink-0",style:{color:"var(--yc-color-danger, #ef4444)"},title:"Delete event",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]},`${ye.date}-${ye.label}-${pe}`))})]})]}),d.jsx(x6,{open:ee!==null,title:"Delete event",message:`Delete "${ee==null?void 0:ee.label}"? This cannot be undone.`,onConfirm:rt,onCancel:()=>le(null)})]}):null}async function v6(e,t,n="png"){const{default:r}=await Yr(async()=>{const{default:l}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:l}},[]),i=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);rd(i,`${t}.${n}`)}async function E6(e,t,n){const[{default:r},{jsPDF:s}]=await Promise.all([Yr(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Yr(()=>import("./jspdf.es.min-ChRx2mOQ.js").then(D=>D.j),[])]),i=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=i.toDataURL("image/png"),u=i.width,f=i.height,p=u/f>1,y=new s({orientation:p?"landscape":"portrait",unit:"mm"}),g=y.internal.pageSize.getWidth(),b=y.internal.pageSize.getHeight();let O=0;n&&(O=8,y.setFontSize(16),y.text(n,g/2,O,{align:"center"}),O=14);const k=g,T=b-O;let E=k,_=f/u*E;_>T&&(_=T,E=u/f*_);const S=(g-E)/2;y.addImage(l,"PNG",S,O,E,_),y.save(`${t}.pdf`)}async function T6(e,t,n){const{jsPDF:r}=await Yr(async()=>{const{jsPDF:T}=await import("./jspdf.es.min-ChRx2mOQ.js").then(E=>E.j);return{jsPDF:T}},[]),s=new Image;s.src=e,await new Promise(T=>{s.onload=T});const l=s.width/s.height>1.2,u=new r({orientation:l?"landscape":"portrait",unit:"mm"}),f=u.internal.pageSize.getWidth(),h=u.internal.pageSize.getHeight();let p=15;n&&(u.setFontSize(14),u.text(n,f/2,10,{align:"center"}));const y=f-20,g=h-p-15;let b=y,O=s.height/s.width*b;O>g&&(O=g,b=s.width/s.height*O);const k=(f-b)/2;u.addImage(e,"PNG",k,p,b,O),u.save(`${t}.pdf`)}function Ad(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),s=e.map(l=>t.map(u=>{const f=l[u.name];if(f==null)return"";const h=String(f);return h.includes(",")||h.includes('"')||h.includes(`
93
93
  `)?`"${h.replace(/"/g,'""')}"`:h})),i=[r.join(","),...s.map(l=>l.join(","))].join(`
94
94
  `);L2(i,`${n}.csv`,"text/csv;charset=utf-8;")}function w6(e,t){const n=JSON.stringify(e,null,2);L2(n,`${t}.json`,"application/json;charset=utf-8;")}function rd(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function L2(e,t,n){const r=new Blob([e],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}const Ka=50;function R2({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:s}){const[i,l]=C.useState(null),[u,f]=C.useState(0),h=C.useMemo(()=>n&&n.length>0?n.map(_=>({field:_.field,label:_.label??_.field,format:_.format})):t.map(_=>({field:_.name,label:_.name,format:void 0})),[n,t]),p=C.useMemo(()=>{if(!i)return e;const{field:_,direction:S}=i;return[...e].sort((D,M)=>{const N=D[_],I=M[_];if(N==null&&I==null)return 0;if(N==null)return 1;if(I==null)return-1;if(typeof N=="number"&&typeof I=="number")return S==="asc"?N-I:I-N;const A=String(N),F=String(I);return S==="asc"?A.localeCompare(F):F.localeCompare(A)})},[e,i]),y=Math.ceil(p.length/Ka),g=p.slice(u*Ka,(u+1)*Ka),b=u*Ka+1,O=Math.min((u+1)*Ka,p.length),k=_=>{l(S=>!S||S.field!==_?{field:_,direction:"asc"}:S.direction==="asc"?{field:_,direction:"desc"}:null),f(0)},T=(_,S)=>_==null?"":S&&typeof _=="number"?S.includes("$")?`$${_.toLocaleString()}`:S.includes("%")?`${_.toFixed(1)}%`:_.toLocaleString():String(_),E=_=>!i||i.field!==_?"":i.direction==="asc"?" ↑":" ↓";return d.jsxs("div",{className:"border rounded-lg overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",p.length," rows filtered by ",r]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>Ad(e,t,`${s}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export CSV"}),d.jsx("button",{onClick:()=>w6(e,`${s}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export JSON"})]})]}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm yc-table",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsx("th",{className:"px-3 py-2 text-right font-medium select-none w-10",style:{color:"var(--yc-color-text-muted)"},children:"#"}),h.map(_=>d.jsxs("th",{className:"px-4 py-2 text-left font-medium cursor-pointer hover:bg-black/5 select-none",style:{color:"var(--yc-color-text)"},onClick:()=>k(_.field),children:[_.label,E(_.field)]},_.field))]})}),d.jsx("tbody",{children:g.map((_,S)=>d.jsxs("tr",{style:{backgroundColor:S%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:[d.jsx("td",{className:"px-3 py-2 text-right yc-row-num w-10",style:{backgroundColor:S%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:u*Ka+S+1}),h.map(D=>d.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:T(_[D.field],D.format)},D.field))]},S))})]})}),y>1&&d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",b,"-",O," of ",p.length]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>f(_=>Math.max(0,_-1)),disabled:u===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),d.jsx("button",{onClick:()=>f(_=>Math.min(y-1,_+1)),disabled:u>=y-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]})}class sd extends C.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error,()=>this.setState({error:null})):this.props.children}}function k6(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function S6(e){return e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,n,r)=>{const i=!r.startsWith("#")?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${r}" style="color: #6366f1; text-decoration: underline;"${i}>${n}</a>`})}function Id(e,t,n){const r=e.filter(s=>{if(s.date===t)return!0;if(s.endDate&&n&&n.length>0){let i=n.indexOf(s.date),l=n.indexOf(s.endDate);const u=n.indexOf(t);if(i===-1&&(i=0),l===-1&&(l=n.length-1),u!==-1)return u>=i&&u<=l}return!1});return r.length===0?"":r.map(s=>{const i=s.color??"#6366f1",l=s.endDate?`${s.date} → ${s.endDate}`:"",u=s.description?k6(s.description,100):"",f=u?`<div style="font-size: 11px; color: #888; margin-top: 2px;">${S6(u)}</div>`:"",h=l?`<div style="font-size: 10px; color: #999; margin-top: 1px;">${l}</div>`:"";return`<div style="margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e5e7eb;"><span style="display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: ${i}; margin-right: 6px;"></span><span style="font-weight: 500;">${s.label}</span>${h}${f}</div>`}).join("")}function Md(e,t,n){let r=e.filter(s=>!s.endDate);if(n&&n.length>0&&(r=r.filter(s=>n.includes(s.date))),r.length!==0)return{silent:!0,symbol:"none",tooltip:{show:!1},data:r.map(s=>{const i=s.color??t;return{xAxis:s.date,label:{formatter:s.label,position:"insideEndTop",fontSize:11,color:i,backgroundColor:"rgba(99, 102, 241, 0.12)",padding:[2,6],borderRadius:3},lineStyle:{type:"dashed",color:i,width:1},emphasis:{disabled:!0}}})}}function Ld(e,t,n){const r=e.filter(l=>l.endDate);if(r.length===0)return[];const s=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];return r.flatMap(l=>{let u=l.date,f=l.endDate;if(n&&n.length>0&&s&&i){const p=n.indexOf(u),y=n.indexOf(f);p===-1&&(u=s),y===-1&&(f=i);const g=n.indexOf(u),b=n.indexOf(f);if(g>b)return[]}const h=l.color??t;return[[{xAxis:u,itemStyle:{color:h,opacity:.1},label:{show:!0,formatter:l.label,position:"insideTop",fontSize:11,color:h,padding:[2,6]}},{xAxis:f}]]})}const np="#22c55e",P2="dashed";function C6(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e.toLocaleString()}function j2(e){return e.type==="fixed"}function N6(e){return e.type==="cumulative"}function _6(e){return e.type==="model"}function Rd(e,t){const n=[];for(const r of e){const s=r.color??np,i=r.style??P2;if(j2(r)){const l=C6(r.value);n.push({yAxis:r.value,label:{formatter:r.label?`${r.label}: ${l}`:l,position:"insideEndTop",fontSize:11,color:s,backgroundColor:"rgba(255,255,255,0.85)",padding:[2,6],borderRadius:2},lineStyle:{color:s,type:i,width:2}})}if(N6(r)){const l=r.from?t.indexOf(r.from):0,u=r.by?t.indexOf(r.by):t.length-1,f=Math.max(0,l===-1?0:l),h=u===-1?t.length-1:u;n.push([{coord:[f,0],label:{formatter:r.label??"",position:"insideEndTop",fontSize:11,color:s},lineStyle:{color:s,type:i,width:2}},{coord:[h,r.value]}])}}return n}function Pd(e,t){const n=[];for(const r of e){if(!r.zone)continue;const s=r.color??np;if(j2(r)){const i=r.value*(1-r.zone.tolerance),l=r.value*(1+r.zone.tolerance);n.push([{yAxis:i,itemStyle:{color:s,opacity:.08}},{yAxis:l}])}}return n}function jd(e,t){const n=[];for(const r of e){if(!_6(r)||!t)continue;const s=r.color??np,i=r.style??P2,l=t.rows.map(u=>{const f=u[r.source.value_field];return typeof f=="number"?f:parseFloat(String(f))||0});n.push({name:r.label??"Goal",data:l,color:s,lineStyle:{type:i,width:2,color:s},showSymbol:!1,z:5})}return n}const od="#22c55e",ad="#ef4444";function F2(e){return e.type==="fixed"}function B2(e){return e.type==="cumulative"}function D6(e,t){const n=t.find(F2);return n?e>=n.value?od:ad:null}function O6(e,t,n,r){const s=r.find(B2);if(!s||n===0)return null;const i=s.value/n*(t+1);return e>=i?od:ad}function A6(e,t){const n=t.find(F2);if(n)return e.map(s=>({value:s,itemStyle:{color:s>=n.value?od:ad}}));const r=t.find(B2);if(r){const s=e.length;return e.map((i,l)=>{const u=r.value/s*(l+1);return{value:i,itemStyle:{color:i>=u?od:ad}}})}return e}function H2(e,t){if(e.length===0||t.length===0)return null;const n=e[e.length-1],r=D6(n,t);return r||O6(n,e.length-1,e.length,t)}function I6(e,t){return e.map((n,r)=>{const s=Math.max(0,r-t+1);let i=0,l=0;for(let u=s;u<=r;u++)e[u]!=null&&(i+=e[u],l++);return l>0?i/l:null})}function M6(e){return"field"in e}function L6(e){return"columns"in e}function c0(e){if(e.length===0)return e;const t=e[0].data.length;for(let n=0;n<t;n++){let r=0;for(const s of e)r+=s.data[n]??0;for(const s of e)s.data[n]!=null&&(s.data[n]=r===0?0:s.data[n]/r*100)}return e}function Fd(e,t,n){var s,i,l;const r=t.stacking?"total":void 0;if(!t.series){const u=((s=t.y)==null?void 0:s.field)??"",f=e.map(p=>{const y=p[u];return typeof y=="number"?y:parseFloat(String(y))||0}),h=[{name:u,data:f,color:da(0,void 0,n),stack:r}];return t.stacking==="percent"?c0(h):h}if(M6(t.series)){const u=t.series.field,f=t.series.colors,h=((i=t.y)==null?void 0:i.field)??"",p=(l=t.x)==null?void 0:l.field,y=[],g=new Map;if(p)for(const T of e){const E=T[p];g.has(E)||(g.set(E,y.length),y.push(E))}const b=[],O=new Map;e.forEach(T=>{const E=String(T[u]??"");O.has(E)||(b.push(E),O.set(E,p?new Array(y.length).fill(null):[]));const _=T[h],S=typeof _=="number"?_:parseFloat(String(_))||0;if(p){const D=g.get(T[p]);O.get(E)[D]=S}else O.get(E).push(S)});const k=b.map((T,E)=>({name:T,data:O.get(T),color:n2(T,E,f,n),stack:r}));return t.stacking==="percent"?c0(k):k}if(L6(t.series)){const u=t.series.columns.map((f,h)=>{var y;let p=e.map(g=>{const b=g[f.field];return b==null?null:typeof b=="number"?b:parseFloat(String(b))||0});return((y=f.transform)==null?void 0:y.type)==="rolling_average"&&f.transform.window>0&&(p=I6(p,f.transform.window)),{name:f.name??f.field,data:p,color:da(h,f.color,n),opacity:f.opacity,style:f.style,gradient:f.gradient,stack:r,chartType:f.type,yAxisIndex:f.axis==="right"?1:f.axis==="left"?0:void 0,band:f.band}});return t.stacking==="percent"?c0(u):u}return[]}function id(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})[T ]00:00:00(?:\.0+)?(?:Z|[+-]\d{2}:?\d{2})?$/);return E1(t?t[1]:e)}function R6(e){return e.replace(/'/g,"''").replace(/%Y/g,"yyyy").replace(/%y/g,"yy").replace(/%m/g,"MM").replace(/%b/g,"MMM").replace(/%B/g,"MMMM").replace(/%d/g,"dd").replace(/%H/g,"HH").replace(/%I/g,"hh").replace(/%M/g,"mm").replace(/%S/g,"ss").replace(/%p/g,"a").replace(/%P/g,"a")}function U2(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function P6(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(u=>u.getTime()).sort((u,f)=>u-f),n=t[0],r=t[t.length-1],s=(r-n)/(1e3*60*60*24);return s<2?"MMM dd, h:mm a":s<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":s<=730?"MMM yyyy":"yyyy"}function j6(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,s)=>r-s),n=(t[t.length-1]-t[0])/((t.length-1)*864e5);return n<1?"MMM dd, yyyy h:mm a":n<28?"MMM dd, yyyy":"MMM yyyy"}function Bd(e,t){const n=new Set,r=e.filter(l=>{const u=l[t.field];return n.has(u)?!1:(n.add(u),!0)});if(t.type!=="temporal")return r.map(l=>String(l[t.field]??""));const s=[];for(const l of r){const u=l[t.field];if(typeof u=="string")try{s.push(id(u))}catch{}}const i=s.length>0?j6(s):"MMM dd, yyyy";return r.map(l=>{const u=l[t.field];if(typeof u=="string")try{const f=id(u);return t.format==="quarter"?U2(f):dn(f,i)}catch{return String(u??"")}return String(u??"")})}function Hd(e,t){const n=new Set,r=e.filter(s=>{const i=s[t.field];return n.has(i)?!1:(n.add(i),!0)});return Ps(r,t)}function Ps(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const s of e){const i=s[t.field];if(typeof i=="string")try{r.push(id(i))}catch{}}r.length>0&&(n=P6(r))}return e.map(r=>{const s=r[t.field];if(t.type==="temporal"&&typeof s=="string")try{const i=id(s);if(t.format==="quarter")return U2(i);const l=t.format?R6(t.format):n??"MMM yyyy";return dn(i,l)}catch{return String(s??"")}return String(s??"")})}function ko(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function F6(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Ud(e,t){if(!t)return null;if(typeof t=="object")return{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:t.from},{offset:1,color:t.to}]};const n=F6(e);return n?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.4)`},{offset:1,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.05)`}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e},{offset:1,color:"rgba(0,0,0,0)"}]}}function zd(){return 40}function cs(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],barBorderRadiusHorizontal:[0,4,4,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],barBorderRadiusHorizontal:[0,0,0,0],pieBorderRadius:0}}function Wd(e,t){const n=[];for(const r of e)r.type==="line"?n.push({yAxis:r.value,label:{show:!!r.label,formatter:r.label??"",position:"insideEndTop",color:r.color??t,fontSize:11},lineStyle:{color:r.color??"#999",type:r.style??"dashed",width:1.5}}):r.type==="x_line"&&n.push({xAxis:r.x,label:{show:!!r.label,formatter:r.label??"",position:"insideEndTop",color:r.color??t,fontSize:11},lineStyle:{color:r.color??"#999",type:r.style??"dashed",width:1.5}});return n}function Yd(e){const t=[];for(const n of e)n.type==="band"&&t.push([{yAxis:n.from,itemStyle:{color:n.color??"rgba(150, 150, 150, 0.1)"},label:n.label?{show:!0,position:"insideTop",formatter:n.label,fontSize:11}:void 0},{yAxis:n.to}]);return t}const z2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,onChartClick:f,events:h,goalData:p,compareData:y},g){var Y,V,se,ie,G,de,P,te;const b=Ar(),O=(s==null?void 0:s.series)&&"field"in s.series,k=O?Hd(t,n):Ps(t,n),T=n.type==="temporal"?Bd(t,n):k,E=C.useMemo(()=>{if(O){const X=new Set;return t.filter(R=>{const fe=R[n.field];return X.has(fe)?!1:(X.add(fe),!0)}).map(R=>R[n.field])}return t.map(X=>X[n.field])},[t,n.field,O]),_=C.useMemo(()=>{if(f)return{contextmenu:X=>{var ee,le,xe,ve;const R=X;if(R.componentType!=="series")return;const fe=R.dataIndex!=null?E[R.dataIndex]:void 0,ne=fe!=null?String(fe):R.name;if(ne==null||ne==="")return;const J=((le=(ee=R.event)==null?void 0:ee.event)==null?void 0:le.clientX)??0,ge=((ve=(xe=R.event)==null?void 0:xe.event)==null?void 0:ve.clientY)??0;f(n.field,ne,{x:J,y:ge},R.seriesName)}}},[f,n.field,E]);let S,D,M;if(s){const X=Fd(t,{type:s.type,x:{field:n.field},y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),R=cs(i),fe=new Set;for(const J of X)J.band&&fe.add(J.name);const ne=[];for(const J of X){const ge=Ud(J.color,J.gradient??s.gradient);if(J.band){const ee=X.find(le=>le.name===J.band);if(ee){const le=`_band_${J.name}`;ne.push({type:"line",name:`${J.name} (lower)`,data:J.data.map((ve,je)=>{const Ye=ve??0,et=ee.data[je]??0;return Math.min(Ye,et)}),smooth:R.smooth,symbol:"none",lineStyle:{width:0,opacity:0},itemStyle:{color:"transparent"},areaStyle:{color:"transparent"},stack:le,silent:!0});const xe=J.opacity??.2;ne.push({type:"line",name:`${J.name} (band)`,data:J.data.map((ve,je)=>{const Ye=ve??0,et=ee.data[je]??0;return Math.abs(et-Ye)}),smooth:R.smooth,symbol:"none",lineStyle:{width:0,opacity:0},itemStyle:{color:J.color},areaStyle:{color:J.color,opacity:xe},stack:le,silent:!0});continue}}X.some(ee=>ee.band===J.name)||ne.push({type:"line",name:J.name,data:J.data,smooth:R.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:J.color,type:J.style==="dashed"?"dashed":J.style==="dotted"?"dotted":"solid"},itemStyle:{color:J.color},areaStyle:ge?{color:ge}:void 0,stack:J.stack,...J.opacity!==void 0?{opacity:J.opacity}:{}})}S=ne,X.length>1&&(D={show:((Y=s.legend)==null?void 0:Y.show)!==!1,...((V=s.legend)==null?void 0:V.position)==="top"?{top:0}:((se=s.legend)==null?void 0:se.position)==="left"?{left:0,orient:"vertical"}:((ie=s.legend)==null?void 0:ie.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(G=s.interactions)!=null&&G.zoom&&(M=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const X=(r==null?void 0:r.field)??"";S=[{type:"line",data:t.map(fe=>{const ne=fe[X];return typeof ne=="number"?ne:parseFloat(String(ne))||0}),smooth:cs(i).smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:"#3B82F6"},itemStyle:{color:"#3B82F6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(59, 130, 246, 0.2)"},{offset:1,color:"rgba(59, 130, 246, 0)"}]}}}]}const N=(s==null?void 0:s.goals)??[];if(N.length>0&&Array.isArray(S)){const X=H2(((de=S[0])==null?void 0:de.data)??[],N);X&&S[0]&&(S[0].lineStyle={...S[0].lineStyle,color:X},S[0].itemStyle={color:X});const R=Rd(N,k),fe=Pd(N);if(R.length>0&&S[0]){const J=S[0].markLine,ge=(J==null?void 0:J.data)??[];S[0].markLine={...J,silent:!0,symbol:"none",data:[...ge,...R]}}fe.length>0&&S[0]&&(S[0].markArea={silent:!0,data:fe});const ne=jd(N,p);for(const J of ne)S.push({type:"line",name:J.name,data:J.data,z:J.z,showSymbol:J.showSymbol,lineStyle:J.lineStyle,itemStyle:{color:J.color}})}const I=s==null?void 0:s.compare;if(y&&y.length>0&&I&&Array.isArray(S)){const X=(r==null?void 0:r.field)??"",R=["#94A3B8","#CBD5E1","#E2E8F0"];for(let fe=0;fe<y.length;fe++){const ne=y[fe],J=I[fe],ge=(J==null?void 0:J.color)??R[fe%R.length],ee=ne.rows.map(le=>{const xe=le[X];return typeof xe=="number"?xe:parseFloat(String(xe))||0});S.push({type:"line",name:ne.label,data:ee,smooth:cs(i).smooth,symbol:"none",lineStyle:{width:1.5,color:ge,type:(J==null?void 0:J.style)??"dashed"},itemStyle:{color:ge},opacity:(J==null?void 0:J.opacity)??.5})}}const A=s==null?void 0:s.annotations;if(A&&A.length>0&&Array.isArray(S)&&S[0]){const X=Wd(A,b.textColor),R=Yd(A);if(X.length>0){const fe=S[0].markLine,ne=(fe==null?void 0:fe.data)??[];S[0].markLine={...fe,silent:!0,symbol:"none",data:[...ne,...X]}}if(R.length>0){const fe=S[0].markArea,ne=(fe==null?void 0:fe.data)??[];S[0].markArea={silent:!0,data:[...ne,...R]}}}const F=C.useMemo(()=>{if(!(h!=null&&h.length))return[];const R=h.flatMap(ge=>ge.endDate?[ge.date,ge.endDate]:[ge.date]).map(ge=>({[n.field]:ge})),ne=Ps([...t,...R],n).slice(t.length);let J=0;return h.map(ge=>{const ee={...ge,date:ne[J++]??ge.date};return ge.endDate&&(ee.endDate=ne[J++]??ge.endDate),ee})},[h,t,n]),j=Array.isArray(S)?S.filter(X=>X.name&&!X.silent).map(X=>X.name):[],B=Md(F,b.textColor,k),H=Ld(F,b.textColor,k);if((B||H.length>0)&&Array.isArray(S)){const X={type:"line",data:((P=S[0])==null?void 0:P.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};B&&(X.markLine=B),H.length>0&&(X.markArea={silent:!0,data:H}),S.push(X)}const W={tooltip:{trigger:"axis",formatter:X=>{const R=X;if(!Array.isArray(R)||R.length===0)return"";let ne=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${T[R[0].dataIndex]??R[0].name}</div>`;for(const J of R)ne+=`<div>${J.marker} ${J.seriesName}: ${ko(J.value,r==null?void 0:r.format)}</div>`;return ne+=Id(F,R[0].name,k),ne+="</div>",ne}},legend:D?{...D,...j.length>0?{data:j}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:zd(),top:"10%",containLabel:!0},xAxis:{type:"category",data:k,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((te=s==null?void 0:s.y)==null?void 0:te.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,formatter:X=>ko(X,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:S,...M?{dataZoom:M}:{},animation:!0,animationDuration:300};return d.jsx(yr,{ref:g,option:W,height:l,loading:u,onEvents:_})}),W2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,horizontal:f=!1,onChartClick:h,activeCrossFilter:p,events:y,goalData:g},b){var G,de,P,te,X,R,fe;const O=Ar(),k=(s==null?void 0:s.series)&&"field"in s.series,T=k?Hd(t,n):Ps(t,n),E=n.type==="temporal"?Bd(t,n):T,_=(p==null?void 0:p.field)===n.field,S=f||(s==null?void 0:s.orientation)==="horizontal",D=C.useMemo(()=>{if(k){const ne=new Set;return t.filter(J=>{const ge=J[n.field];return ne.has(ge)?!1:(ne.add(ge),!0)}).map(J=>J[n.field])}return t.map(ne=>ne[n.field])},[t,n.field,k]),M=C.useMemo(()=>{if(h)return{contextmenu:ne=>{var ve,je,Ye,et;const J=ne;if(J.componentType!=="series")return;const ge=J.dataIndex!=null?D[J.dataIndex]:void 0,ee=ge!=null?String(ge):J.name;if(ee==null||ee==="")return;const le=((je=(ve=J.event)==null?void 0:ve.event)==null?void 0:je.clientX)??0,xe=((et=(Ye=J.event)==null?void 0:Ye.event)==null?void 0:et.clientY)??0;h(n.field,ee,{x:le,y:xe},J.seriesName)}}},[h,n.field,D]),N=(s==null?void 0:s.stacking)==="percent",I=ne=>N?`${ne.toFixed(1)}%`:ko(ne,r==null?void 0:r.format);let A,F=!1;if(s){const ne=Fd(t,{type:s.type,x:{field:n.field},y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),J=ne.length>1,ge=!!s.stacking;F=J;const ee=cs(i);A=ne.map((le,xe)=>{const ve=Ud(le.color,le.gradient??s.gradient),je=ge&&xe===ne.length-1,Ye=S?ee.barBorderRadiusHorizontal:ee.barBorderRadius,et=ge?je?Ye:[0,0,0,0]:Ye;return{type:"bar",name:le.name,data:_?le.data.map((nt,Je)=>({value:nt??0,itemStyle:{opacity:String(D[Je])===(p==null?void 0:p.value)?1:.3}})):le.data,barWidth:J&&!ge?void 0:"60%",barMinHeight:ge?0:2,itemStyle:{color:ve??le.color,borderRadius:et},stack:le.stack,...le.opacity!==void 0?{opacity:le.opacity}:{}}})}else{const ne=(r==null?void 0:r.field)??"",J=t.map(ee=>{const le=ee[ne];return typeof le=="number"?le:parseFloat(String(le))||0}),ge=cs(i);A=[{type:"bar",data:_?J.map((ee,le)=>({value:ee,itemStyle:{opacity:String(D[le])===(p==null?void 0:p.value)?1:.3}})):J,barWidth:"60%",barMinHeight:2,itemStyle:{color:"#3B82F6",borderRadius:S?ge.barBorderRadiusHorizontal:ge.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const j=(s==null?void 0:s.goals)??[];if(j.length>0&&Array.isArray(A)&&!S){if(A[0]){const le=A[0].data.map(ve=>typeof ve=="number"?ve:ve.value),xe=A6(le,j);A[0].data=xe}const ne=Rd(j,T),J=Pd(j);ne.length>0&&A[0]&&(A[0].markLine={silent:!0,symbol:"none",data:ne}),J.length>0&&A[0]&&(A[0].markArea={silent:!0,data:J});const ge=jd(j,g);for(const ee of ge)A.push({type:"line",name:ee.name,data:ee.data,z:ee.z,showSymbol:ee.showSymbol,lineStyle:ee.lineStyle,itemStyle:{color:ee.color}})}const B=s==null?void 0:s.annotations;if(B&&B.length>0&&Array.isArray(A)&&A[0]){const ne=Wd(B,O.textColor),J=Yd(B);if(ne.length>0){const ge=A[0].markLine,ee=(ge==null?void 0:ge.data)??[];A[0].markLine={...ge,silent:!0,symbol:"none",data:[...ee,...ne]}}if(J.length>0){const ge=A[0].markArea,ee=(ge==null?void 0:ge.data)??[];A[0].markArea={silent:!0,data:[...ee,...J]}}}const H=C.useMemo(()=>{if(!(y!=null&&y.length))return[];const J=y.flatMap(xe=>xe.endDate?[xe.date,xe.endDate]:[xe.date]).map(xe=>({[n.field]:xe})),ee=Ps([...t,...J],n).slice(t.length);let le=0;return y.map(xe=>{const ve={...xe,date:ee[le++]??xe.date};return xe.endDate&&(ve.endDate=ee[le++]??xe.endDate),ve})},[y,t,n]),W=Array.isArray(A)?A.map(ne=>ne.name).filter(Boolean):[],Y=Md(H,O.textColor,T),V=Ld(H,O.textColor,T);if((Y||V.length>0)&&Array.isArray(A)){const ne={type:"line",data:((G=A[0])==null?void 0:G.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};Y&&(ne.markLine=Y),V.length>0&&(ne.markArea={silent:!0,data:V}),A.push(ne)}const ie={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:ne=>{const J=ne;if(!Array.isArray(J)||J.length===0)return"";const ge=E[J[0].dataIndex]??J[0].name,ee=Id(H,J[0].name,T);if(J.length===1){const xe=J[0];return`
95
95
  <div style="padding: 8px;">
@@ -192,4 +192,4 @@ ${ut}${Ae}. `,ct=je.substring(0,ve)+Pe+je.substring(ve);f(ct),setTimeout(()=>{xe
192
192
  .yc-edit-grid > .react-grid-item {
193
193
  z-index: 1;
194
194
  }
195
- `}),d.jsxs("div",{ref:g,style:{position:"relative"},children:[b>0&&r&&h==="lg"&&d.jsx(fI,{className:"yc-bg-grid",layout:yT,cols:pT,rowHeight:Ll,width:b,margin:[D,D],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:GR}),b>0&&d.jsx(hI,{className:r?"layout yc-edit-grid":"layout",layouts:A,breakpoints:WR,cols:YR,rowHeight:Ll,width:b,margin:[D,D],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:(Y,V)=>{V.lg&&j(V.lg)},onDragStart:()=>{_.current=!0},onResizeStart:()=>{_.current=!0},onDragStop:Y=>B([...Y]),onResizeStop:Y=>B([...Y]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:I.map(({id:Y,widget:V,rowIndex:se,widgetIndex:ie})=>d.jsx("div",{className:"h-full",children:d.jsxs(zR,{onRemove:()=>H(se,ie),widgetType:V.type,isContentEditing:k===Y,onDoubleClick:V.type==="text"?()=>T(Y):void 0,children:[V.type==="chart"&&V.ref&&d.jsx(xI,{chartRef:V.ref}),V.type==="text"&&d.jsx(UR,{content:V.content||"",onUpdate:G=>W(se,ie,G),isContentEditing:k===Y,onEditStart:()=>T(Y),onEditEnd:()=>T(null),dashboardName:n})]})},Y))})]})]})}function XR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:s}=ga(),[i,l]=C.useState(""),u=C.useRef(null);if(C.useEffect(()=>{const y=b=>{b.key==="Escape"&&t()},g=b=>{u.current&&!u.current.contains(b.target)&&t()};return e&&(document.addEventListener("keydown",y),document.addEventListener("mousedown",g)),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",g)}},[e,t]),!e)return null;const h=((s==null?void 0:s.charts)||[]).filter(y=>y.title.toLowerCase().includes(i.toLowerCase())||y.name.toLowerCase().includes(i.toLowerCase())),p=y=>{n({type:"chart",ref:y,cols:6}),t()};return d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs("div",{ref:u,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),d.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("input",{type:"text",placeholder:"Search charts...",value:i,onChange:y=>l(y.target.value),className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"},autoFocus:!0})]}),d.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?d.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):d.jsx("div",{className:"p-2",children:h.map(y=>{const g=r.includes(y.name);return d.jsxs("button",{onClick:()=>p(y.name),disabled:g,className:"w-full text-left px-3 py-3 rounded-md hover:bg-black/5 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:y.title}),d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:y.name}),y.description&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:y.description})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs px-2 py-1 rounded",style:{color:"var(--yc-color-text-muted)",backgroundColor:"var(--yc-color-surface-hover)"},children:y.type}),g?d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):d.jsx("svg",{className:"w-5 h-5 opacity-0 group-hover:opacity-100",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},y.name)})})})]})})}function JR(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"Updated just now";if(t<60)return`Updated ${t}s ago`;const n=Math.floor(t/60);if(n<10)return`Updated ${n}m ago`;const r=new Date(e);return Math.floor(n/60)<24?`Last refresh ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`:`Last refresh ${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`}function ZR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:s}){const{isEditing:i,setIsEditing:l,pendingLayout:u,setPendingLayout:f,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:g,undo:b,redo:O,canUndo:k,canRedo:T,pendingTitle:E,setPendingTitle:_,pendingDescription:S,setPendingDescription:D}=Oi(),M=Tm(),I=!!ya(),A=wd(),F=CN(e),j=NN(),B=zk({queryKey:["chartData"]}),H=qn(),W=(()=>{const ee=H.getQueryCache();let le=0;for(const xe of ee.getAll()){const ve=xe.queryKey[0];(ve==="chartData"||ve==="chartWithData")&&xe.state.dataUpdatedAt>le&&(le=xe.state.dataUpdatedAt)}return le>0?le:null})(),[,Y]=C.useState(0);C.useEffect(()=>{const le=(W?Date.now()-W:1/0)<6e4?1e4:6e4,xe=setInterval(()=>Y(ve=>ve+1),le);return()=>clearInterval(xe)},[W]);const[V,se]=C.useState(!1),[ie,G]=C.useState(!1),[de,P]=C.useState(!1),[te,X]=C.useState(!1),R=(g==null?void 0:g.rows.flatMap(ee=>ee.widgets.filter(le=>le.type==="chart"&&le.ref).map(le=>le.ref)))||[],fe=()=>{j()},ne=async ee=>{if(r.current){X(!0),se(!1);try{ee==="pdf"?await E6(r.current,`${e}-dashboard`,t):await v6(r.current,`${e}-dashboard`,ee)}finally{X(!1)}}},J=async()=>{const ee=u||g;if(ee)try{await F.mutateAsync({layout:ee,tab:s,title:E??void 0,description:S??void 0}),u&&h(u),f(null),l(!1)}catch(le){console.error("Failed to save:",le)}},ge=()=>{f(null),l(!1)};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"flex items-center justify-between p-4",children:[d.jsx("div",{children:i?d.jsx("input",{type:"text",value:E??t,onChange:ee=>_(ee.target.value),className:"text-xl font-semibold bg-transparent border-b-2 border-dashed outline-none px-0 py-0",style:{color:"var(--yc-color-text)",borderColor:"var(--yc-color-primary)"},placeholder:"Dashboard title"}):d.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),d.jsx("div",{className:"flex items-center gap-2",children:i?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"relative",children:[d.jsxs("button",{onClick:()=>P(!de),className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),de&&d.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>{P(!1),G(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Chart"]}),d.jsxs("button",{onClick:()=>{P(!1),y({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("button",{onClick:b,disabled:!k,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Undo (Cmd+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),d.jsx("button",{onClick:O,disabled:!T,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Redo (Cmd+Shift+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),d.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),d.jsx("button",{onClick:ge,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),d.jsx("button",{onClick:J,disabled:!p||F.isPending,className:$n("px-4 py-2 text-sm font-medium rounded-md",p?"bg-blue-600 text-white hover:bg-blue-700":"cursor-not-allowed"),style:p?void 0:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:F.isPending?"Saving...":"Save & Push"})]}):d.jsxs(d.Fragment,{children:[W&&B===0&&d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(W).toLocaleString(),children:JR(W)}),d.jsx("button",{onClick:fe,disabled:B>0,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh all charts",children:d.jsx("svg",{className:$n("w-5 h-5",B>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>se(!V),disabled:te,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:te?d.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),V&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>ne("png"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),d.jsxs("button",{onClick:()=>ne("jpeg"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export JPEG"]}),d.jsxs("button",{onClick:()=>ne("pdf"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]}),!I&&d.jsx(M2,{resourceType:"dashboard",resourceName:e}),!I&&A&&d.jsxs("button",{onClick:()=>Rs.getState().openPanel({type:"dashboard",name:e}),className:"flex items-center gap-1 px-2 py-1 rounded text-xs",style:{color:"var(--yc-color-text-secondary)"},title:"Ask AI about this dashboard",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Ask AI"]}),!I&&(M==="lg"?d.jsx("button",{onClick:()=>l(!0),className:"p-2 hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},title:"Edit layout",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}):d.jsx("button",{disabled:!0,className:"p-2 rounded-md",style:{opacity:.5,cursor:"not-allowed",color:"var(--yc-color-text-muted)"},title:"Editing requires a desktop browser",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}))]})})]}),i?d.jsx("input",{type:"text",value:S??n??"",onChange:ee=>D(ee.target.value),className:"w-full px-4 pb-3 text-sm bg-transparent border-b border-dashed outline-none",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},placeholder:"Add a description..."}):n?d.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n}):null]}),d.jsx(XR,{isOpen:ie,onClose:()=>G(!1),onAdd:y,existingCharts:R})]})}function eP({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:s}){const[i,l]=C.useState(null),[u,f]=C.useState(null),h=ot(D=>D.globalFilters),p=ot(D=>D.resetFilters),y=ot(D=>D.crossFilters),g=ot(D=>D.clearCrossFilter),b=ot(D=>D.clearAllCrossFilters),O=s?Object.values(y):[];if(e.length===0&&O.length===0)return null;const k=e.some(D=>{const M=h[D.name];if(M==null||M===""||Array.isArray(M)&&M.length===0)return!1;const N=D.default??(D.type==="date_range"?"last_30_days":void 0);return JSON.stringify(M)!==JSON.stringify(N)});function T(D,M){l(M),D.dataTransfer.effectAllowed="move"}function E(D,M){D.preventDefault(),D.dataTransfer.dropEffect="move",f(M)}function _(D,M){if(D.preventDefault(),i===null||i===M)return;const N=[...e],I=N.splice(i,1)[0];N.splice(M,0,I),n==null||n(N),l(null),f(null)}function S(){l(null),f(null)}return t?d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((D,M)=>{const N=D.label||fa(D.name),I=i===M?"opacity-50":"";return d.jsxs("div",{draggable:!0,onDragStart:A=>T(A,M),onDragOver:A=>E(A,M),onDrop:A=>_(A,M),onDragEnd:S,className:`flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-grab active:cursor-grabbing transition-colors ${I}`,style:u===M?{borderColor:"var(--yc-color-primary)",backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)"}:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsx("svg",{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"currentColor",viewBox:"0 0 20 20",children:d.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})}),d.jsx(tP,{value:N,onChange:A=>r==null?void 0:r(M,A)}),d.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]},D.name)})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(D=>{const M=D.label||fa(D.name),N=typeof D.default=="string"?D.default:void 0;switch(D.type){case"date_range":return d.jsx(w2,{name:D.name,label:M,description:D.description,defaultValue:N},D.name);case"select":{const I=(D.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return d.jsx(nd,{name:D.name,label:M,description:D.description,options:I,defaultValue:N},D.name)}case"dynamic_select":return D.source?d.jsx(nd,{name:D.name,label:M,description:D.description,source:D.source,defaultValue:N},D.name):d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": dynamic_select requires source"]},D.name);case"multi_select":{const I=(D.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return d.jsx(k2,{name:D.name,label:M,description:D.description,options:I,defaultValue:Array.isArray(D.default)?D.default:void 0,source:D.source},D.name)}case"text":return d.jsx(N2,{name:D.name,label:M,description:D.description,defaultValue:N},D.name);case"number":return d.jsx(O2,{name:D.name,label:M,description:D.description,defaultValue:typeof D.default=="number"?D.default:void 0},D.name);case"boolean":return d.jsx(A2,{name:D.name,label:M,description:D.description},D.name);default:return d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": ",D.type," (not supported)"]},D.name)}}),O.length>0&&e.length>0&&d.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),O.map(D=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-sm rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[D.field,": ",am(D.value),d.jsx("button",{onClick:()=>g(D.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${D.field} filter`,children:d.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},`cf-${D.field}`)),(k||O.length>0)&&d.jsx("button",{type:"button",onClick:()=>{k&&p(),O.length>0&&b()},className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function tP({value:e,onChange:t}){const[n,r]=C.useState(!1),[s,i]=C.useState(e);if(!n)return d.jsx("span",{className:"text-sm font-medium cursor-text hover:text-blue-600 hover:underline",style:{color:"var(--yc-color-text)"},onClick:u=>{u.stopPropagation(),r(!0),i(e)},title:"Click to rename",children:e});function l(){s.trim()&&s!==e&&t(s.trim()),r(!1)}return d.jsx("input",{autoFocus:!0,value:s,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&l(),u.key==="Escape"&&r(!1)},className:"text-sm font-medium border border-blue-300 rounded px-1 py-0 outline-none w-32",style:{color:"var(--yc-color-text)",backgroundColor:"var(--yc-color-surface)"},onClick:u=>u.stopPropagation()})}function nP({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=Oi();return d.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(s=>d.jsx("button",{onClick:()=>n(s.name),disabled:r&&s.name!==t,className:$n("px-4 py-2 text-sm font-medium border-b-2 transition-colors",s.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&s.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:s.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:s.label},s.name))})}function rP({dashboardId:e,title:t,description:n,contentRef:r,tabs:s,activeTab:i,onTabChange:l,filters:u}){const{isEditing:f,pendingFilters:h,setPendingFilters:p}=Oi(),y=ot(b=>Object.keys(b.crossFilters).length>0);C.useEffect(()=>{f&&!h&&p([...u])},[f]);const g=f&&h?h:u;return d.jsxs(d.Fragment,{children:[d.jsx(ZR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:s?i:void 0}),s&&i&&l&&d.jsx(nP,{tabs:s,activeTab:i,onTabChange:l}),(g.length>0||!f&&y)&&d.jsx("div",{className:"yc-filter-bar sticky top-0 z-10 border-b px-6 py-3",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:d.jsx(eP,{filters:g,isEditing:f,onReorder:b=>p(b),onRename:(b,O)=>{const k=[...g];k[b]={...k[b],label:O},p(k)},showCrossFilters:!f})})]})}function sP({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:s,error:i}=SN(e,t),l=C.useRef(null),u=qn(),f=ot(k=>k.globalFilters),[h,p]=C.useState(n||"");C.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),C.useEffect(()=>{if(!(r!=null&&r.tabs))return;const k=r.tabs.map(E=>E.name);if(h&&k.includes(h))return;const T=n&&k.includes(n)?n:k[0];T&&p(T)},[r==null?void 0:r.tabs,n]);const y=ot(k=>k.clearAllCrossFilters),g=C.useCallback(k=>{var E;p(k),y();const T=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${T}?tab=${encodeURIComponent(k)}`),r!=null&&r.name){const _=xi(Object.fromEntries(Object.entries(f).filter(([D,M])=>M!=null)));xt.warmDashboardCache(r.name,_,k).catch(()=>{});const S=(E=r.tabs)==null?void 0:E.find(D=>D.name===k);if(S)for(const D of S.layout.rows)for(const M of D.widgets)M.type==="chart"&&M.ref&&u.prefetchQuery({queryKey:["chartWithData",M.ref,_],queryFn:()=>xt.queryChart(M.ref,_,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,f,u,y]),b=C.useMemo(()=>{if(r){if(r.tabs){const k=r.tabs.find(T=>T.name===h);return k==null?void 0:k.layout}return r.layout}},[r,h]),O=C.useMemo(()=>{if(!r)return[];const k=r.filters||[];if(r.tabs){const T=r.tabs.find(_=>_.name===h),E=(T==null?void 0:T.filters)||[];return[...k,...E]}return k},[r,h]);return s?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):i||!r?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(i==null?void 0:i.message)||"Unknown error"]})}):b?d.jsx(aA,{children:d.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[d.jsx(rP,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:O}),d.jsx("div",{ref:l,className:"p-6",children:d.jsx(KR,{layout:b,dashboardName:r.name})})]})}):d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const oP=C.lazy(()=>Yr(()=>import("./LoginPage-Dyk2ILmo.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),aP=C.lazy(()=>Yr(()=>import("./SetupWizard-BzZSJlbt.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),iP=C.lazy(()=>Yr(()=>import("./UserManagement-BD-lLbVH.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),lP=C.lazy(()=>Yr(()=>import("./ShareManagement-C7RIZRWe.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),uP=C.lazy(()=>Yr(()=>import("./PublicViewer-C2tNYBR2.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),cP=C.lazy(()=>Yr(()=>import("./EventManagement-B7leMxfo.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),dP=C.lazy(()=>Yr(()=>import("./ExplorePage-zI1OiYlH.js"),__vite__mapDeps([7,1]))),Rl=()=>d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});function T0(e){const t=e.replace(/^#?/,"");if(t==="/explore")return{type:"explore",name:"",params:{}};const n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};if(t==="/events")return{type:"events",name:"",params:{}};const[r,s]=t.split("?"),i=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(i&&i[1]&&i[2]){const y={};if(s)for(const[g,b]of new URLSearchParams(s).entries())y[g]=b;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,u]=t.split("?"),f=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(f&&f[2]){const y={};if(u)for(const[g,b]of new URLSearchParams(u).entries())y[g]=b;return{type:"chart_detail",name:decodeURIComponent(f[2]),params:y}}const h=l==null?void 0:l.match(/^\/(dashboards|charts)\/(.+)$/);if(!h||!h[1]||!h[2])return null;const p={};if(u)for(const[y,g]of new URLSearchParams(u).entries())p[y]=g;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function xb(e,t){return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsxs("div",{className:"text-center max-w-md p-8",children:[d.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:d.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),d.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),d.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Reload page"})]})})}function fP(){DN();const e=So(k=>k.auth),t=So(k=>k.checkAuth),n=wd();C.useEffect(()=>{t()},[t]);const{data:r,isLoading:s}=ga(),{data:i,isLoading:l}=hv(),u=ot(k=>k.resetFilters),[f,h]=C.useState(()=>window.location.hash.replace(/^#/,"")||"");C.useEffect(()=>{const k=()=>{h(window.location.hash.replace(/^#/,"")||""),u()};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[u]);const p=C.useCallback(k=>{window.location.hash=k,h(k),u()},[u]);C.useEffect(()=>{s||l||f||(i&&i.length>0&&i[0]?p(`/dashboards/${i[0].name}`):r!=null&&r.charts&&r.charts.length>0&&r.charts[0]&&p(`/charts/${r.charts[0].name}`))},[s,l,i,r,f,p]);const y=T0(f);if(y&&(y.type==="public_chart"||y.type==="public_dashboard"))return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(uP,{parsed:{type:y.type,name:y.name,params:y.params}})});if(e.status==="loading")return d.jsx(Rl,{});if(e.status==="needs_setup")return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(aP,{})});if(e.status==="unauthenticated")return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(oP,{})});const g=T0(f);if((g==null?void 0:g.type)==="explore")return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(dP,{})})})});if(s||l)return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});const b=T0(f),O=()=>b?b.type==="settings"&&b.name==="users"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(iP,{})}):b.type==="settings"&&b.name==="shares"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(lP,{})}):b.type==="events"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(cP,{})}):b.type==="dashboard"?d.jsx(sP,{dashboardId:b.name,initialTab:b.params.tab}):b.type==="chart_detail"?d.jsx(sA,{chartName:b.name,params:b.params}):d.jsx(rA,{chartName:b.name,drillParams:b.params}):d.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"text-sm",children:"Select a dashboard or chart from the sidebar"}),n&&d.jsxs("a",{href:"#/explore",className:"flex items-center gap-1.5 text-sm hover:underline",style:{color:"var(--yc-color-primary)"},onClick:k=>{k.preventDefault(),p("/explore")},children:[d.jsx("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 15.803a7.5 7.5 0 0010.607 10.607z"})}),"Explore your data"]})]});return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(SO,{currentPath:f,onNavigate:p,onNavigateToUsers:()=>p("/settings/users"),onNavigateToShares:()=>p("/settings/shares"),children:O()})})})}fk.createRoot(document.getElementById("root")).render(d.jsx(C.StrictMode,{children:d.jsx(Wk,{children:d.jsx(fP,{})})}));export{cu as A,W2 as B,ld as C,R2 as D,sm as E,I2 as F,J2 as G,G2 as H,dn as I,Tm as J,GN as K,z2 as L,e2 as M,TO as N,wO as O,$2 as P,M2 as S,om as T,X2 as W,Yr as _,xt as a,Kb as b,$n as c,fv as d,ga as e,Mm as f,ot as g,wd as h,Rs as i,d as j,eE as k,Z6 as l,K2 as m,Q2 as n,V2 as o,q2 as p,Y2 as q,yP as r,sP as s,qn as t,So as u,or as v,Za as w,ks as x,x6 as y,Xa as z};
195
+ `}),d.jsxs("div",{ref:g,style:{position:"relative"},children:[b>0&&r&&h==="lg"&&d.jsx(fI,{className:"yc-bg-grid",layout:yT,cols:pT,rowHeight:Ll,width:b,margin:[D,D],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:GR}),b>0&&d.jsx(hI,{className:r?"layout yc-edit-grid":"layout",layouts:A,breakpoints:WR,cols:YR,rowHeight:Ll,width:b,margin:[D,D],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:(Y,V)=>{V.lg&&j(V.lg)},onDragStart:()=>{_.current=!0},onResizeStart:()=>{_.current=!0},onDragStop:Y=>B([...Y]),onResizeStop:Y=>B([...Y]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:I.map(({id:Y,widget:V,rowIndex:se,widgetIndex:ie})=>d.jsx("div",{className:"h-full",children:d.jsxs(zR,{onRemove:()=>H(se,ie),widgetType:V.type,isContentEditing:k===Y,onDoubleClick:V.type==="text"?()=>T(Y):void 0,children:[V.type==="chart"&&V.ref&&d.jsx(xI,{chartRef:V.ref}),V.type==="text"&&d.jsx(UR,{content:V.content||"",onUpdate:G=>W(se,ie,G),isContentEditing:k===Y,onEditStart:()=>T(Y),onEditEnd:()=>T(null),dashboardName:n})]})},Y))})]})]})}function XR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:s}=ga(),[i,l]=C.useState(""),u=C.useRef(null);if(C.useEffect(()=>{const y=b=>{b.key==="Escape"&&t()},g=b=>{u.current&&!u.current.contains(b.target)&&t()};return e&&(document.addEventListener("keydown",y),document.addEventListener("mousedown",g)),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",g)}},[e,t]),!e)return null;const h=((s==null?void 0:s.charts)||[]).filter(y=>y.title.toLowerCase().includes(i.toLowerCase())||y.name.toLowerCase().includes(i.toLowerCase())),p=y=>{n({type:"chart",ref:y,cols:6}),t()};return d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs("div",{ref:u,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),d.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("input",{type:"text",placeholder:"Search charts...",value:i,onChange:y=>l(y.target.value),className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"},autoFocus:!0})]}),d.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?d.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):d.jsx("div",{className:"p-2",children:h.map(y=>{const g=r.includes(y.name);return d.jsxs("button",{onClick:()=>p(y.name),disabled:g,className:"w-full text-left px-3 py-3 rounded-md hover:bg-black/5 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:y.title}),d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:y.name}),y.description&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:y.description})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs px-2 py-1 rounded",style:{color:"var(--yc-color-text-muted)",backgroundColor:"var(--yc-color-surface-hover)"},children:y.type}),g?d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):d.jsx("svg",{className:"w-5 h-5 opacity-0 group-hover:opacity-100",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},y.name)})})})]})})}function JR(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"Updated just now";if(t<60)return`Updated ${t}s ago`;const n=Math.floor(t/60);if(n<10)return`Updated ${n}m ago`;const r=new Date(e);return Math.floor(n/60)<24?`Last refresh ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`:`Last refresh ${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`}function ZR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:s}){const{isEditing:i,setIsEditing:l,pendingLayout:u,setPendingLayout:f,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:g,undo:b,redo:O,canUndo:k,canRedo:T,pendingTitle:E,setPendingTitle:_,pendingDescription:S,setPendingDescription:D}=Oi(),M=Tm(),I=!!ya(),A=wd(),F=CN(e),j=NN(),B=zk({queryKey:["chartData"]}),H=qn(),W=(()=>{const ee=H.getQueryCache();let le=0;for(const xe of ee.getAll()){const ve=xe.queryKey[0];(ve==="chartData"||ve==="chartWithData")&&xe.state.dataUpdatedAt>le&&(le=xe.state.dataUpdatedAt)}return le>0?le:null})(),[,Y]=C.useState(0);C.useEffect(()=>{const le=(W?Date.now()-W:1/0)<6e4?1e4:6e4,xe=setInterval(()=>Y(ve=>ve+1),le);return()=>clearInterval(xe)},[W]);const[V,se]=C.useState(!1),[ie,G]=C.useState(!1),[de,P]=C.useState(!1),[te,X]=C.useState(!1),R=(g==null?void 0:g.rows.flatMap(ee=>ee.widgets.filter(le=>le.type==="chart"&&le.ref).map(le=>le.ref)))||[],fe=()=>{j()},ne=async ee=>{if(r.current){X(!0),se(!1);try{ee==="pdf"?await E6(r.current,`${e}-dashboard`,t):await v6(r.current,`${e}-dashboard`,ee)}finally{X(!1)}}},J=async()=>{const ee=u||g;if(ee)try{await F.mutateAsync({layout:ee,tab:s,title:E??void 0,description:S??void 0}),u&&h(u),f(null),l(!1)}catch(le){console.error("Failed to save:",le)}},ge=()=>{f(null),l(!1)};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"flex items-center justify-between p-4",children:[d.jsx("div",{children:i?d.jsx("input",{type:"text",value:E??t,onChange:ee=>_(ee.target.value),className:"text-xl font-semibold bg-transparent border-b-2 border-dashed outline-none px-0 py-0",style:{color:"var(--yc-color-text)",borderColor:"var(--yc-color-primary)"},placeholder:"Dashboard title"}):d.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),d.jsx("div",{className:"flex items-center gap-2",children:i?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"relative",children:[d.jsxs("button",{onClick:()=>P(!de),className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),de&&d.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>{P(!1),G(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Chart"]}),d.jsxs("button",{onClick:()=>{P(!1),y({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("button",{onClick:b,disabled:!k,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Undo (Cmd+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),d.jsx("button",{onClick:O,disabled:!T,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Redo (Cmd+Shift+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),d.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),d.jsx("button",{onClick:ge,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),d.jsx("button",{onClick:J,disabled:!p||F.isPending,className:$n("px-4 py-2 text-sm font-medium rounded-md",p?"bg-blue-600 text-white hover:bg-blue-700":"cursor-not-allowed"),style:p?void 0:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:F.isPending?"Saving...":"Save & Push"})]}):d.jsxs(d.Fragment,{children:[W&&B===0&&d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(W).toLocaleString(),children:JR(W)}),d.jsx("button",{onClick:fe,disabled:B>0,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh all charts",children:d.jsx("svg",{className:$n("w-5 h-5",B>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>se(!V),disabled:te,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:te?d.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),V&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>ne("png"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),d.jsxs("button",{onClick:()=>ne("jpeg"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export JPEG"]}),d.jsxs("button",{onClick:()=>ne("pdf"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]}),!I&&d.jsx(M2,{resourceType:"dashboard",resourceName:e}),!I&&A&&d.jsxs("button",{onClick:()=>Rs.getState().openPanel({type:"dashboard",name:e}),className:"flex items-center gap-1 px-2 py-1 rounded text-xs",style:{color:"var(--yc-color-text-secondary)"},title:"Ask AI about this dashboard",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Ask AI"]}),!I&&(M==="lg"?d.jsx("button",{onClick:()=>l(!0),className:"p-2 hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},title:"Edit layout",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}):d.jsx("button",{disabled:!0,className:"p-2 rounded-md",style:{opacity:.5,cursor:"not-allowed",color:"var(--yc-color-text-muted)"},title:"Editing requires a desktop browser",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}))]})})]}),i?d.jsx("input",{type:"text",value:S??n??"",onChange:ee=>D(ee.target.value),className:"w-full px-4 pb-3 text-sm bg-transparent border-b border-dashed outline-none",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},placeholder:"Add a description..."}):n?d.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n}):null]}),d.jsx(XR,{isOpen:ie,onClose:()=>G(!1),onAdd:y,existingCharts:R})]})}function eP({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:s}){const[i,l]=C.useState(null),[u,f]=C.useState(null),h=ot(D=>D.globalFilters),p=ot(D=>D.resetFilters),y=ot(D=>D.crossFilters),g=ot(D=>D.clearCrossFilter),b=ot(D=>D.clearAllCrossFilters),O=s?Object.values(y):[];if(e.length===0&&O.length===0)return null;const k=e.some(D=>{const M=h[D.name];if(M==null||M===""||Array.isArray(M)&&M.length===0)return!1;const N=D.default??(D.type==="date_range"?"last_30_days":void 0);return JSON.stringify(M)!==JSON.stringify(N)});function T(D,M){l(M),D.dataTransfer.effectAllowed="move"}function E(D,M){D.preventDefault(),D.dataTransfer.dropEffect="move",f(M)}function _(D,M){if(D.preventDefault(),i===null||i===M)return;const N=[...e],I=N.splice(i,1)[0];N.splice(M,0,I),n==null||n(N),l(null),f(null)}function S(){l(null),f(null)}return t?d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((D,M)=>{const N=D.label||fa(D.name),I=i===M?"opacity-50":"";return d.jsxs("div",{draggable:!0,onDragStart:A=>T(A,M),onDragOver:A=>E(A,M),onDrop:A=>_(A,M),onDragEnd:S,className:`flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-grab active:cursor-grabbing transition-colors ${I}`,style:u===M?{borderColor:"var(--yc-color-primary)",backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)"}:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsx("svg",{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"currentColor",viewBox:"0 0 20 20",children:d.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})}),d.jsx(tP,{value:N,onChange:A=>r==null?void 0:r(M,A)}),d.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]},D.name)})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(D=>{const M=D.label||fa(D.name),N=typeof D.default=="string"?D.default:void 0;switch(D.type){case"date_range":return d.jsx(w2,{name:D.name,label:M,description:D.description,defaultValue:N},D.name);case"select":{const I=(D.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return d.jsx(nd,{name:D.name,label:M,description:D.description,options:I,defaultValue:N},D.name)}case"dynamic_select":return D.source?d.jsx(nd,{name:D.name,label:M,description:D.description,source:D.source,defaultValue:N},D.name):d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": dynamic_select requires source"]},D.name);case"multi_select":{const I=(D.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return d.jsx(k2,{name:D.name,label:M,description:D.description,options:I,defaultValue:Array.isArray(D.default)?D.default:void 0,source:D.source},D.name)}case"text":return d.jsx(N2,{name:D.name,label:M,description:D.description,defaultValue:N},D.name);case"number":return d.jsx(O2,{name:D.name,label:M,description:D.description,defaultValue:typeof D.default=="number"?D.default:void 0},D.name);case"boolean":return d.jsx(A2,{name:D.name,label:M,description:D.description},D.name);default:return d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": ",D.type," (not supported)"]},D.name)}}),O.length>0&&e.length>0&&d.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),O.map(D=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-sm rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[D.field,": ",am(D.value),d.jsx("button",{onClick:()=>g(D.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${D.field} filter`,children:d.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},`cf-${D.field}`)),(k||O.length>0)&&d.jsx("button",{type:"button",onClick:()=>{k&&p(),O.length>0&&b()},className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function tP({value:e,onChange:t}){const[n,r]=C.useState(!1),[s,i]=C.useState(e);if(!n)return d.jsx("span",{className:"text-sm font-medium cursor-text hover:text-blue-600 hover:underline",style:{color:"var(--yc-color-text)"},onClick:u=>{u.stopPropagation(),r(!0),i(e)},title:"Click to rename",children:e});function l(){s.trim()&&s!==e&&t(s.trim()),r(!1)}return d.jsx("input",{autoFocus:!0,value:s,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&l(),u.key==="Escape"&&r(!1)},className:"text-sm font-medium border border-blue-300 rounded px-1 py-0 outline-none w-32",style:{color:"var(--yc-color-text)",backgroundColor:"var(--yc-color-surface)"},onClick:u=>u.stopPropagation()})}function nP({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=Oi();return d.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(s=>d.jsx("button",{onClick:()=>n(s.name),disabled:r&&s.name!==t,className:$n("px-4 py-2 text-sm font-medium border-b-2 transition-colors",s.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&s.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:s.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:s.label},s.name))})}function rP({dashboardId:e,title:t,description:n,contentRef:r,tabs:s,activeTab:i,onTabChange:l,filters:u}){const{isEditing:f,pendingFilters:h,setPendingFilters:p}=Oi(),y=ot(b=>Object.keys(b.crossFilters).length>0);C.useEffect(()=>{f&&!h&&p([...u])},[f]);const g=f&&h?h:u;return d.jsxs(d.Fragment,{children:[d.jsx(ZR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:s?i:void 0}),s&&i&&l&&d.jsx(nP,{tabs:s,activeTab:i,onTabChange:l}),(g.length>0||!f&&y)&&d.jsx("div",{className:"yc-filter-bar sticky top-0 z-10 border-b px-6 py-3",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:d.jsx(eP,{filters:g,isEditing:f,onReorder:b=>p(b),onRename:(b,O)=>{const k=[...g];k[b]={...k[b],label:O},p(k)},showCrossFilters:!f})})]})}function sP({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:s,error:i}=SN(e,t),l=C.useRef(null),u=qn(),f=ot(k=>k.globalFilters),[h,p]=C.useState(n||"");C.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),C.useEffect(()=>{if(!(r!=null&&r.tabs))return;const k=r.tabs.map(E=>E.name);if(h&&k.includes(h))return;const T=n&&k.includes(n)?n:k[0];T&&p(T)},[r==null?void 0:r.tabs,n]);const y=ot(k=>k.clearAllCrossFilters),g=C.useCallback(k=>{var E;p(k),y();const T=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${T}?tab=${encodeURIComponent(k)}`),r!=null&&r.name){const _=xi(Object.fromEntries(Object.entries(f).filter(([D,M])=>M!=null)));xt.warmDashboardCache(r.name,_,k).catch(()=>{});const S=(E=r.tabs)==null?void 0:E.find(D=>D.name===k);if(S)for(const D of S.layout.rows)for(const M of D.widgets)M.type==="chart"&&M.ref&&u.prefetchQuery({queryKey:["chartWithData",M.ref,_],queryFn:()=>xt.queryChart(M.ref,_,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,f,u,y]),b=C.useMemo(()=>{if(r){if(r.tabs){const k=r.tabs.find(T=>T.name===h);return k==null?void 0:k.layout}return r.layout}},[r,h]),O=C.useMemo(()=>{if(!r)return[];const k=r.filters||[];if(r.tabs){const T=r.tabs.find(_=>_.name===h),E=(T==null?void 0:T.filters)||[];return[...k,...E]}return k},[r,h]);return s?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):i||!r?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(i==null?void 0:i.message)||"Unknown error"]})}):b?d.jsx(aA,{children:d.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[d.jsx(rP,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:O}),d.jsx("div",{ref:l,className:"p-6",children:d.jsx(KR,{layout:b,dashboardName:r.name})})]})}):d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const oP=C.lazy(()=>Yr(()=>import("./LoginPage-wygea4BI.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),aP=C.lazy(()=>Yr(()=>import("./SetupWizard-DqDBwHrF.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),iP=C.lazy(()=>Yr(()=>import("./UserManagement-B4kZHyri.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),lP=C.lazy(()=>Yr(()=>import("./ShareManagement-TAAdI_gY.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),uP=C.lazy(()=>Yr(()=>import("./PublicViewer-8YqGrVVB.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),cP=C.lazy(()=>Yr(()=>import("./EventManagement-CTuAJ0eF.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),dP=C.lazy(()=>Yr(()=>import("./ExplorePage-ZJ3zNjNQ.js"),__vite__mapDeps([7,1]))),Rl=()=>d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});function T0(e){const t=e.replace(/^#?/,"");if(t==="/explore")return{type:"explore",name:"",params:{}};const n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};if(t==="/events")return{type:"events",name:"",params:{}};const[r,s]=t.split("?"),i=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(i&&i[1]&&i[2]){const y={};if(s)for(const[g,b]of new URLSearchParams(s).entries())y[g]=b;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,u]=t.split("?"),f=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(f&&f[2]){const y={};if(u)for(const[g,b]of new URLSearchParams(u).entries())y[g]=b;return{type:"chart_detail",name:decodeURIComponent(f[2]),params:y}}const h=l==null?void 0:l.match(/^\/(dashboards|charts)\/(.+)$/);if(!h||!h[1]||!h[2])return null;const p={};if(u)for(const[y,g]of new URLSearchParams(u).entries())p[y]=g;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function xb(e,t){return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsxs("div",{className:"text-center max-w-md p-8",children:[d.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:d.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),d.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),d.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Reload page"})]})})}function fP(){DN();const e=So(k=>k.auth),t=So(k=>k.checkAuth),n=wd();C.useEffect(()=>{t()},[t]);const{data:r,isLoading:s}=ga(),{data:i,isLoading:l}=hv(),u=ot(k=>k.resetFilters),[f,h]=C.useState(()=>window.location.hash.replace(/^#/,"")||"");C.useEffect(()=>{const k=()=>{h(window.location.hash.replace(/^#/,"")||""),u()};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[u]);const p=C.useCallback(k=>{window.location.hash=k,h(k),u()},[u]);C.useEffect(()=>{s||l||f||(i&&i.length>0&&i[0]?p(`/dashboards/${i[0].name}`):r!=null&&r.charts&&r.charts.length>0&&r.charts[0]&&p(`/charts/${r.charts[0].name}`))},[s,l,i,r,f,p]);const y=T0(f);if(y&&(y.type==="public_chart"||y.type==="public_dashboard"))return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(uP,{parsed:{type:y.type,name:y.name,params:y.params}})});if(e.status==="loading")return d.jsx(Rl,{});if(e.status==="needs_setup")return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(aP,{})});if(e.status==="unauthenticated")return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(oP,{})});const g=T0(f);if((g==null?void 0:g.type)==="explore")return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(dP,{})})})});if(s||l)return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});const b=T0(f),O=()=>b?b.type==="settings"&&b.name==="users"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(iP,{})}):b.type==="settings"&&b.name==="shares"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(lP,{})}):b.type==="events"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(cP,{})}):b.type==="dashboard"?d.jsx(sP,{dashboardId:b.name,initialTab:b.params.tab}):b.type==="chart_detail"?d.jsx(sA,{chartName:b.name,params:b.params}):d.jsx(rA,{chartName:b.name,drillParams:b.params}):d.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"text-sm",children:"Select a dashboard or chart from the sidebar"}),n&&d.jsxs("a",{href:"#/explore",className:"flex items-center gap-1.5 text-sm hover:underline",style:{color:"var(--yc-color-primary)"},onClick:k=>{k.preventDefault(),p("/explore")},children:[d.jsx("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 15.803a7.5 7.5 0 0010.607 10.607z"})}),"Explore your data"]})]});return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(SO,{currentPath:f,onNavigate:p,onNavigateToUsers:()=>p("/settings/users"),onNavigateToShares:()=>p("/settings/shares"),children:O()})})})}fk.createRoot(document.getElementById("root")).render(d.jsx(C.StrictMode,{children:d.jsx(Wk,{children:d.jsx(fP,{})})}));export{cu as A,W2 as B,ld as C,R2 as D,sm as E,I2 as F,J2 as G,G2 as H,dn as I,Tm as J,GN as K,z2 as L,e2 as M,TO as N,wO as O,$2 as P,M2 as S,om as T,X2 as W,Yr as _,xt as a,Kb as b,$n as c,fv as d,ga as e,Mm as f,ot as g,wd as h,Rs as i,d as j,eE as k,Z6 as l,K2 as m,Q2 as n,V2 as o,q2 as p,Y2 as q,yP as r,sP as s,qn as t,So as u,or as v,Za as w,ks as x,x6 as y,Xa as z};
@@ -1,4 +1,4 @@
1
- import{c as Da,g as il}from"./echarts-DtOYsfLX.js";import{_ as Va}from"./jspdf.es.min-CTZVk96E.js";import"./index-lklRbe2I.js";var fn={},cn={},cr,vn;function Q(){if(vn)return cr;vn=1;var n=function(e){return e&&e.Math===Math&&e};return cr=n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof Da=="object"&&Da)||n(typeof cr=="object"&&cr)||(function(){return this})()||Function("return this")(),cr}var Qr={},Zr,gn;function Z(){return gn||(gn=1,Zr=function(n){try{return!!n()}catch{return!0}}),Zr}var Jr,dn;function we(){if(dn)return Jr;dn=1;var n=Z();return Jr=!n(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jr}var et,pn;function Ar(){if(pn)return et;pn=1;var n=Z();return et=!n(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),et}var rt,yn;function ne(){if(yn)return rt;yn=1;var n=Ar(),e=Function.prototype.call;return rt=n?e.bind(e):function(){return e.apply(e,arguments)},rt}var tt={},mn;function Yl(){if(mn)return tt;mn=1;var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!n.call({1:2},1);return tt.f=r?function(i){var a=e(this,i);return!!a&&a.enumerable}:n,tt}var it,bn;function Fa(){return bn||(bn=1,it=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}}),it}var at,xn;function J(){if(xn)return at;xn=1;var n=Ar(),e=Function.prototype,r=e.call,t=n&&e.bind.bind(r,r);return at=n?t:function(i){return function(){return r.apply(i,arguments)}},at}var nt,On;function er(){if(On)return nt;On=1;var n=J(),e=n({}.toString),r=n("".slice);return nt=function(t){return r(e(t),8,-1)},nt}var st,Tn;function al(){if(Tn)return st;Tn=1;var n=J(),e=Z(),r=er(),t=Object,i=n("".split);return st=e(function(){return!t("z").propertyIsEnumerable(0)})?function(a){return r(a)==="String"?i(a,""):t(a)}:t,st}var ot,Sn;function Ir(){return Sn||(Sn=1,ot=function(n){return n==null}),ot}var ut,En;function Pe(){if(En)return ut;En=1;var n=Ir(),e=TypeError;return ut=function(r){if(n(r))throw new e("Can't call method on "+r);return r},ut}var lt,Rn;function dr(){if(Rn)return lt;Rn=1;var n=al(),e=Pe();return lt=function(r){return n(e(r))},lt}var ht,Cn;function re(){if(Cn)return ht;Cn=1;var n=typeof document=="object"&&document.all;return ht=typeof n>"u"&&n!==void 0?function(e){return typeof e=="function"||e===n}:function(e){return typeof e=="function"},ht}var ft,wn;function pe(){if(wn)return ft;wn=1;var n=re();return ft=function(e){return typeof e=="object"?e!==null:n(e)},ft}var ct,Pn;function rr(){if(Pn)return ct;Pn=1;var n=Q(),e=re(),r=function(t){return e(t)?t:void 0};return ct=function(t,i){return arguments.length<2?r(n[t]):n[t]&&n[t][i]},ct}var vt,An;function Nr(){if(An)return vt;An=1;var n=J();return vt=n({}.isPrototypeOf),vt}var gt,In;function pr(){if(In)return gt;In=1;var n=Q(),e=n.navigator,r=e&&e.userAgent;return gt=r?String(r):"",gt}var dt,Nn;function Ua(){if(Nn)return dt;Nn=1;var n=Q(),e=pr(),r=n.process,t=n.Deno,i=r&&r.versions||t&&t.version,a=i&&i.v8,s,o;return a&&(s=a.split("."),o=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!o&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(o=+s[1]))),dt=o,dt}var pt,_n;function nl(){if(_n)return pt;_n=1;var n=Ua(),e=Z(),r=Q(),t=r.String;return pt=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!t(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&n&&n<41}),pt}var yt,Mn;function sl(){if(Mn)return yt;Mn=1;var n=nl();return yt=n&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yt}var mt,qn;function ol(){if(qn)return mt;qn=1;var n=rr(),e=re(),r=Nr(),t=sl(),i=Object;return mt=t?function(a){return typeof a=="symbol"}:function(a){var s=n("Symbol");return e(s)&&r(s.prototype,i(a))},mt}var bt,Dn;function _r(){if(Dn)return bt;Dn=1;var n=String;return bt=function(e){try{return n(e)}catch{return"Object"}},bt}var xt,Vn;function Fe(){if(Vn)return xt;Vn=1;var n=re(),e=_r(),r=TypeError;return xt=function(t){if(n(t))return t;throw new r(e(t)+" is not a function")},xt}var Ot,Ln;function nr(){if(Ln)return Ot;Ln=1;var n=Fe(),e=Ir();return Ot=function(r,t){var i=r[t];return e(i)?void 0:n(i)},Ot}var Tt,kn;function Xl(){if(kn)return Tt;kn=1;var n=ne(),e=re(),r=pe(),t=TypeError;return Tt=function(i,a){var s,o;if(a==="string"&&e(s=i.toString)&&!r(o=n(s,i))||e(s=i.valueOf)&&!r(o=n(s,i))||a!=="string"&&e(s=i.toString)&&!r(o=n(s,i)))return o;throw new t("Can't convert object to primitive value")},Tt}var St={exports:{}},Et,jn;function Me(){return jn||(jn=1,Et=!1),Et}var Rt,Bn;function Ga(){if(Bn)return Rt;Bn=1;var n=Q(),e=Object.defineProperty;return Rt=function(r,t){try{e(n,r,{value:t,configurable:!0,writable:!0})}catch{n[r]=t}return t},Rt}var Fn;function $a(){if(Fn)return St.exports;Fn=1;var n=Me(),e=Q(),r=Ga(),t="__core-js_shared__",i=St.exports=e[t]||r(t,{});return(i.versions||(i.versions=[])).push({version:"3.48.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),St.exports}var Ct,Un;function za(){if(Un)return Ct;Un=1;var n=$a();return Ct=function(e,r){return n[e]||(n[e]=r||{})},Ct}var wt,Gn;function Mr(){if(Gn)return wt;Gn=1;var n=Pe(),e=Object;return wt=function(r){return e(n(r))},wt}var Pt,$n;function Ae(){if($n)return Pt;$n=1;var n=J(),e=Mr(),r=n({}.hasOwnProperty);return Pt=Object.hasOwn||function(i,a){return r(e(i),a)},Pt}var At,zn;function ul(){if(zn)return At;zn=1;var n=J(),e=0,r=Math.random(),t=n(1.1.toString);return At=function(i){return"Symbol("+(i===void 0?"":i)+")_"+t(++e+r,36)},At}var It,Hn;function ae(){if(Hn)return It;Hn=1;var n=Q(),e=za(),r=Ae(),t=ul(),i=nl(),a=sl(),s=n.Symbol,o=e("wks"),u=a?s.for||s:s&&s.withoutSetter||t;return It=function(l){return r(o,l)||(o[l]=i&&r(s,l)?s[l]:u("Symbol."+l)),o[l]},It}var Nt,Wn;function Kl(){if(Wn)return Nt;Wn=1;var n=ne(),e=pe(),r=ol(),t=nr(),i=Xl(),a=ae(),s=TypeError,o=a("toPrimitive");return Nt=function(u,l){if(!e(u)||r(u))return u;var h=t(u,o),c;if(h){if(l===void 0&&(l="default"),c=n(h,u,l),!e(c)||r(c))return c;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),i(u,l)},Nt}var _t,Yn;function ll(){if(Yn)return _t;Yn=1;var n=Kl(),e=ol();return _t=function(r){var t=n(r,"string");return e(t)?t:t+""},_t}var Mt,Xn;function qr(){if(Xn)return Mt;Xn=1;var n=Q(),e=pe(),r=n.document,t=e(r)&&e(r.createElement);return Mt=function(i){return t?r.createElement(i):{}},Mt}var qt,Kn;function hl(){if(Kn)return qt;Kn=1;var n=we(),e=Z(),r=qr();return qt=!n&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),qt}var Qn;function Dr(){if(Qn)return Qr;Qn=1;var n=we(),e=ne(),r=Yl(),t=Fa(),i=dr(),a=ll(),s=Ae(),o=hl(),u=Object.getOwnPropertyDescriptor;return Qr.f=n?u:function(h,c){if(h=i(h),c=a(c),o)try{return u(h,c)}catch{}if(s(h,c))return t(!e(r.f,h,c),h[c])},Qr}var Dt={},Vt,Zn;function fl(){if(Zn)return Vt;Zn=1;var n=we(),e=Z();return Vt=n&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Vt}var Lt,Jn;function le(){if(Jn)return Lt;Jn=1;var n=pe(),e=String,r=TypeError;return Lt=function(t){if(n(t))return t;throw new r(e(t)+" is not an object")},Lt}var es;function Ye(){if(es)return Dt;es=1;var n=we(),e=hl(),r=fl(),t=le(),i=ll(),a=TypeError,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",h="writable";return Dt.f=n?r?function(v,f,g){if(t(v),f=i(f),t(g),typeof v=="function"&&f==="prototype"&&"value"in g&&h in g&&!g[h]){var d=o(v,f);d&&d[h]&&(v[f]=g.value,g={configurable:l in g?g[l]:d[l],enumerable:u in g?g[u]:d[u],writable:!1})}return s(v,f,g)}:s:function(v,f,g){if(t(v),f=i(f),t(g),e)try{return s(v,f,g)}catch{}if("get"in g||"set"in g)throw new a("Accessors not supported");return"value"in g&&(v[f]=g.value),v},Dt}var kt,rs;function yr(){if(rs)return kt;rs=1;var n=we(),e=Ye(),r=Fa();return kt=n?function(t,i,a){return e.f(t,i,r(1,a))}:function(t,i,a){return t[i]=a,t},kt}var jt={exports:{}},Bt,ts;function Vr(){if(ts)return Bt;ts=1;var n=we(),e=Ae(),r=Function.prototype,t=n&&Object.getOwnPropertyDescriptor,i=e(r,"name"),a=i&&(function(){}).name==="something",s=i&&(!n||n&&t(r,"name").configurable);return Bt={EXISTS:i,PROPER:a,CONFIGURABLE:s},Bt}var Ft,is;function Ha(){if(is)return Ft;is=1;var n=J(),e=re(),r=$a(),t=n(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(i){return t(i)}),Ft=r.inspectSource,Ft}var Ut,as;function Ql(){if(as)return Ut;as=1;var n=Q(),e=re(),r=n.WeakMap;return Ut=e(r)&&/native code/.test(String(r)),Ut}var Gt,ns;function Wa(){if(ns)return Gt;ns=1;var n=za(),e=ul(),r=n("keys");return Gt=function(t){return r[t]||(r[t]=e(t))},Gt}var $t,ss;function Ya(){return ss||(ss=1,$t={}),$t}var zt,os;function Lr(){if(os)return zt;os=1;var n=Ql(),e=Q(),r=pe(),t=yr(),i=Ae(),a=$a(),s=Wa(),o=Ya(),u="Object already initialized",l=e.TypeError,h=e.WeakMap,c,v,f,g=function(m){return f(m)?v(m):c(m,{})},d=function(m){return function(b){var x;if(!r(b)||(x=v(b)).type!==m)throw new l("Incompatible receiver, "+m+" required");return x}};if(n||a.state){var p=a.state||(a.state=new h);p.get=p.get,p.has=p.has,p.set=p.set,c=function(m,b){if(p.has(m))throw new l(u);return b.facade=m,p.set(m,b),b},v=function(m){return p.get(m)||{}},f=function(m){return p.has(m)}}else{var y=s("state");o[y]=!0,c=function(m,b){if(i(m,y))throw new l(u);return b.facade=m,t(m,y,b),b},v=function(m){return i(m,y)?m[y]:{}},f=function(m){return i(m,y)}}return zt={set:c,get:v,has:f,enforce:g,getterFor:d},zt}var us;function cl(){if(us)return jt.exports;us=1;var n=J(),e=Z(),r=re(),t=Ae(),i=we(),a=Vr().CONFIGURABLE,s=Ha(),o=Lr(),u=o.enforce,l=o.get,h=String,c=Object.defineProperty,v=n("".slice),f=n("".replace),g=n([].join),d=i&&!e(function(){return c(function(){},"length",{value:8}).length!==8}),p=String(String).split("String"),y=jt.exports=function(m,b,x){v(h(b),0,7)==="Symbol("&&(b="["+f(h(b),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),x&&x.getter&&(b="get "+b),x&&x.setter&&(b="set "+b),(!t(m,"name")||a&&m.name!==b)&&(i?c(m,"name",{value:b,configurable:!0}):m.name=b),d&&x&&t(x,"arity")&&m.length!==x.arity&&c(m,"length",{value:x.arity});try{x&&t(x,"constructor")&&x.constructor?i&&c(m,"prototype",{writable:!1}):m.prototype&&(m.prototype=void 0)}catch{}var S=u(m);return t(S,"source")||(S.source=g(p,typeof b=="string"?b:"")),m};return Function.prototype.toString=y(function(){return r(this)&&l(this).source||s(this)},"toString"),jt.exports}var Ht,ls;function tr(){if(ls)return Ht;ls=1;var n=re(),e=Ye(),r=cl(),t=Ga();return Ht=function(i,a,s,o){o||(o={});var u=o.enumerable,l=o.name!==void 0?o.name:a;if(n(s)&&r(s,l,o),o.global)u?i[a]=s:t(a,s);else{try{o.unsafe?i[a]&&(u=!0):delete i[a]}catch{}u?i[a]=s:e.f(i,a,{value:s,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return i},Ht}var Wt={},Yt,hs;function Zl(){if(hs)return Yt;hs=1;var n=Math.ceil,e=Math.floor;return Yt=Math.trunc||function(t){var i=+t;return(i>0?e:n)(i)},Yt}var Xt,fs;function kr(){if(fs)return Xt;fs=1;var n=Zl();return Xt=function(e){var r=+e;return r!==r||r===0?0:n(r)},Xt}var Kt,cs;function Jl(){if(cs)return Kt;cs=1;var n=kr(),e=Math.max,r=Math.min;return Kt=function(t,i){var a=n(t);return a<0?e(a+i,0):r(a,i)},Kt}var Qt,vs;function sr(){if(vs)return Qt;vs=1;var n=kr(),e=Math.min;return Qt=function(r){var t=n(r);return t>0?e(t,9007199254740991):0},Qt}var Zt,gs;function Xa(){if(gs)return Zt;gs=1;var n=sr();return Zt=function(e){return n(e.length)},Zt}var Jt,ds;function vl(){if(ds)return Jt;ds=1;var n=dr(),e=Jl(),r=Xa(),t=function(i){return function(a,s,o){var u=n(a),l=r(u);if(l===0)return!i&&-1;var h=e(o,l),c;if(i&&s!==s){for(;l>h;)if(c=u[h++],c!==c)return!0}else for(;l>h;h++)if((i||h in u)&&u[h]===s)return i||h||0;return!i&&-1}};return Jt={includes:t(!0),indexOf:t(!1)},Jt}var ei,ps;function gl(){if(ps)return ei;ps=1;var n=J(),e=Ae(),r=dr(),t=vl().indexOf,i=Ya(),a=n([].push);return ei=function(s,o){var u=r(s),l=0,h=[],c;for(c in u)!e(i,c)&&e(u,c)&&a(h,c);for(;o.length>l;)e(u,c=o[l++])&&(~t(h,c)||a(h,c));return h},ei}var ri,ys;function Ka(){return ys||(ys=1,ri=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ri}var ms;function eh(){if(ms)return Wt;ms=1;var n=gl(),e=Ka(),r=e.concat("length","prototype");return Wt.f=Object.getOwnPropertyNames||function(i){return n(i,r)},Wt}var ti={},bs;function rh(){return bs||(bs=1,ti.f=Object.getOwnPropertySymbols),ti}var ii,xs;function th(){if(xs)return ii;xs=1;var n=rr(),e=J(),r=eh(),t=rh(),i=le(),a=e([].concat);return ii=n("Reflect","ownKeys")||function(o){var u=r.f(i(o)),l=t.f;return l?a(u,l(o)):u},ii}var ai,Os;function ih(){if(Os)return ai;Os=1;var n=Ae(),e=th(),r=Dr(),t=Ye();return ai=function(i,a,s){for(var o=e(a),u=t.f,l=r.f,h=0;h<o.length;h++){var c=o[h];!n(i,c)&&!(s&&n(s,c))&&u(i,c,l(a,c))}},ai}var ni,Ts;function dl(){if(Ts)return ni;Ts=1;var n=Z(),e=re(),r=/#|\.prototype\./,t=function(u,l){var h=a[i(u)];return h===o?!0:h===s?!1:e(l)?n(l):!!l},i=t.normalize=function(u){return String(u).replace(r,".").toLowerCase()},a=t.data={},s=t.NATIVE="N",o=t.POLYFILL="P";return ni=t,ni}var si,Ss;function he(){if(Ss)return si;Ss=1;var n=Q(),e=Dr().f,r=yr(),t=tr(),i=Ga(),a=ih(),s=dl();return si=function(o,u){var l=o.target,h=o.global,c=o.stat,v,f,g,d,p,y;if(h?f=n:c?f=n[l]||i(l,{}):f=n[l]&&n[l].prototype,f)for(g in u){if(p=u[g],o.dontCallGetSet?(y=e(f,g),d=y&&y.value):d=f[g],v=s(h?g:l+(c?".":"#")+g,o.forced),!v&&d!==void 0){if(typeof p==typeof d)continue;a(p,d)}(o.sham||d&&d.sham)&&r(p,"sham",!0),t(f,g,p,o)}},si}var oi,Es;function pl(){if(Es)return oi;Es=1;var n=Q(),e=pr(),r=er(),t=function(i){return e.slice(0,i.length)===i};return oi=(function(){return t("Bun/")?"BUN":t("Cloudflare-Workers")?"CLOUDFLARE":t("Deno/")?"DENO":t("Node.js/")?"NODE":n.Bun&&typeof Bun.version=="string"?"BUN":n.Deno&&typeof Deno.version=="object"?"DENO":r(n.process)==="process"?"NODE":n.window&&n.document?"BROWSER":"REST"})(),oi}var ui,Rs;function jr(){if(Rs)return ui;Rs=1;var n=pl();return ui=n==="NODE",ui}var li,Cs;function ah(){if(Cs)return li;Cs=1;var n=Q();return li=n,li}var hi,ws;function nh(){if(ws)return hi;ws=1;var n=J(),e=Fe();return hi=function(r,t,i){try{return n(e(Object.getOwnPropertyDescriptor(r,t)[i]))}catch{}},hi}var fi,Ps;function sh(){if(Ps)return fi;Ps=1;var n=pe();return fi=function(e){return n(e)||e===null},fi}var ci,As;function oh(){if(As)return ci;As=1;var n=sh(),e=String,r=TypeError;return ci=function(t){if(n(t))return t;throw new r("Can't set "+e(t)+" as a prototype")},ci}var vi,Is;function yl(){if(Is)return vi;Is=1;var n=nh(),e=pe(),r=Pe(),t=oh();return vi=Object.setPrototypeOf||("__proto__"in{}?(function(){var i=!1,a={},s;try{s=n(Object.prototype,"__proto__","set"),s(a,[]),i=a instanceof Array}catch{}return function(u,l){return r(u),t(l),e(u)&&(i?s(u,l):u.__proto__=l),u}})():void 0),vi}var gi,Ns;function Br(){if(Ns)return gi;Ns=1;var n=Ye().f,e=Ae(),r=ae(),t=r("toStringTag");return gi=function(i,a,s){i&&!s&&(i=i.prototype),i&&!e(i,t)&&n(i,t,{configurable:!0,value:a})},gi}var di,_s;function uh(){if(_s)return di;_s=1;var n=cl(),e=Ye();return di=function(r,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),e.f(r,t,i)},di}var pi,Ms;function lh(){if(Ms)return pi;Ms=1;var n=rr(),e=uh(),r=ae(),t=we(),i=r("species");return pi=function(a){var s=n(a);t&&s&&!s[i]&&e(s,i,{configurable:!0,get:function(){return this}})},pi}var yi,qs;function hh(){if(qs)return yi;qs=1;var n=Nr(),e=TypeError;return yi=function(r,t){if(n(t,r))return r;throw new e("Incorrect invocation")},yi}var mi,Ds;function fh(){if(Ds)return mi;Ds=1;var n=ae(),e=n("toStringTag"),r={};return r[e]="z",mi=String(r)==="[object z]",mi}var bi,Vs;function Qa(){if(Vs)return bi;Vs=1;var n=fh(),e=re(),r=er(),t=ae(),i=t("toStringTag"),a=Object,s=r((function(){return arguments})())==="Arguments",o=function(u,l){try{return u[l]}catch{}};return bi=n?r:function(u){var l,h,c;return u===void 0?"Undefined":u===null?"Null":typeof(h=o(l=a(u),i))=="string"?h:s?r(l):(c=r(l))==="Object"&&e(l.callee)?"Arguments":c},bi}var xi,Ls;function ch(){if(Ls)return xi;Ls=1;var n=J(),e=Z(),r=re(),t=Qa(),i=rr(),a=Ha(),s=function(){},o=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=n(u.exec),h=!u.test(s),c=function(g){if(!r(g))return!1;try{return o(s,[],g),!0}catch{return!1}},v=function(g){if(!r(g))return!1;switch(t(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(u,a(g))}catch{return!0}};return v.sham=!0,xi=!o||e(function(){var f;return c(c.call)||!c(Object)||!c(function(){f=!0})||f})?v:c,xi}var Oi,ks;function vh(){if(ks)return Oi;ks=1;var n=ch(),e=_r(),r=TypeError;return Oi=function(t){if(n(t))return t;throw new r(e(t)+" is not a constructor")},Oi}var Ti,js;function ml(){if(js)return Ti;js=1;var n=le(),e=vh(),r=Ir(),t=ae(),i=t("species");return Ti=function(a,s){var o=n(a).constructor,u;return o===void 0||r(u=n(o)[i])?s:e(u)},Ti}var Si,Bs;function bl(){if(Bs)return Si;Bs=1;var n=Ar(),e=Function.prototype,r=e.apply,t=e.call;return Si=typeof Reflect=="object"&&Reflect.apply||(n?t.bind(r):function(){return t.apply(r,arguments)}),Si}var Ei,Fs;function Fr(){if(Fs)return Ei;Fs=1;var n=er(),e=J();return Ei=function(r){if(n(r)==="Function")return e(r)},Ei}var Ri,Us;function Za(){if(Us)return Ri;Us=1;var n=Fr(),e=Fe(),r=Ar(),t=n(n.bind);return Ri=function(i,a){return e(i),a===void 0?i:r?t(i,a):function(){return i.apply(a,arguments)}},Ri}var Ci,Gs;function xl(){if(Gs)return Ci;Gs=1;var n=rr();return Ci=n("document","documentElement"),Ci}var wi,$s;function gh(){if($s)return wi;$s=1;var n=J();return wi=n([].slice),wi}var Pi,zs;function dh(){if(zs)return Pi;zs=1;var n=TypeError;return Pi=function(e,r){if(e<r)throw new n("Not enough arguments");return e},Pi}var Ai,Hs;function Ol(){if(Hs)return Ai;Hs=1;var n=pr();return Ai=/(?:ipad|iphone|ipod).*applewebkit/i.test(n),Ai}var Ii,Ws;function Tl(){if(Ws)return Ii;Ws=1;var n=Q(),e=bl(),r=Za(),t=re(),i=Ae(),a=Z(),s=xl(),o=gh(),u=qr(),l=dh(),h=Ol(),c=jr(),v=n.setImmediate,f=n.clearImmediate,g=n.process,d=n.Dispatch,p=n.Function,y=n.MessageChannel,m=n.String,b=0,x={},S="onreadystatechange",E,O,P,_;a(function(){E=n.location});var A=function(C){if(i(x,C)){var w=x[C];delete x[C],w()}},q=function(C){return function(){A(C)}},I=function(C){A(C.data)},j=function(C){n.postMessage(m(C),E.protocol+"//"+E.host)};return(!v||!f)&&(v=function(w){l(arguments.length,1);var U=t(w)?w:p(w),L=o(arguments,1);return x[++b]=function(){e(U,void 0,L)},O(b),b},f=function(w){delete x[w]},c?O=function(C){g.nextTick(q(C))}:d&&d.now?O=function(C){d.now(q(C))}:y&&!h?(P=new y,_=P.port2,P.port1.onmessage=I,O=r(_.postMessage,_)):n.addEventListener&&t(n.postMessage)&&!n.importScripts&&E&&E.protocol!=="file:"&&!a(j)?(O=j,n.addEventListener("message",I,!1)):S in u("script")?O=function(C){s.appendChild(u("script"))[S]=function(){s.removeChild(this),A(C)}}:O=function(C){setTimeout(q(C),0)}),Ii={set:v,clear:f},Ii}var Ni,Ys;function ph(){if(Ys)return Ni;Ys=1;var n=Q(),e=we(),r=Object.getOwnPropertyDescriptor;return Ni=function(t){if(!e)return n[t];var i=r(n,t);return i&&i.value},Ni}var _i,Xs;function Sl(){if(Xs)return _i;Xs=1;var n=function(){this.head=null,this.tail=null};return n.prototype={add:function(e){var r={item:e,next:null},t=this.tail;t?t.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},_i=n,_i}var Mi,Ks;function yh(){if(Ks)return Mi;Ks=1;var n=pr();return Mi=/ipad|iphone|ipod/i.test(n)&&typeof Pebble<"u",Mi}var qi,Qs;function mh(){if(Qs)return qi;Qs=1;var n=pr();return qi=/web0s(?!.*chrome)/i.test(n),qi}var Di,Zs;function bh(){if(Zs)return Di;Zs=1;var n=Q(),e=ph(),r=Za(),t=Tl().set,i=Sl(),a=Ol(),s=yh(),o=mh(),u=jr(),l=n.MutationObserver||n.WebKitMutationObserver,h=n.document,c=n.process,v=n.Promise,f=e("queueMicrotask"),g,d,p,y,m;if(!f){var b=new i,x=function(){var S,E;for(u&&(S=c.domain)&&S.exit();E=b.get();)try{E()}catch(O){throw b.head&&g(),O}S&&S.enter()};!a&&!u&&!o&&l&&h?(d=!0,p=h.createTextNode(""),new l(x).observe(p,{characterData:!0}),g=function(){p.data=d=!d}):!s&&v&&v.resolve?(y=v.resolve(void 0),y.constructor=v,m=r(y.then,y),g=function(){m(x)}):u?g=function(){c.nextTick(x)}:(t=r(t,n),g=function(){t(x)}),f=function(S){b.head||g(),b.add(S)}}return Di=f,Di}var Vi,Js;function xh(){return Js||(Js=1,Vi=function(n,e){try{arguments.length===1?console.error(n):console.error(n,e)}catch{}}),Vi}var Li,eo;function Ja(){return eo||(eo=1,Li=function(n){try{return{error:!1,value:n()}}catch(e){return{error:!0,value:e}}}),Li}var ki,ro;function mr(){if(ro)return ki;ro=1;var n=Q();return ki=n.Promise,ki}var ji,to;function br(){if(to)return ji;to=1;var n=Q(),e=mr(),r=re(),t=dl(),i=Ha(),a=ae(),s=pl(),o=Me(),u=Ua(),l=e&&e.prototype,h=a("species"),c=!1,v=r(n.PromiseRejectionEvent),f=t("Promise",function(){var g=i(e),d=g!==String(e);if(!d&&u===66||o&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(g)){var p=new e(function(b){b(1)}),y=function(b){b(function(){},function(){})},m=p.constructor={};if(m[h]=y,c=p.then(function(){})instanceof y,!c)return!0}return!d&&(s==="BROWSER"||s==="DENO")&&!v});return ji={CONSTRUCTOR:f,REJECTION_EVENT:v,SUBCLASSING:c},ji}var Bi={},io;function xr(){if(io)return Bi;io=1;var n=Fe(),e=TypeError,r=function(t){var i,a;this.promise=new t(function(s,o){if(i!==void 0||a!==void 0)throw new e("Bad Promise constructor");i=s,a=o}),this.resolve=n(i),this.reject=n(a)};return Bi.f=function(t){return new r(t)},Bi}var ao;function Oh(){if(ao)return cn;ao=1;var n=he(),e=Me(),r=jr(),t=Q(),i=ah(),a=ne(),s=tr(),o=yl(),u=Br(),l=lh(),h=Fe(),c=re(),v=pe(),f=hh(),g=ml(),d=Tl().set,p=bh(),y=xh(),m=Ja(),b=Sl(),x=Lr(),S=mr(),E=br(),O=xr(),P="Promise",_=E.CONSTRUCTOR,A=E.REJECTION_EVENT,q=E.SUBCLASSING,I=x.getterFor(P),j=x.set,C=S&&S.prototype,w=S,U=C,L=t.TypeError,V=t.document,M=t.process,N=O.f,k=N,z=!!(V&&V.createEvent&&t.dispatchEvent),H="unhandledrejection",X="rejectionhandled",se=0,be=1,oe=2,Ue=1,Ge=2,fe,Ne,_e,me,ce=function(R){var B;return v(R)&&c(B=R.then)?B:!1},xe=function(R,B){var G=B.value,$=B.state===be,W=$?R.ok:R.fail,Te=R.resolve,Le=R.reject,Se=R.domain,Ee,lr,hr;try{W?($||(B.rejection===Ge&&$e(B),B.rejection=Ue),W===!0?Ee=G:(Se&&Se.enter(),Ee=W(G),Se&&(Se.exit(),hr=!0)),Ee===R.promise?Le(new L("Promise-chain cycle")):(lr=ce(Ee))?a(lr,Ee,Te,Le):Te(Ee)):Le(G)}catch(fr){Se&&!hr&&Se.exit(),Le(fr)}},De=function(R,B){R.notified||(R.notified=!0,p(function(){for(var G=R.reactions,$;$=G.get();)xe($,R);R.notified=!1,B&&!R.rejection&&Xe(R)}))},Ve=function(R,B,G){var $,W;z?($=V.createEvent("Event"),$.promise=B,$.reason=G,$.initEvent(R,!1,!0),t.dispatchEvent($)):$={promise:B,reason:G},!A&&(W=t["on"+R])?W($):R===H&&y("Unhandled promise rejection",G)},Xe=function(R){a(d,t,function(){var B=R.facade,G=R.value,$=ur(R),W;if($&&(W=m(function(){r?M.emit("unhandledRejection",G,B):Ve(H,B,G)}),R.rejection=r||ur(R)?Ge:Ue,W.error))throw W.value})},ur=function(R){return R.rejection!==Ue&&!R.parent},$e=function(R){a(d,t,function(){var B=R.facade;r?M.emit("rejectionHandled",B):Ve(X,B,R.value)})},ve=function(R,B,G){return function($){R(B,$,G)}},ge=function(R,B,G){R.done||(R.done=!0,G&&(R=G),R.value=B,R.state=oe,De(R,!0))},Oe=function(R,B,G){if(!R.done){R.done=!0,G&&(R=G);try{if(R.facade===B)throw new L("Promise can't be resolved itself");var $=ce(B);$?p(function(){var W={done:!1};try{a($,B,ve(Oe,W,R),ve(ge,W,R))}catch(Te){ge(W,Te,R)}}):(R.value=B,R.state=be,De(R,!1))}catch(W){ge({done:!1},W,R)}}};if(_&&(w=function(B){f(this,U),h(B),a(fe,this);var G=I(this);try{B(ve(Oe,G),ve(ge,G))}catch($){ge(G,$)}},U=w.prototype,fe=function(B){j(this,{type:P,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:se,value:null})},fe.prototype=s(U,"then",function(B,G){var $=I(this),W=N(g(this,w));return $.parent=!0,W.ok=c(B)?B:!0,W.fail=c(G)&&G,W.domain=r?M.domain:void 0,$.state===se?$.reactions.add(W):p(function(){xe(W,$)}),W.promise}),Ne=function(){var R=new fe,B=I(R);this.promise=R,this.resolve=ve(Oe,B),this.reject=ve(ge,B)},O.f=N=function(R){return R===w||R===_e?new Ne(R):k(R)},!e&&c(S)&&C!==Object.prototype)){me=C.then,q||s(C,"then",function(B,G){var $=this;return new w(function(W,Te){a(me,$,W,Te)}).then(B,G)},{unsafe:!0});try{delete C.constructor}catch{}o&&o(C,U)}return n({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:w}),_e=i.Promise,u(w,P,!1,!0),l(P),cn}var no={},Fi,so;function Or(){return so||(so=1,Fi={}),Fi}var Ui,oo;function Th(){if(oo)return Ui;oo=1;var n=ae(),e=Or(),r=n("iterator"),t=Array.prototype;return Ui=function(i){return i!==void 0&&(e.Array===i||t[r]===i)},Ui}var Gi,uo;function El(){if(uo)return Gi;uo=1;var n=Qa(),e=nr(),r=Ir(),t=Or(),i=ae(),a=i("iterator");return Gi=function(s){if(!r(s))return e(s,a)||e(s,"@@iterator")||t[n(s)]},Gi}var $i,lo;function Sh(){if(lo)return $i;lo=1;var n=ne(),e=Fe(),r=le(),t=_r(),i=El(),a=TypeError;return $i=function(s,o){var u=arguments.length<2?i(s):o;if(e(u))return r(n(u,s));throw new a(t(s)+" is not iterable")},$i}var zi,ho;function Eh(){if(ho)return zi;ho=1;var n=ne(),e=le(),r=nr();return zi=function(t,i,a){var s,o;e(t);try{if(s=r(t,"return"),!s){if(i==="throw")throw a;return a}s=n(s,t)}catch(u){o=!0,s=u}if(i==="throw")throw a;if(o)throw s;return e(s),a},zi}var Hi,fo;function Rl(){if(fo)return Hi;fo=1;var n=Za(),e=ne(),r=le(),t=_r(),i=Th(),a=Xa(),s=Nr(),o=Sh(),u=El(),l=Eh(),h=TypeError,c=function(f,g){this.stopped=f,this.result=g},v=c.prototype;return Hi=function(f,g,d){var p=d&&d.that,y=!!(d&&d.AS_ENTRIES),m=!!(d&&d.IS_RECORD),b=!!(d&&d.IS_ITERATOR),x=!!(d&&d.INTERRUPTED),S=n(g,p),E,O,P,_,A,q,I,j=function(w){return E&&l(E,"normal"),new c(!0,w)},C=function(w){return y?(r(w),x?S(w[0],w[1],j):S(w[0],w[1])):x?S(w,j):S(w)};if(m)E=f.iterator;else if(b)E=f;else{if(O=u(f),!O)throw new h(t(f)+" is not iterable");if(i(O)){for(P=0,_=a(f);_>P;P++)if(A=C(f[P]),A&&s(v,A))return A;return new c(!1)}E=o(f,O)}for(q=m?f.next:E.next;!(I=e(q,E)).done;){try{A=C(I.value)}catch(w){l(E,"throw",w)}if(typeof A=="object"&&A&&s(v,A))return A}return new c(!1)},Hi}var Wi,co;function Rh(){if(co)return Wi;co=1;var n=ae(),e=n("iterator"),r=!1;try{var t=0,i={next:function(){return{done:!!t++}},return:function(){r=!0}};i[e]=function(){return this},Array.from(i,function(){throw 2})}catch{}return Wi=function(a,s){try{if(!s&&!r)return!1}catch{return!1}var o=!1;try{var u={};u[e]=function(){return{next:function(){return{done:o=!0}}}},a(u)}catch{}return o},Wi}var Yi,vo;function Cl(){if(vo)return Yi;vo=1;var n=mr(),e=Rh(),r=br().CONSTRUCTOR;return Yi=r||!e(function(t){n.all(t).then(void 0,function(){})}),Yi}var go;function Ch(){if(go)return no;go=1;var n=he(),e=ne(),r=Fe(),t=xr(),i=Ja(),a=Rl(),s=Cl();return n({target:"Promise",stat:!0,forced:s},{all:function(u){var l=this,h=t.f(l),c=h.resolve,v=h.reject,f=i(function(){var g=r(l.resolve),d=[],p=0,y=1;a(u,function(m){var b=p++,x=!1;y++,e(g,l,m).then(function(S){x||(x=!0,d[b]=S,--y||c(d))},v)}),--y||c(d)});return f.error&&v(f.value),h.promise}}),no}var po={},yo;function wh(){if(yo)return po;yo=1;var n=he(),e=Me(),r=br().CONSTRUCTOR,t=mr(),i=rr(),a=re(),s=tr(),o=t&&t.prototype;if(n({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&a(t)){var u=i("Promise").prototype.catch;o.catch!==u&&s(o,"catch",u,{unsafe:!0})}return po}var mo={},bo;function Ph(){if(bo)return mo;bo=1;var n=he(),e=ne(),r=Fe(),t=xr(),i=Ja(),a=Rl(),s=Cl();return n({target:"Promise",stat:!0,forced:s},{race:function(u){var l=this,h=t.f(l),c=h.reject,v=i(function(){var f=r(l.resolve);a(u,function(g){e(f,l,g).then(h.resolve,c)})});return v.error&&c(v.value),h.promise}}),mo}var xo={},Oo;function Ah(){if(Oo)return xo;Oo=1;var n=he(),e=xr(),r=br().CONSTRUCTOR;return n({target:"Promise",stat:!0,forced:r},{reject:function(i){var a=e.f(this),s=a.reject;return s(i),a.promise}}),xo}var To={},Xi,So;function Ih(){if(So)return Xi;So=1;var n=le(),e=pe(),r=xr();return Xi=function(t,i){if(n(t),e(i)&&i.constructor===t)return i;var a=r.f(t),s=a.resolve;return s(i),a.promise},Xi}var Eo;function Nh(){if(Eo)return To;Eo=1;var n=he(),e=rr(),r=Me(),t=mr(),i=br().CONSTRUCTOR,a=Ih(),s=e("Promise"),o=r&&!i;return n({target:"Promise",stat:!0,forced:r||i},{resolve:function(l){return a(o&&this===s?t:this,l)}}),To}var Ro;function _h(){return Ro||(Ro=1,Oh(),Ch(),wh(),Ph(),Ah(),Nh()),fn}_h();function Co(n,e,r,t,i,a,s){try{var o=n[a](s),u=o.value}catch(l){return void r(l)}o.done?e(u):Promise.resolve(u).then(t,i)}function Be(n){return function(){var e=this,r=arguments;return new Promise(function(t,i){var a=n.apply(e,r);function s(u){Co(a,t,i,s,o,"next",u)}function o(u){Co(a,t,i,s,o,"throw",u)}s(void 0)})}}var wo={},Po={},Ki,Ao;function qe(){if(Ao)return Ki;Ao=1;var n=Qa(),e=String;return Ki=function(r){if(n(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ki}var Qi,Io;function wl(){if(Io)return Qi;Io=1;var n=le();return Qi=function(){var e=n(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},Qi}var Zi,No;function Pl(){if(No)return Zi;No=1;var n=Z(),e=Q(),r=e.RegExp,t=n(function(){var s=r("a","y");return s.lastIndex=2,s.exec("abcd")!==null}),i=t||n(function(){return!r("a","y").sticky}),a=t||n(function(){var s=r("^r","gy");return s.lastIndex=2,s.exec("str")!==null});return Zi={BROKEN_CARET:a,MISSED_STICKY:i,UNSUPPORTED_Y:t},Zi}var Ji={},ea,_o;function Mh(){if(_o)return ea;_o=1;var n=gl(),e=Ka();return ea=Object.keys||function(t){return n(t,e)},ea}var Mo;function qh(){if(Mo)return Ji;Mo=1;var n=we(),e=fl(),r=Ye(),t=le(),i=dr(),a=Mh();return Ji.f=n&&!e?Object.defineProperties:function(o,u){t(o);for(var l=i(u),h=a(u),c=h.length,v=0,f;c>v;)r.f(o,f=h[v++],l[f]);return o},Ji}var ra,qo;function Ur(){if(qo)return ra;qo=1;var n=le(),e=qh(),r=Ka(),t=Ya(),i=xl(),a=qr(),s=Wa(),o=">",u="<",l="prototype",h="script",c=s("IE_PROTO"),v=function(){},f=function(m){return u+h+o+m+u+"/"+h+o},g=function(m){m.write(f("")),m.close();var b=m.parentWindow.Object;return m=null,b},d=function(){var m=a("iframe"),b="java"+h+":",x;return m.style.display="none",i.appendChild(m),m.src=String(b),x=m.contentWindow.document,x.open(),x.write(f("document.F=Object")),x.close(),x.F},p,y=function(){try{p=new ActiveXObject("htmlfile")}catch{}y=typeof document<"u"?document.domain&&p?g(p):d():g(p);for(var m=r.length;m--;)delete y[l][r[m]];return y()};return t[c]=!0,ra=Object.create||function(b,x){var S;return b!==null?(v[l]=n(b),S=new v,v[l]=null,S[c]=b):S=y(),x===void 0?S:e.f(S,x)},ra}var ta,Do;function Dh(){if(Do)return ta;Do=1;var n=Z(),e=Q(),r=e.RegExp;return ta=n(function(){var t=r(".","s");return!(t.dotAll&&t.test(`
1
+ import{c as Da,g as il}from"./echarts-DtOYsfLX.js";import{_ as Va}from"./jspdf.es.min-ChRx2mOQ.js";import"./index-BgzSjgIu.js";var fn={},cn={},cr,vn;function Q(){if(vn)return cr;vn=1;var n=function(e){return e&&e.Math===Math&&e};return cr=n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof Da=="object"&&Da)||n(typeof cr=="object"&&cr)||(function(){return this})()||Function("return this")(),cr}var Qr={},Zr,gn;function Z(){return gn||(gn=1,Zr=function(n){try{return!!n()}catch{return!0}}),Zr}var Jr,dn;function we(){if(dn)return Jr;dn=1;var n=Z();return Jr=!n(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jr}var et,pn;function Ar(){if(pn)return et;pn=1;var n=Z();return et=!n(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),et}var rt,yn;function ne(){if(yn)return rt;yn=1;var n=Ar(),e=Function.prototype.call;return rt=n?e.bind(e):function(){return e.apply(e,arguments)},rt}var tt={},mn;function Yl(){if(mn)return tt;mn=1;var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!n.call({1:2},1);return tt.f=r?function(i){var a=e(this,i);return!!a&&a.enumerable}:n,tt}var it,bn;function Fa(){return bn||(bn=1,it=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}}),it}var at,xn;function J(){if(xn)return at;xn=1;var n=Ar(),e=Function.prototype,r=e.call,t=n&&e.bind.bind(r,r);return at=n?t:function(i){return function(){return r.apply(i,arguments)}},at}var nt,On;function er(){if(On)return nt;On=1;var n=J(),e=n({}.toString),r=n("".slice);return nt=function(t){return r(e(t),8,-1)},nt}var st,Tn;function al(){if(Tn)return st;Tn=1;var n=J(),e=Z(),r=er(),t=Object,i=n("".split);return st=e(function(){return!t("z").propertyIsEnumerable(0)})?function(a){return r(a)==="String"?i(a,""):t(a)}:t,st}var ot,Sn;function Ir(){return Sn||(Sn=1,ot=function(n){return n==null}),ot}var ut,En;function Pe(){if(En)return ut;En=1;var n=Ir(),e=TypeError;return ut=function(r){if(n(r))throw new e("Can't call method on "+r);return r},ut}var lt,Rn;function dr(){if(Rn)return lt;Rn=1;var n=al(),e=Pe();return lt=function(r){return n(e(r))},lt}var ht,Cn;function re(){if(Cn)return ht;Cn=1;var n=typeof document=="object"&&document.all;return ht=typeof n>"u"&&n!==void 0?function(e){return typeof e=="function"||e===n}:function(e){return typeof e=="function"},ht}var ft,wn;function pe(){if(wn)return ft;wn=1;var n=re();return ft=function(e){return typeof e=="object"?e!==null:n(e)},ft}var ct,Pn;function rr(){if(Pn)return ct;Pn=1;var n=Q(),e=re(),r=function(t){return e(t)?t:void 0};return ct=function(t,i){return arguments.length<2?r(n[t]):n[t]&&n[t][i]},ct}var vt,An;function Nr(){if(An)return vt;An=1;var n=J();return vt=n({}.isPrototypeOf),vt}var gt,In;function pr(){if(In)return gt;In=1;var n=Q(),e=n.navigator,r=e&&e.userAgent;return gt=r?String(r):"",gt}var dt,Nn;function Ua(){if(Nn)return dt;Nn=1;var n=Q(),e=pr(),r=n.process,t=n.Deno,i=r&&r.versions||t&&t.version,a=i&&i.v8,s,o;return a&&(s=a.split("."),o=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!o&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(o=+s[1]))),dt=o,dt}var pt,_n;function nl(){if(_n)return pt;_n=1;var n=Ua(),e=Z(),r=Q(),t=r.String;return pt=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!t(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&n&&n<41}),pt}var yt,Mn;function sl(){if(Mn)return yt;Mn=1;var n=nl();return yt=n&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yt}var mt,qn;function ol(){if(qn)return mt;qn=1;var n=rr(),e=re(),r=Nr(),t=sl(),i=Object;return mt=t?function(a){return typeof a=="symbol"}:function(a){var s=n("Symbol");return e(s)&&r(s.prototype,i(a))},mt}var bt,Dn;function _r(){if(Dn)return bt;Dn=1;var n=String;return bt=function(e){try{return n(e)}catch{return"Object"}},bt}var xt,Vn;function Fe(){if(Vn)return xt;Vn=1;var n=re(),e=_r(),r=TypeError;return xt=function(t){if(n(t))return t;throw new r(e(t)+" is not a function")},xt}var Ot,Ln;function nr(){if(Ln)return Ot;Ln=1;var n=Fe(),e=Ir();return Ot=function(r,t){var i=r[t];return e(i)?void 0:n(i)},Ot}var Tt,kn;function Xl(){if(kn)return Tt;kn=1;var n=ne(),e=re(),r=pe(),t=TypeError;return Tt=function(i,a){var s,o;if(a==="string"&&e(s=i.toString)&&!r(o=n(s,i))||e(s=i.valueOf)&&!r(o=n(s,i))||a!=="string"&&e(s=i.toString)&&!r(o=n(s,i)))return o;throw new t("Can't convert object to primitive value")},Tt}var St={exports:{}},Et,jn;function Me(){return jn||(jn=1,Et=!1),Et}var Rt,Bn;function Ga(){if(Bn)return Rt;Bn=1;var n=Q(),e=Object.defineProperty;return Rt=function(r,t){try{e(n,r,{value:t,configurable:!0,writable:!0})}catch{n[r]=t}return t},Rt}var Fn;function $a(){if(Fn)return St.exports;Fn=1;var n=Me(),e=Q(),r=Ga(),t="__core-js_shared__",i=St.exports=e[t]||r(t,{});return(i.versions||(i.versions=[])).push({version:"3.48.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),St.exports}var Ct,Un;function za(){if(Un)return Ct;Un=1;var n=$a();return Ct=function(e,r){return n[e]||(n[e]=r||{})},Ct}var wt,Gn;function Mr(){if(Gn)return wt;Gn=1;var n=Pe(),e=Object;return wt=function(r){return e(n(r))},wt}var Pt,$n;function Ae(){if($n)return Pt;$n=1;var n=J(),e=Mr(),r=n({}.hasOwnProperty);return Pt=Object.hasOwn||function(i,a){return r(e(i),a)},Pt}var At,zn;function ul(){if(zn)return At;zn=1;var n=J(),e=0,r=Math.random(),t=n(1.1.toString);return At=function(i){return"Symbol("+(i===void 0?"":i)+")_"+t(++e+r,36)},At}var It,Hn;function ae(){if(Hn)return It;Hn=1;var n=Q(),e=za(),r=Ae(),t=ul(),i=nl(),a=sl(),s=n.Symbol,o=e("wks"),u=a?s.for||s:s&&s.withoutSetter||t;return It=function(l){return r(o,l)||(o[l]=i&&r(s,l)?s[l]:u("Symbol."+l)),o[l]},It}var Nt,Wn;function Kl(){if(Wn)return Nt;Wn=1;var n=ne(),e=pe(),r=ol(),t=nr(),i=Xl(),a=ae(),s=TypeError,o=a("toPrimitive");return Nt=function(u,l){if(!e(u)||r(u))return u;var h=t(u,o),c;if(h){if(l===void 0&&(l="default"),c=n(h,u,l),!e(c)||r(c))return c;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),i(u,l)},Nt}var _t,Yn;function ll(){if(Yn)return _t;Yn=1;var n=Kl(),e=ol();return _t=function(r){var t=n(r,"string");return e(t)?t:t+""},_t}var Mt,Xn;function qr(){if(Xn)return Mt;Xn=1;var n=Q(),e=pe(),r=n.document,t=e(r)&&e(r.createElement);return Mt=function(i){return t?r.createElement(i):{}},Mt}var qt,Kn;function hl(){if(Kn)return qt;Kn=1;var n=we(),e=Z(),r=qr();return qt=!n&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),qt}var Qn;function Dr(){if(Qn)return Qr;Qn=1;var n=we(),e=ne(),r=Yl(),t=Fa(),i=dr(),a=ll(),s=Ae(),o=hl(),u=Object.getOwnPropertyDescriptor;return Qr.f=n?u:function(h,c){if(h=i(h),c=a(c),o)try{return u(h,c)}catch{}if(s(h,c))return t(!e(r.f,h,c),h[c])},Qr}var Dt={},Vt,Zn;function fl(){if(Zn)return Vt;Zn=1;var n=we(),e=Z();return Vt=n&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Vt}var Lt,Jn;function le(){if(Jn)return Lt;Jn=1;var n=pe(),e=String,r=TypeError;return Lt=function(t){if(n(t))return t;throw new r(e(t)+" is not an object")},Lt}var es;function Ye(){if(es)return Dt;es=1;var n=we(),e=hl(),r=fl(),t=le(),i=ll(),a=TypeError,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",h="writable";return Dt.f=n?r?function(v,f,g){if(t(v),f=i(f),t(g),typeof v=="function"&&f==="prototype"&&"value"in g&&h in g&&!g[h]){var d=o(v,f);d&&d[h]&&(v[f]=g.value,g={configurable:l in g?g[l]:d[l],enumerable:u in g?g[u]:d[u],writable:!1})}return s(v,f,g)}:s:function(v,f,g){if(t(v),f=i(f),t(g),e)try{return s(v,f,g)}catch{}if("get"in g||"set"in g)throw new a("Accessors not supported");return"value"in g&&(v[f]=g.value),v},Dt}var kt,rs;function yr(){if(rs)return kt;rs=1;var n=we(),e=Ye(),r=Fa();return kt=n?function(t,i,a){return e.f(t,i,r(1,a))}:function(t,i,a){return t[i]=a,t},kt}var jt={exports:{}},Bt,ts;function Vr(){if(ts)return Bt;ts=1;var n=we(),e=Ae(),r=Function.prototype,t=n&&Object.getOwnPropertyDescriptor,i=e(r,"name"),a=i&&(function(){}).name==="something",s=i&&(!n||n&&t(r,"name").configurable);return Bt={EXISTS:i,PROPER:a,CONFIGURABLE:s},Bt}var Ft,is;function Ha(){if(is)return Ft;is=1;var n=J(),e=re(),r=$a(),t=n(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(i){return t(i)}),Ft=r.inspectSource,Ft}var Ut,as;function Ql(){if(as)return Ut;as=1;var n=Q(),e=re(),r=n.WeakMap;return Ut=e(r)&&/native code/.test(String(r)),Ut}var Gt,ns;function Wa(){if(ns)return Gt;ns=1;var n=za(),e=ul(),r=n("keys");return Gt=function(t){return r[t]||(r[t]=e(t))},Gt}var $t,ss;function Ya(){return ss||(ss=1,$t={}),$t}var zt,os;function Lr(){if(os)return zt;os=1;var n=Ql(),e=Q(),r=pe(),t=yr(),i=Ae(),a=$a(),s=Wa(),o=Ya(),u="Object already initialized",l=e.TypeError,h=e.WeakMap,c,v,f,g=function(m){return f(m)?v(m):c(m,{})},d=function(m){return function(b){var x;if(!r(b)||(x=v(b)).type!==m)throw new l("Incompatible receiver, "+m+" required");return x}};if(n||a.state){var p=a.state||(a.state=new h);p.get=p.get,p.has=p.has,p.set=p.set,c=function(m,b){if(p.has(m))throw new l(u);return b.facade=m,p.set(m,b),b},v=function(m){return p.get(m)||{}},f=function(m){return p.has(m)}}else{var y=s("state");o[y]=!0,c=function(m,b){if(i(m,y))throw new l(u);return b.facade=m,t(m,y,b),b},v=function(m){return i(m,y)?m[y]:{}},f=function(m){return i(m,y)}}return zt={set:c,get:v,has:f,enforce:g,getterFor:d},zt}var us;function cl(){if(us)return jt.exports;us=1;var n=J(),e=Z(),r=re(),t=Ae(),i=we(),a=Vr().CONFIGURABLE,s=Ha(),o=Lr(),u=o.enforce,l=o.get,h=String,c=Object.defineProperty,v=n("".slice),f=n("".replace),g=n([].join),d=i&&!e(function(){return c(function(){},"length",{value:8}).length!==8}),p=String(String).split("String"),y=jt.exports=function(m,b,x){v(h(b),0,7)==="Symbol("&&(b="["+f(h(b),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),x&&x.getter&&(b="get "+b),x&&x.setter&&(b="set "+b),(!t(m,"name")||a&&m.name!==b)&&(i?c(m,"name",{value:b,configurable:!0}):m.name=b),d&&x&&t(x,"arity")&&m.length!==x.arity&&c(m,"length",{value:x.arity});try{x&&t(x,"constructor")&&x.constructor?i&&c(m,"prototype",{writable:!1}):m.prototype&&(m.prototype=void 0)}catch{}var S=u(m);return t(S,"source")||(S.source=g(p,typeof b=="string"?b:"")),m};return Function.prototype.toString=y(function(){return r(this)&&l(this).source||s(this)},"toString"),jt.exports}var Ht,ls;function tr(){if(ls)return Ht;ls=1;var n=re(),e=Ye(),r=cl(),t=Ga();return Ht=function(i,a,s,o){o||(o={});var u=o.enumerable,l=o.name!==void 0?o.name:a;if(n(s)&&r(s,l,o),o.global)u?i[a]=s:t(a,s);else{try{o.unsafe?i[a]&&(u=!0):delete i[a]}catch{}u?i[a]=s:e.f(i,a,{value:s,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return i},Ht}var Wt={},Yt,hs;function Zl(){if(hs)return Yt;hs=1;var n=Math.ceil,e=Math.floor;return Yt=Math.trunc||function(t){var i=+t;return(i>0?e:n)(i)},Yt}var Xt,fs;function kr(){if(fs)return Xt;fs=1;var n=Zl();return Xt=function(e){var r=+e;return r!==r||r===0?0:n(r)},Xt}var Kt,cs;function Jl(){if(cs)return Kt;cs=1;var n=kr(),e=Math.max,r=Math.min;return Kt=function(t,i){var a=n(t);return a<0?e(a+i,0):r(a,i)},Kt}var Qt,vs;function sr(){if(vs)return Qt;vs=1;var n=kr(),e=Math.min;return Qt=function(r){var t=n(r);return t>0?e(t,9007199254740991):0},Qt}var Zt,gs;function Xa(){if(gs)return Zt;gs=1;var n=sr();return Zt=function(e){return n(e.length)},Zt}var Jt,ds;function vl(){if(ds)return Jt;ds=1;var n=dr(),e=Jl(),r=Xa(),t=function(i){return function(a,s,o){var u=n(a),l=r(u);if(l===0)return!i&&-1;var h=e(o,l),c;if(i&&s!==s){for(;l>h;)if(c=u[h++],c!==c)return!0}else for(;l>h;h++)if((i||h in u)&&u[h]===s)return i||h||0;return!i&&-1}};return Jt={includes:t(!0),indexOf:t(!1)},Jt}var ei,ps;function gl(){if(ps)return ei;ps=1;var n=J(),e=Ae(),r=dr(),t=vl().indexOf,i=Ya(),a=n([].push);return ei=function(s,o){var u=r(s),l=0,h=[],c;for(c in u)!e(i,c)&&e(u,c)&&a(h,c);for(;o.length>l;)e(u,c=o[l++])&&(~t(h,c)||a(h,c));return h},ei}var ri,ys;function Ka(){return ys||(ys=1,ri=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ri}var ms;function eh(){if(ms)return Wt;ms=1;var n=gl(),e=Ka(),r=e.concat("length","prototype");return Wt.f=Object.getOwnPropertyNames||function(i){return n(i,r)},Wt}var ti={},bs;function rh(){return bs||(bs=1,ti.f=Object.getOwnPropertySymbols),ti}var ii,xs;function th(){if(xs)return ii;xs=1;var n=rr(),e=J(),r=eh(),t=rh(),i=le(),a=e([].concat);return ii=n("Reflect","ownKeys")||function(o){var u=r.f(i(o)),l=t.f;return l?a(u,l(o)):u},ii}var ai,Os;function ih(){if(Os)return ai;Os=1;var n=Ae(),e=th(),r=Dr(),t=Ye();return ai=function(i,a,s){for(var o=e(a),u=t.f,l=r.f,h=0;h<o.length;h++){var c=o[h];!n(i,c)&&!(s&&n(s,c))&&u(i,c,l(a,c))}},ai}var ni,Ts;function dl(){if(Ts)return ni;Ts=1;var n=Z(),e=re(),r=/#|\.prototype\./,t=function(u,l){var h=a[i(u)];return h===o?!0:h===s?!1:e(l)?n(l):!!l},i=t.normalize=function(u){return String(u).replace(r,".").toLowerCase()},a=t.data={},s=t.NATIVE="N",o=t.POLYFILL="P";return ni=t,ni}var si,Ss;function he(){if(Ss)return si;Ss=1;var n=Q(),e=Dr().f,r=yr(),t=tr(),i=Ga(),a=ih(),s=dl();return si=function(o,u){var l=o.target,h=o.global,c=o.stat,v,f,g,d,p,y;if(h?f=n:c?f=n[l]||i(l,{}):f=n[l]&&n[l].prototype,f)for(g in u){if(p=u[g],o.dontCallGetSet?(y=e(f,g),d=y&&y.value):d=f[g],v=s(h?g:l+(c?".":"#")+g,o.forced),!v&&d!==void 0){if(typeof p==typeof d)continue;a(p,d)}(o.sham||d&&d.sham)&&r(p,"sham",!0),t(f,g,p,o)}},si}var oi,Es;function pl(){if(Es)return oi;Es=1;var n=Q(),e=pr(),r=er(),t=function(i){return e.slice(0,i.length)===i};return oi=(function(){return t("Bun/")?"BUN":t("Cloudflare-Workers")?"CLOUDFLARE":t("Deno/")?"DENO":t("Node.js/")?"NODE":n.Bun&&typeof Bun.version=="string"?"BUN":n.Deno&&typeof Deno.version=="object"?"DENO":r(n.process)==="process"?"NODE":n.window&&n.document?"BROWSER":"REST"})(),oi}var ui,Rs;function jr(){if(Rs)return ui;Rs=1;var n=pl();return ui=n==="NODE",ui}var li,Cs;function ah(){if(Cs)return li;Cs=1;var n=Q();return li=n,li}var hi,ws;function nh(){if(ws)return hi;ws=1;var n=J(),e=Fe();return hi=function(r,t,i){try{return n(e(Object.getOwnPropertyDescriptor(r,t)[i]))}catch{}},hi}var fi,Ps;function sh(){if(Ps)return fi;Ps=1;var n=pe();return fi=function(e){return n(e)||e===null},fi}var ci,As;function oh(){if(As)return ci;As=1;var n=sh(),e=String,r=TypeError;return ci=function(t){if(n(t))return t;throw new r("Can't set "+e(t)+" as a prototype")},ci}var vi,Is;function yl(){if(Is)return vi;Is=1;var n=nh(),e=pe(),r=Pe(),t=oh();return vi=Object.setPrototypeOf||("__proto__"in{}?(function(){var i=!1,a={},s;try{s=n(Object.prototype,"__proto__","set"),s(a,[]),i=a instanceof Array}catch{}return function(u,l){return r(u),t(l),e(u)&&(i?s(u,l):u.__proto__=l),u}})():void 0),vi}var gi,Ns;function Br(){if(Ns)return gi;Ns=1;var n=Ye().f,e=Ae(),r=ae(),t=r("toStringTag");return gi=function(i,a,s){i&&!s&&(i=i.prototype),i&&!e(i,t)&&n(i,t,{configurable:!0,value:a})},gi}var di,_s;function uh(){if(_s)return di;_s=1;var n=cl(),e=Ye();return di=function(r,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),e.f(r,t,i)},di}var pi,Ms;function lh(){if(Ms)return pi;Ms=1;var n=rr(),e=uh(),r=ae(),t=we(),i=r("species");return pi=function(a){var s=n(a);t&&s&&!s[i]&&e(s,i,{configurable:!0,get:function(){return this}})},pi}var yi,qs;function hh(){if(qs)return yi;qs=1;var n=Nr(),e=TypeError;return yi=function(r,t){if(n(t,r))return r;throw new e("Incorrect invocation")},yi}var mi,Ds;function fh(){if(Ds)return mi;Ds=1;var n=ae(),e=n("toStringTag"),r={};return r[e]="z",mi=String(r)==="[object z]",mi}var bi,Vs;function Qa(){if(Vs)return bi;Vs=1;var n=fh(),e=re(),r=er(),t=ae(),i=t("toStringTag"),a=Object,s=r((function(){return arguments})())==="Arguments",o=function(u,l){try{return u[l]}catch{}};return bi=n?r:function(u){var l,h,c;return u===void 0?"Undefined":u===null?"Null":typeof(h=o(l=a(u),i))=="string"?h:s?r(l):(c=r(l))==="Object"&&e(l.callee)?"Arguments":c},bi}var xi,Ls;function ch(){if(Ls)return xi;Ls=1;var n=J(),e=Z(),r=re(),t=Qa(),i=rr(),a=Ha(),s=function(){},o=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=n(u.exec),h=!u.test(s),c=function(g){if(!r(g))return!1;try{return o(s,[],g),!0}catch{return!1}},v=function(g){if(!r(g))return!1;switch(t(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(u,a(g))}catch{return!0}};return v.sham=!0,xi=!o||e(function(){var f;return c(c.call)||!c(Object)||!c(function(){f=!0})||f})?v:c,xi}var Oi,ks;function vh(){if(ks)return Oi;ks=1;var n=ch(),e=_r(),r=TypeError;return Oi=function(t){if(n(t))return t;throw new r(e(t)+" is not a constructor")},Oi}var Ti,js;function ml(){if(js)return Ti;js=1;var n=le(),e=vh(),r=Ir(),t=ae(),i=t("species");return Ti=function(a,s){var o=n(a).constructor,u;return o===void 0||r(u=n(o)[i])?s:e(u)},Ti}var Si,Bs;function bl(){if(Bs)return Si;Bs=1;var n=Ar(),e=Function.prototype,r=e.apply,t=e.call;return Si=typeof Reflect=="object"&&Reflect.apply||(n?t.bind(r):function(){return t.apply(r,arguments)}),Si}var Ei,Fs;function Fr(){if(Fs)return Ei;Fs=1;var n=er(),e=J();return Ei=function(r){if(n(r)==="Function")return e(r)},Ei}var Ri,Us;function Za(){if(Us)return Ri;Us=1;var n=Fr(),e=Fe(),r=Ar(),t=n(n.bind);return Ri=function(i,a){return e(i),a===void 0?i:r?t(i,a):function(){return i.apply(a,arguments)}},Ri}var Ci,Gs;function xl(){if(Gs)return Ci;Gs=1;var n=rr();return Ci=n("document","documentElement"),Ci}var wi,$s;function gh(){if($s)return wi;$s=1;var n=J();return wi=n([].slice),wi}var Pi,zs;function dh(){if(zs)return Pi;zs=1;var n=TypeError;return Pi=function(e,r){if(e<r)throw new n("Not enough arguments");return e},Pi}var Ai,Hs;function Ol(){if(Hs)return Ai;Hs=1;var n=pr();return Ai=/(?:ipad|iphone|ipod).*applewebkit/i.test(n),Ai}var Ii,Ws;function Tl(){if(Ws)return Ii;Ws=1;var n=Q(),e=bl(),r=Za(),t=re(),i=Ae(),a=Z(),s=xl(),o=gh(),u=qr(),l=dh(),h=Ol(),c=jr(),v=n.setImmediate,f=n.clearImmediate,g=n.process,d=n.Dispatch,p=n.Function,y=n.MessageChannel,m=n.String,b=0,x={},S="onreadystatechange",E,O,P,_;a(function(){E=n.location});var A=function(C){if(i(x,C)){var w=x[C];delete x[C],w()}},q=function(C){return function(){A(C)}},I=function(C){A(C.data)},j=function(C){n.postMessage(m(C),E.protocol+"//"+E.host)};return(!v||!f)&&(v=function(w){l(arguments.length,1);var U=t(w)?w:p(w),L=o(arguments,1);return x[++b]=function(){e(U,void 0,L)},O(b),b},f=function(w){delete x[w]},c?O=function(C){g.nextTick(q(C))}:d&&d.now?O=function(C){d.now(q(C))}:y&&!h?(P=new y,_=P.port2,P.port1.onmessage=I,O=r(_.postMessage,_)):n.addEventListener&&t(n.postMessage)&&!n.importScripts&&E&&E.protocol!=="file:"&&!a(j)?(O=j,n.addEventListener("message",I,!1)):S in u("script")?O=function(C){s.appendChild(u("script"))[S]=function(){s.removeChild(this),A(C)}}:O=function(C){setTimeout(q(C),0)}),Ii={set:v,clear:f},Ii}var Ni,Ys;function ph(){if(Ys)return Ni;Ys=1;var n=Q(),e=we(),r=Object.getOwnPropertyDescriptor;return Ni=function(t){if(!e)return n[t];var i=r(n,t);return i&&i.value},Ni}var _i,Xs;function Sl(){if(Xs)return _i;Xs=1;var n=function(){this.head=null,this.tail=null};return n.prototype={add:function(e){var r={item:e,next:null},t=this.tail;t?t.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},_i=n,_i}var Mi,Ks;function yh(){if(Ks)return Mi;Ks=1;var n=pr();return Mi=/ipad|iphone|ipod/i.test(n)&&typeof Pebble<"u",Mi}var qi,Qs;function mh(){if(Qs)return qi;Qs=1;var n=pr();return qi=/web0s(?!.*chrome)/i.test(n),qi}var Di,Zs;function bh(){if(Zs)return Di;Zs=1;var n=Q(),e=ph(),r=Za(),t=Tl().set,i=Sl(),a=Ol(),s=yh(),o=mh(),u=jr(),l=n.MutationObserver||n.WebKitMutationObserver,h=n.document,c=n.process,v=n.Promise,f=e("queueMicrotask"),g,d,p,y,m;if(!f){var b=new i,x=function(){var S,E;for(u&&(S=c.domain)&&S.exit();E=b.get();)try{E()}catch(O){throw b.head&&g(),O}S&&S.enter()};!a&&!u&&!o&&l&&h?(d=!0,p=h.createTextNode(""),new l(x).observe(p,{characterData:!0}),g=function(){p.data=d=!d}):!s&&v&&v.resolve?(y=v.resolve(void 0),y.constructor=v,m=r(y.then,y),g=function(){m(x)}):u?g=function(){c.nextTick(x)}:(t=r(t,n),g=function(){t(x)}),f=function(S){b.head||g(),b.add(S)}}return Di=f,Di}var Vi,Js;function xh(){return Js||(Js=1,Vi=function(n,e){try{arguments.length===1?console.error(n):console.error(n,e)}catch{}}),Vi}var Li,eo;function Ja(){return eo||(eo=1,Li=function(n){try{return{error:!1,value:n()}}catch(e){return{error:!0,value:e}}}),Li}var ki,ro;function mr(){if(ro)return ki;ro=1;var n=Q();return ki=n.Promise,ki}var ji,to;function br(){if(to)return ji;to=1;var n=Q(),e=mr(),r=re(),t=dl(),i=Ha(),a=ae(),s=pl(),o=Me(),u=Ua(),l=e&&e.prototype,h=a("species"),c=!1,v=r(n.PromiseRejectionEvent),f=t("Promise",function(){var g=i(e),d=g!==String(e);if(!d&&u===66||o&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(g)){var p=new e(function(b){b(1)}),y=function(b){b(function(){},function(){})},m=p.constructor={};if(m[h]=y,c=p.then(function(){})instanceof y,!c)return!0}return!d&&(s==="BROWSER"||s==="DENO")&&!v});return ji={CONSTRUCTOR:f,REJECTION_EVENT:v,SUBCLASSING:c},ji}var Bi={},io;function xr(){if(io)return Bi;io=1;var n=Fe(),e=TypeError,r=function(t){var i,a;this.promise=new t(function(s,o){if(i!==void 0||a!==void 0)throw new e("Bad Promise constructor");i=s,a=o}),this.resolve=n(i),this.reject=n(a)};return Bi.f=function(t){return new r(t)},Bi}var ao;function Oh(){if(ao)return cn;ao=1;var n=he(),e=Me(),r=jr(),t=Q(),i=ah(),a=ne(),s=tr(),o=yl(),u=Br(),l=lh(),h=Fe(),c=re(),v=pe(),f=hh(),g=ml(),d=Tl().set,p=bh(),y=xh(),m=Ja(),b=Sl(),x=Lr(),S=mr(),E=br(),O=xr(),P="Promise",_=E.CONSTRUCTOR,A=E.REJECTION_EVENT,q=E.SUBCLASSING,I=x.getterFor(P),j=x.set,C=S&&S.prototype,w=S,U=C,L=t.TypeError,V=t.document,M=t.process,N=O.f,k=N,z=!!(V&&V.createEvent&&t.dispatchEvent),H="unhandledrejection",X="rejectionhandled",se=0,be=1,oe=2,Ue=1,Ge=2,fe,Ne,_e,me,ce=function(R){var B;return v(R)&&c(B=R.then)?B:!1},xe=function(R,B){var G=B.value,$=B.state===be,W=$?R.ok:R.fail,Te=R.resolve,Le=R.reject,Se=R.domain,Ee,lr,hr;try{W?($||(B.rejection===Ge&&$e(B),B.rejection=Ue),W===!0?Ee=G:(Se&&Se.enter(),Ee=W(G),Se&&(Se.exit(),hr=!0)),Ee===R.promise?Le(new L("Promise-chain cycle")):(lr=ce(Ee))?a(lr,Ee,Te,Le):Te(Ee)):Le(G)}catch(fr){Se&&!hr&&Se.exit(),Le(fr)}},De=function(R,B){R.notified||(R.notified=!0,p(function(){for(var G=R.reactions,$;$=G.get();)xe($,R);R.notified=!1,B&&!R.rejection&&Xe(R)}))},Ve=function(R,B,G){var $,W;z?($=V.createEvent("Event"),$.promise=B,$.reason=G,$.initEvent(R,!1,!0),t.dispatchEvent($)):$={promise:B,reason:G},!A&&(W=t["on"+R])?W($):R===H&&y("Unhandled promise rejection",G)},Xe=function(R){a(d,t,function(){var B=R.facade,G=R.value,$=ur(R),W;if($&&(W=m(function(){r?M.emit("unhandledRejection",G,B):Ve(H,B,G)}),R.rejection=r||ur(R)?Ge:Ue,W.error))throw W.value})},ur=function(R){return R.rejection!==Ue&&!R.parent},$e=function(R){a(d,t,function(){var B=R.facade;r?M.emit("rejectionHandled",B):Ve(X,B,R.value)})},ve=function(R,B,G){return function($){R(B,$,G)}},ge=function(R,B,G){R.done||(R.done=!0,G&&(R=G),R.value=B,R.state=oe,De(R,!0))},Oe=function(R,B,G){if(!R.done){R.done=!0,G&&(R=G);try{if(R.facade===B)throw new L("Promise can't be resolved itself");var $=ce(B);$?p(function(){var W={done:!1};try{a($,B,ve(Oe,W,R),ve(ge,W,R))}catch(Te){ge(W,Te,R)}}):(R.value=B,R.state=be,De(R,!1))}catch(W){ge({done:!1},W,R)}}};if(_&&(w=function(B){f(this,U),h(B),a(fe,this);var G=I(this);try{B(ve(Oe,G),ve(ge,G))}catch($){ge(G,$)}},U=w.prototype,fe=function(B){j(this,{type:P,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:se,value:null})},fe.prototype=s(U,"then",function(B,G){var $=I(this),W=N(g(this,w));return $.parent=!0,W.ok=c(B)?B:!0,W.fail=c(G)&&G,W.domain=r?M.domain:void 0,$.state===se?$.reactions.add(W):p(function(){xe(W,$)}),W.promise}),Ne=function(){var R=new fe,B=I(R);this.promise=R,this.resolve=ve(Oe,B),this.reject=ve(ge,B)},O.f=N=function(R){return R===w||R===_e?new Ne(R):k(R)},!e&&c(S)&&C!==Object.prototype)){me=C.then,q||s(C,"then",function(B,G){var $=this;return new w(function(W,Te){a(me,$,W,Te)}).then(B,G)},{unsafe:!0});try{delete C.constructor}catch{}o&&o(C,U)}return n({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:w}),_e=i.Promise,u(w,P,!1,!0),l(P),cn}var no={},Fi,so;function Or(){return so||(so=1,Fi={}),Fi}var Ui,oo;function Th(){if(oo)return Ui;oo=1;var n=ae(),e=Or(),r=n("iterator"),t=Array.prototype;return Ui=function(i){return i!==void 0&&(e.Array===i||t[r]===i)},Ui}var Gi,uo;function El(){if(uo)return Gi;uo=1;var n=Qa(),e=nr(),r=Ir(),t=Or(),i=ae(),a=i("iterator");return Gi=function(s){if(!r(s))return e(s,a)||e(s,"@@iterator")||t[n(s)]},Gi}var $i,lo;function Sh(){if(lo)return $i;lo=1;var n=ne(),e=Fe(),r=le(),t=_r(),i=El(),a=TypeError;return $i=function(s,o){var u=arguments.length<2?i(s):o;if(e(u))return r(n(u,s));throw new a(t(s)+" is not iterable")},$i}var zi,ho;function Eh(){if(ho)return zi;ho=1;var n=ne(),e=le(),r=nr();return zi=function(t,i,a){var s,o;e(t);try{if(s=r(t,"return"),!s){if(i==="throw")throw a;return a}s=n(s,t)}catch(u){o=!0,s=u}if(i==="throw")throw a;if(o)throw s;return e(s),a},zi}var Hi,fo;function Rl(){if(fo)return Hi;fo=1;var n=Za(),e=ne(),r=le(),t=_r(),i=Th(),a=Xa(),s=Nr(),o=Sh(),u=El(),l=Eh(),h=TypeError,c=function(f,g){this.stopped=f,this.result=g},v=c.prototype;return Hi=function(f,g,d){var p=d&&d.that,y=!!(d&&d.AS_ENTRIES),m=!!(d&&d.IS_RECORD),b=!!(d&&d.IS_ITERATOR),x=!!(d&&d.INTERRUPTED),S=n(g,p),E,O,P,_,A,q,I,j=function(w){return E&&l(E,"normal"),new c(!0,w)},C=function(w){return y?(r(w),x?S(w[0],w[1],j):S(w[0],w[1])):x?S(w,j):S(w)};if(m)E=f.iterator;else if(b)E=f;else{if(O=u(f),!O)throw new h(t(f)+" is not iterable");if(i(O)){for(P=0,_=a(f);_>P;P++)if(A=C(f[P]),A&&s(v,A))return A;return new c(!1)}E=o(f,O)}for(q=m?f.next:E.next;!(I=e(q,E)).done;){try{A=C(I.value)}catch(w){l(E,"throw",w)}if(typeof A=="object"&&A&&s(v,A))return A}return new c(!1)},Hi}var Wi,co;function Rh(){if(co)return Wi;co=1;var n=ae(),e=n("iterator"),r=!1;try{var t=0,i={next:function(){return{done:!!t++}},return:function(){r=!0}};i[e]=function(){return this},Array.from(i,function(){throw 2})}catch{}return Wi=function(a,s){try{if(!s&&!r)return!1}catch{return!1}var o=!1;try{var u={};u[e]=function(){return{next:function(){return{done:o=!0}}}},a(u)}catch{}return o},Wi}var Yi,vo;function Cl(){if(vo)return Yi;vo=1;var n=mr(),e=Rh(),r=br().CONSTRUCTOR;return Yi=r||!e(function(t){n.all(t).then(void 0,function(){})}),Yi}var go;function Ch(){if(go)return no;go=1;var n=he(),e=ne(),r=Fe(),t=xr(),i=Ja(),a=Rl(),s=Cl();return n({target:"Promise",stat:!0,forced:s},{all:function(u){var l=this,h=t.f(l),c=h.resolve,v=h.reject,f=i(function(){var g=r(l.resolve),d=[],p=0,y=1;a(u,function(m){var b=p++,x=!1;y++,e(g,l,m).then(function(S){x||(x=!0,d[b]=S,--y||c(d))},v)}),--y||c(d)});return f.error&&v(f.value),h.promise}}),no}var po={},yo;function wh(){if(yo)return po;yo=1;var n=he(),e=Me(),r=br().CONSTRUCTOR,t=mr(),i=rr(),a=re(),s=tr(),o=t&&t.prototype;if(n({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&a(t)){var u=i("Promise").prototype.catch;o.catch!==u&&s(o,"catch",u,{unsafe:!0})}return po}var mo={},bo;function Ph(){if(bo)return mo;bo=1;var n=he(),e=ne(),r=Fe(),t=xr(),i=Ja(),a=Rl(),s=Cl();return n({target:"Promise",stat:!0,forced:s},{race:function(u){var l=this,h=t.f(l),c=h.reject,v=i(function(){var f=r(l.resolve);a(u,function(g){e(f,l,g).then(h.resolve,c)})});return v.error&&c(v.value),h.promise}}),mo}var xo={},Oo;function Ah(){if(Oo)return xo;Oo=1;var n=he(),e=xr(),r=br().CONSTRUCTOR;return n({target:"Promise",stat:!0,forced:r},{reject:function(i){var a=e.f(this),s=a.reject;return s(i),a.promise}}),xo}var To={},Xi,So;function Ih(){if(So)return Xi;So=1;var n=le(),e=pe(),r=xr();return Xi=function(t,i){if(n(t),e(i)&&i.constructor===t)return i;var a=r.f(t),s=a.resolve;return s(i),a.promise},Xi}var Eo;function Nh(){if(Eo)return To;Eo=1;var n=he(),e=rr(),r=Me(),t=mr(),i=br().CONSTRUCTOR,a=Ih(),s=e("Promise"),o=r&&!i;return n({target:"Promise",stat:!0,forced:r||i},{resolve:function(l){return a(o&&this===s?t:this,l)}}),To}var Ro;function _h(){return Ro||(Ro=1,Oh(),Ch(),wh(),Ph(),Ah(),Nh()),fn}_h();function Co(n,e,r,t,i,a,s){try{var o=n[a](s),u=o.value}catch(l){return void r(l)}o.done?e(u):Promise.resolve(u).then(t,i)}function Be(n){return function(){var e=this,r=arguments;return new Promise(function(t,i){var a=n.apply(e,r);function s(u){Co(a,t,i,s,o,"next",u)}function o(u){Co(a,t,i,s,o,"throw",u)}s(void 0)})}}var wo={},Po={},Ki,Ao;function qe(){if(Ao)return Ki;Ao=1;var n=Qa(),e=String;return Ki=function(r){if(n(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ki}var Qi,Io;function wl(){if(Io)return Qi;Io=1;var n=le();return Qi=function(){var e=n(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},Qi}var Zi,No;function Pl(){if(No)return Zi;No=1;var n=Z(),e=Q(),r=e.RegExp,t=n(function(){var s=r("a","y");return s.lastIndex=2,s.exec("abcd")!==null}),i=t||n(function(){return!r("a","y").sticky}),a=t||n(function(){var s=r("^r","gy");return s.lastIndex=2,s.exec("str")!==null});return Zi={BROKEN_CARET:a,MISSED_STICKY:i,UNSUPPORTED_Y:t},Zi}var Ji={},ea,_o;function Mh(){if(_o)return ea;_o=1;var n=gl(),e=Ka();return ea=Object.keys||function(t){return n(t,e)},ea}var Mo;function qh(){if(Mo)return Ji;Mo=1;var n=we(),e=fl(),r=Ye(),t=le(),i=dr(),a=Mh();return Ji.f=n&&!e?Object.defineProperties:function(o,u){t(o);for(var l=i(u),h=a(u),c=h.length,v=0,f;c>v;)r.f(o,f=h[v++],l[f]);return o},Ji}var ra,qo;function Ur(){if(qo)return ra;qo=1;var n=le(),e=qh(),r=Ka(),t=Ya(),i=xl(),a=qr(),s=Wa(),o=">",u="<",l="prototype",h="script",c=s("IE_PROTO"),v=function(){},f=function(m){return u+h+o+m+u+"/"+h+o},g=function(m){m.write(f("")),m.close();var b=m.parentWindow.Object;return m=null,b},d=function(){var m=a("iframe"),b="java"+h+":",x;return m.style.display="none",i.appendChild(m),m.src=String(b),x=m.contentWindow.document,x.open(),x.write(f("document.F=Object")),x.close(),x.F},p,y=function(){try{p=new ActiveXObject("htmlfile")}catch{}y=typeof document<"u"?document.domain&&p?g(p):d():g(p);for(var m=r.length;m--;)delete y[l][r[m]];return y()};return t[c]=!0,ra=Object.create||function(b,x){var S;return b!==null?(v[l]=n(b),S=new v,v[l]=null,S[c]=b):S=y(),x===void 0?S:e.f(S,x)},ra}var ta,Do;function Dh(){if(Do)return ta;Do=1;var n=Z(),e=Q(),r=e.RegExp;return ta=n(function(){var t=r(".","s");return!(t.dotAll&&t.test(`
2
2
  `)&&t.flags==="s")}),ta}var ia,Vo;function Vh(){if(Vo)return ia;Vo=1;var n=Z(),e=Q(),r=e.RegExp;return ia=n(function(){var t=r("(?<a>b)","g");return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"}),ia}var aa,Lo;function en(){if(Lo)return aa;Lo=1;var n=ne(),e=J(),r=qe(),t=wl(),i=Pl(),a=za(),s=Ur(),o=Lr().get,u=Dh(),l=Vh(),h=a("native-string-replace",String.prototype.replace),c=RegExp.prototype.exec,v=c,f=e("".charAt),g=e("".indexOf),d=e("".replace),p=e("".slice),y=(function(){var S=/a/,E=/b*/g;return n(c,S,"a"),n(c,E,"a"),S.lastIndex!==0||E.lastIndex!==0})(),m=i.BROKEN_CARET,b=/()??/.exec("")[1]!==void 0,x=y||b||m||u||l;return x&&(v=function(E){var O=this,P=o(O),_=r(E),A=P.raw,q,I,j,C,w,U,L;if(A)return A.lastIndex=O.lastIndex,q=n(v,A,_),O.lastIndex=A.lastIndex,q;var V=P.groups,M=m&&O.sticky,N=n(t,O),k=O.source,z=0,H=_;if(M&&(N=d(N,"y",""),g(N,"g")===-1&&(N+="g"),H=p(_,O.lastIndex),O.lastIndex>0&&(!O.multiline||O.multiline&&f(_,O.lastIndex-1)!==`
3
3
  `)&&(k="(?: "+k+")",H=" "+H,z++),I=new RegExp("^(?:"+k+")",N)),b&&(I=new RegExp("^"+k+"$(?!\\s)",N)),y&&(j=O.lastIndex),C=n(c,M?I:O,H),M?C?(C.input=p(C.input,z),C[0]=p(C[0],z),C.index=O.lastIndex,O.lastIndex+=C[0].length):O.lastIndex=0:y&&C&&(O.lastIndex=O.global?C.index+C[0].length:j),b&&C&&C.length>1&&n(h,C[0],I,function(){for(w=1;w<arguments.length-2;w++)arguments[w]===void 0&&(C[w]=void 0)}),C&&V)for(C.groups=U=s(null),w=0;w<V.length;w++)L=V[w],U[L[0]]=C[L[1]];return C}),aa=v,aa}var ko;function Lh(){if(ko)return Po;ko=1;var n=he(),e=en();return n({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),Po}var na,jo;function rn(){if(jo)return na;jo=1,Lh();var n=ne(),e=tr(),r=en(),t=Z(),i=ae(),a=yr(),s=i("species"),o=RegExp.prototype;return na=function(u,l,h,c){var v=i(u),f=!t(function(){var y={};return y[v]=function(){return 7},""[u](y)!==7}),g=f&&!t(function(){var y=!1,m=/a/;if(u==="split"){var b={};b[s]=function(){return m},m={constructor:b,flags:""},m[v]=/./[v]}return m.exec=function(){return y=!0,null},m[v](""),!y});if(!f||!g||h){var d=/./[v],p=l(v,""[u],function(y,m,b,x,S){var E=m.exec;return E===r||E===o.exec?f&&!S?{done:!0,value:n(d,m,b,x)}:{done:!0,value:n(y,b,m,x)}:{done:!1}});e(String.prototype,u,p[0]),e(o,v,p[1])}c&&a(o[v],"sham",!0)},na}var sa,Bo;function kh(){if(Bo)return sa;Bo=1;var n=J(),e=kr(),r=qe(),t=Pe(),i=n("".charAt),a=n("".charCodeAt),s=n("".slice),o=function(u){return function(l,h){var c=r(t(l)),v=e(h),f=c.length,g,d;return v<0||v>=f?u?"":void 0:(g=a(c,v),g<55296||g>56319||v+1===f||(d=a(c,v+1))<56320||d>57343?u?i(c,v):g:u?s(c,v,v+2):(g-55296<<10)+(d-56320)+65536)}};return sa={codeAt:o(!1),charAt:o(!0)},sa}var oa,Fo;function tn(){if(Fo)return oa;Fo=1;var n=kh().charAt;return oa=function(e,r,t){return r+(t?n(e,r).length:1)},oa}var ua,Uo;function jh(){if(Uo)return ua;Uo=1;var n=Q(),e=Z(),r=n.RegExp,t=!e(function(){var i=!0;try{r(".","d")}catch{i=!1}var a={},s="",o=i?"dgimsy":"gimsy",u=function(v,f){Object.defineProperty(a,v,{get:function(){return s+=f,!0}})},l={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(l.hasIndices="d");for(var h in l)u(h,l[h]);var c=Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(a);return c!==o||s!==o});return ua={correct:t},ua}var la,Go;function an(){if(Go)return la;Go=1;var n=ne(),e=Ae(),r=Nr(),t=jh(),i=wl(),a=RegExp.prototype;return la=t.correct?function(s){return s.flags}:function(s){return!t.correct&&r(a,s)&&!e(s,"flags")?n(i,s):s.flags},la}var ha,$o;function nn(){if($o)return ha;$o=1;var n=ne(),e=le(),r=re(),t=er(),i=en(),a=TypeError;return ha=function(s,o){var u=s.exec;if(r(u)){var l=n(u,s,o);return l!==null&&e(l),l}if(t(s)==="RegExp")return n(i,s,o);throw new a("RegExp#exec called on incompatible receiver")},ha}var zo;function Bh(){if(zo)return wo;zo=1;var n=ne(),e=J(),r=rn(),t=le(),i=pe(),a=sr(),s=qe(),o=Pe(),u=nr(),l=tn(),h=an(),c=nn(),v=e("".indexOf);return r("match",function(f,g,d){return[function(y){var m=o(this),b=i(y)?u(y,f):void 0;return b?n(b,y,m):new RegExp(y)[f](s(m))},function(p){var y=t(this),m=s(p),b=d(g,y,m);if(b.done)return b.value;var x=s(h(y));if(v(x,"g")===-1)return c(y,m);var S=v(x,"u")!==-1;y.lastIndex=0;for(var E=[],O=0,P;(P=c(y,m))!==null;){var _=s(P[0]);E[O]=_,_===""&&(y.lastIndex=l(m,a(y.lastIndex),S)),O++}return O===0?null:E}]}),wo}Bh();var Ho={},fa,Wo;function Fh(){if(Wo)return fa;Wo=1;var n=J(),e=Mr(),r=Math.floor,t=n("".charAt),i=n("".replace),a=n("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,o=/\$([$&'`]|\d{1,2})/g;return fa=function(u,l,h,c,v,f){var g=h+u.length,d=c.length,p=o;return v!==void 0&&(v=e(v),p=s),i(f,p,function(y,m){var b;switch(t(m,0)){case"$":return"$";case"&":return u;case"`":return a(l,0,h);case"'":return a(l,g);case"<":b=v[a(m,1,-1)];break;default:var x=+m;if(x===0)return y;if(x>d){var S=r(x/10);return S===0?y:S<=d?c[S-1]===void 0?t(m,1):c[S-1]+t(m,1):y}b=c[x-1]}return b===void 0?"":b})},fa}var Yo;function Uh(){if(Yo)return Ho;Yo=1;var n=bl(),e=ne(),r=J(),t=rn(),i=Z(),a=le(),s=re(),o=pe(),u=kr(),l=sr(),h=qe(),c=Pe(),v=tn(),f=nr(),g=Fh(),d=an(),p=nn(),y=ae(),m=y("replace"),b=Math.max,x=Math.min,S=r([].concat),E=r([].push),O=r("".indexOf),P=r("".slice),_=function(j){return j===void 0?j:String(j)},A=(function(){return"a".replace(/./,"$0")==="$0"})(),q=(function(){return/./[m]?/./[m]("a","$0")==="":!1})(),I=!i(function(){var j=/./;return j.exec=function(){var C=[];return C.groups={a:"7"},C},"".replace(j,"$<a>")!=="7"});return t("replace",function(j,C,w){var U=q?"$":"$0";return[function(V,M){var N=c(this),k=o(V)?f(V,m):void 0;return k?e(k,V,N,M):e(C,h(N),V,M)},function(L,V){var M=a(this),N=h(L);if(typeof V=="string"&&O(V,U)===-1&&O(V,"$<")===-1){var k=w(C,M,N,V);if(k.done)return k.value}var z=s(V);z||(V=h(V));var H=h(d(M)),X=O(H,"g")!==-1,se;X&&(se=O(H,"u")!==-1,M.lastIndex=0);for(var be=[],oe;oe=p(M,N),!(oe===null||(E(be,oe),!X));){var Ue=h(oe[0]);Ue===""&&(M.lastIndex=v(N,l(M.lastIndex),se))}for(var Ge="",fe=0,Ne=0;Ne<be.length;Ne++){oe=be[Ne];for(var _e=h(oe[0]),me=b(x(u(oe.index),N.length),0),ce=[],xe,De=1;De<oe.length;De++)E(ce,_(oe[De]));var Ve=oe.groups;if(z){var Xe=S([_e],ce,me,N);Ve!==void 0&&E(Xe,Ve),xe=h(n(V,void 0,Xe))}else xe=g(_e,N,me,ce,Ve,V);me>=fe&&(Ge+=P(N,fe,me)+xe,fe=me+_e.length)}return Ge+P(N,fe)}]},!I||!A||q),Ho}Uh();var Xo={},ca,Ko;function Gh(){if(Ko)return ca;Ko=1;var n=pe(),e=er(),r=ae(),t=r("match");return ca=function(i){var a;return n(i)&&((a=i[t])!==void 0?!!a:e(i)==="RegExp")},ca}var va,Qo;function sn(){if(Qo)return va;Qo=1;var n=Gh(),e=TypeError;return va=function(r){if(n(r))throw new e("The method doesn't accept regular expressions");return r},va}var ga,Zo;function on(){if(Zo)return ga;Zo=1;var n=ae(),e=n("match");return ga=function(r){var t=/./;try{"/./"[r](t)}catch{try{return t[e]=!1,"/./"[r](t)}catch{}}return!1},ga}var Jo;function $h(){if(Jo)return Xo;Jo=1;var n=he(),e=Fr(),r=Dr().f,t=sr(),i=qe(),a=sn(),s=Pe(),o=on(),u=Me(),l=e("".slice),h=Math.min,c=o("startsWith"),v=!u&&!c&&!!(function(){var f=r(String.prototype,"startsWith");return f&&!f.writable})();return n({target:"String",proto:!0,forced:!v&&!c},{startsWith:function(g){var d=i(s(this));a(g);var p=t(h(arguments.length>1?arguments[1]:void 0,d.length)),y=i(g);return l(d,p,p+y.length)===y}}),Xo}$h();var da,eu;function zh(){if(eu)return da;eu=1;var n=ae(),e=Ur(),r=Ye().f,t=n("unscopables"),i=Array.prototype;return i[t]===void 0&&r(i,t,{configurable:!0,value:e(null)}),da=function(a){i[t][a]=!0},da}var pa,ru;function Hh(){if(ru)return pa;ru=1;var n=Z();return pa=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),pa}var ya,tu;function Al(){if(tu)return ya;tu=1;var n=Ae(),e=re(),r=Mr(),t=Wa(),i=Hh(),a=t("IE_PROTO"),s=Object,o=s.prototype;return ya=i?s.getPrototypeOf:function(u){var l=r(u);if(n(l,a))return l[a];var h=l.constructor;return e(h)&&l instanceof h?h.prototype:l instanceof s?o:null},ya}var ma,iu;function Il(){if(iu)return ma;iu=1;var n=Z(),e=re(),r=pe(),t=Ur(),i=Al(),a=tr(),s=ae(),o=Me(),u=s("iterator"),l=!1,h,c,v;[].keys&&(v=[].keys(),"next"in v?(c=i(i(v)),c!==Object.prototype&&(h=c)):l=!0);var f=!r(h)||n(function(){var g={};return h[u].call(g)!==g});return f?h={}:o&&(h=t(h)),e(h[u])||a(h,u,function(){return this}),ma={IteratorPrototype:h,BUGGY_SAFARI_ITERATORS:l},ma}var ba,au;function Wh(){if(au)return ba;au=1;var n=Il().IteratorPrototype,e=Ur(),r=Fa(),t=Br(),i=Or(),a=function(){return this};return ba=function(s,o,u,l){var h=o+" Iterator";return s.prototype=e(n,{next:r(+!l,u)}),t(s,h,!1,!0),i[h]=a,s},ba}var xa,nu;function Yh(){if(nu)return xa;nu=1;var n=he(),e=ne(),r=Me(),t=Vr(),i=re(),a=Wh(),s=Al(),o=yl(),u=Br(),l=yr(),h=tr(),c=ae(),v=Or(),f=Il(),g=t.PROPER,d=t.CONFIGURABLE,p=f.IteratorPrototype,y=f.BUGGY_SAFARI_ITERATORS,m=c("iterator"),b="keys",x="values",S="entries",E=function(){return this};return xa=function(O,P,_,A,q,I,j){a(_,P,A);var C=function(X){if(X===q&&M)return M;if(!y&&X&&X in L)return L[X];switch(X){case b:return function(){return new _(this,X)};case x:return function(){return new _(this,X)};case S:return function(){return new _(this,X)}}return function(){return new _(this)}},w=P+" Iterator",U=!1,L=O.prototype,V=L[m]||L["@@iterator"]||q&&L[q],M=!y&&V||C(q),N=P==="Array"&&L.entries||V,k,z,H;if(N&&(k=s(N.call(new O)),k!==Object.prototype&&k.next&&(!r&&s(k)!==p&&(o?o(k,p):i(k[m])||h(k,m,E)),u(k,w,!0,!0),r&&(v[w]=E))),g&&q===x&&V&&V.name!==x&&(!r&&d?l(L,"name",x):(U=!0,M=function(){return e(V,this)})),q)if(z={values:C(x),keys:I?M:C(b),entries:C(S)},j)for(H in z)(y||U||!(H in L))&&h(L,H,z[H]);else n({target:P,proto:!0,forced:y||U},z);return(!r||j)&&L[m]!==M&&h(L,m,M,{name:q}),v[P]=M,z},xa}var Oa,su;function Xh(){return su||(su=1,Oa=function(n,e){return{value:n,done:e}}),Oa}var Ta,ou;function Nl(){if(ou)return Ta;ou=1;var n=dr(),e=zh(),r=Or(),t=Lr(),i=Ye().f,a=Yh(),s=Xh(),o=Me(),u=we(),l="Array Iterator",h=t.set,c=t.getterFor(l);Ta=a(Array,"Array",function(f,g){h(this,{type:l,target:n(f),index:0,kind:g})},function(){var f=c(this),g=f.target,d=f.index++;if(!g||d>=g.length)return f.target=null,s(void 0,!0);switch(f.kind){case"keys":return s(d,!1);case"values":return s(g[d],!1)}return s([d,g[d]],!1)},"values");var v=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!o&&u&&v.name!=="values")try{i(v,"name",{value:"values"})}catch{}return Ta}Nl();var uu={},Sa,lu;function Kh(){return lu||(lu=1,Sa={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),Sa}var Ea,hu;function Qh(){if(hu)return Ea;hu=1;var n=qr(),e=n("span").classList,r=e&&e.constructor&&e.constructor.prototype;return Ea=r===Object.prototype?void 0:r,Ea}var fu;function Zh(){if(fu)return uu;fu=1;var n=Q(),e=Kh(),r=Qh(),t=Nl(),i=yr(),a=Br(),s=ae(),o=s("iterator"),u=t.values,l=function(c,v){if(c){if(c[o]!==u)try{i(c,o,u)}catch{c[o]=u}if(a(c,v,!0),e[v]){for(var f in t)if(c[f]!==t[f])try{i(c,f,t[f])}catch{c[f]=t[f]}}}};for(var h in e)l(n[h]&&n[h].prototype,h);return l(r,"DOMTokenList"),uu}Zh();function Jh(n,e){if(Va(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var t=r.call(n,e);if(Va(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ef(n){var e=Jh(n,"string");return Va(e)=="symbol"?e:e+""}function un(n,e,r){return(e=ef(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}var cu={},Ra,vu;function rf(){if(vu)return Ra;vu=1;var n=Fe(),e=Mr(),r=al(),t=Xa(),i=TypeError,a="Reduce of empty array with no initial value",s=function(o){return function(u,l,h,c){var v=e(u),f=r(v),g=t(v);if(n(l),g===0&&h<2)throw new i(a);var d=o?g-1:0,p=o?-1:1;if(h<2)for(;;){if(d in f){c=f[d],d+=p;break}if(d+=p,o?d<0:g<=d)throw new i(a)}for(;o?d>=0:g>d;d+=p)d in f&&(c=l(c,f[d],d,v));return c}};return Ra={left:s(!1),right:s(!0)},Ra}var Ca,gu;function _l(){if(gu)return Ca;gu=1;var n=Z();return Ca=function(e,r){var t=[][e];return!!t&&n(function(){t.call(null,r||function(){return 1},1)})},Ca}var du;function tf(){if(du)return cu;du=1;var n=he(),e=rf().left,r=_l(),t=Ua(),i=jr(),a=!i&&t>79&&t<83,s=a||!r("reduce");return n({target:"Array",proto:!0,forced:s},{reduce:function(u){var l=arguments.length;return e(this,u,l,l>1?arguments[1]:void 0)}}),cu}tf();var pu={},yu;function af(){if(yu)return pu;yu=1;var n=he(),e=Fr(),r=Dr().f,t=sr(),i=qe(),a=sn(),s=Pe(),o=on(),u=Me(),l=e("".slice),h=Math.min,c=o("endsWith"),v=!u&&!c&&!!(function(){var f=r(String.prototype,"endsWith");return f&&!f.writable})();return n({target:"String",proto:!0,forced:!v&&!c},{endsWith:function(g){var d=i(s(this));a(g);var p=arguments.length>1?arguments[1]:void 0,y=d.length,m=p===void 0?y:h(t(p),y),b=i(g);return l(d,m-b.length,m)===b}}),pu}af();var mu={},bu;function nf(){if(bu)return mu;bu=1;var n=ne(),e=J(),r=rn(),t=le(),i=pe(),a=Pe(),s=ml(),o=tn(),u=sr(),l=qe(),h=nr(),c=nn(),v=Pl(),f=Z(),g=v.UNSUPPORTED_Y,d=4294967295,p=Math.min,y=e([].push),m=e("".slice),b=!f(function(){var S=/(?:)/,E=S.exec;S.exec=function(){return E.apply(this,arguments)};var O="ab".split(S);return O.length!==2||O[0]!=="a"||O[1]!=="b"}),x="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;return r("split",function(S,E,O){var P="0".split(void 0,0).length?function(_,A){return _===void 0&&A===0?[]:n(E,this,_,A)}:E;return[function(A,q){var I=a(this),j=i(A)?h(A,S):void 0;return j?n(j,A,I,q):n(P,l(I),A,q)},function(_,A){var q=t(this),I=l(_);if(!x){var j=O(P,q,I,A,P!==E);if(j.done)return j.value}var C=s(q,RegExp),w=q.unicode,U=(q.ignoreCase?"i":"")+(q.multiline?"m":"")+(q.unicode?"u":"")+(g?"g":"y"),L=new C(g?"^(?:"+q.source+")":q,U),V=A===void 0?d:A>>>0;if(V===0)return[];if(I.length===0)return c(L,I)===null?[I]:[];for(var M=0,N=0,k=[];N<I.length;){L.lastIndex=g?0:N;var z=c(L,g?m(I,N):I),H;if(z===null||(H=p(u(L.lastIndex+(g?N:0)),I.length))===M)N=o(I,N,w);else{if(y(k,m(I,M,N)),k.length===V)return k;for(var X=1;X<=z.length-1;X++)if(y(k,z[X]),k.length===V)return k;N=M=H}}return y(k,m(I,M)),k}]},x||!b,g),mu}nf();var vr={exports:{}},Ze={exports:{}},sf=Ze.exports,xu;function of(){return xu||(xu=1,(function(){var n,e,r,t,i,a;typeof performance<"u"&&performance!==null&&performance.now?Ze.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Ze.exports=function(){return(n()-i)/1e6},e=process.hrtime,n=function(){var s;return s=e(),s[0]*1e9+s[1]},t=n(),a=process.uptime()*1e9,i=t-a):Date.now?(Ze.exports=function(){return Date.now()-r},r=Date.now()):(Ze.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(sf)),Ze.exports}var Ou;function uf(){if(Ou)return vr.exports;Ou=1;for(var n=of(),e=typeof window>"u"?Da:window,r=["moz","webkit"],t="AnimationFrame",i=e["request"+t],a=e["cancel"+t]||e["cancelRequest"+t],s=0;!i&&s<r.length;s++)i=e[r[s]+"Request"+t],a=e[r[s]+"Cancel"+t]||e[r[s]+"CancelRequest"+t];if(!i||!a){var o=0,u=0,l=[],h=1e3/60;i=function(c){if(l.length===0){var v=n(),f=Math.max(0,h-(v-o));o=f+v,setTimeout(function(){var g=l.slice(0);l.length=0;for(var d=0;d<g.length;d++)if(!g[d].cancelled)try{g[d].callback(o)}catch(p){setTimeout(function(){throw p},0)}},Math.round(f))}return l.push({handle:++u,callback:c,cancelled:!1}),u},a=function(c){for(var v=0;v<l.length;v++)l[v].handle===c&&(l[v].cancelled=!0)}}return vr.exports=function(c){return i.call(e,c)},vr.exports.cancel=function(){a.apply(e,arguments)},vr.exports.polyfill=function(c){c||(c=e),c.requestAnimationFrame=i,c.cancelAnimationFrame=a},vr.exports}var lf=uf();const wa=il(lf);var Tu={},Pa,Su;function Ml(){return Su||(Su=1,Pa=`
4
4
  \v\f\r                 \u2028\u2029\uFEFF`),Pa}var Aa,Eu;function hf(){if(Eu)return Aa;Eu=1;var n=J(),e=Pe(),r=qe(),t=Ml(),i=n("".replace),a=RegExp("^["+t+"]+"),s=RegExp("(^|[^"+t+"])["+t+"]+$"),o=function(u){return function(l){var h=r(e(l));return u&1&&(h=i(h,a,"")),u&2&&(h=i(h,s,"$1")),h}};return Aa={start:o(1),end:o(2),trim:o(3)},Aa}var Ia,Ru;function ff(){if(Ru)return Ia;Ru=1;var n=Vr().PROPER,e=Z(),r=Ml(),t="​…᠎";return Ia=function(i){return e(function(){return!!r[i]()||t[i]()!==t||n&&r[i].name!==i})},Ia}var Cu;function cf(){if(Cu)return Tu;Cu=1;var n=he(),e=hf().trim,r=ff();return n({target:"String",proto:!0,forced:r("trim")},{trim:function(){return e(this)}}),Tu}cf();var Na,wu;function vf(){return wu||(wu=1,Na=function(n){this.ok=!1,this.alpha=1,n.charAt(0)=="#"&&(n=n.substr(1,6)),n=n.replace(/ /g,""),n=n.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};n=e[n]||n;for(var r=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3]),parseFloat(u[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],t=0;t<r.length;t++){var i=r[t].re,a=r[t].process,s=i.exec(n);if(s){var o=a(s);this.r=o[0],this.g=o[1],this.b=o[2],o.length>3&&(this.alpha=o[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),l=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),"#"+u+l+h},this.getHelpXML=function(){for(var u=new Array,l=0;l<r.length;l++)for(var h=r[l].example,c=0;c<h.length;c++)u[u.length]=h[c];for(var v in e)u[u.length]=v;var f=document.createElement("ul");f.setAttribute("id","rgbcolor-examples");for(var l=0;l<u.length;l++)try{var g=document.createElement("li"),d=new RGBColor(u[l]),p=document.createElement("div");p.style.cssText="margin: 3px; border: 1px solid black; background:"+d.toHex()+"; color:"+d.toHex(),p.appendChild(document.createTextNode("test"));var y=document.createTextNode(" "+u[l]+" -> "+d.toRGB()+" -> "+d.toHex());g.appendChild(p),g.appendChild(y),f.appendChild(g)}catch{}return f}}),Na}var gf=vf();const La=il(gf);var Pu={},Au;function df(){if(Au)return Pu;Au=1;var n=he(),e=Fr(),r=vl().indexOf,t=_l(),i=e([].indexOf),a=!!i&&1/i([1],1,-0)<0,s=a||!t("indexOf");return n({target:"Array",proto:!0,forced:s},{indexOf:function(u){var l=arguments.length>1?arguments[1]:void 0;return a?i(this,u,l)||0:r(this,u,l)}}),Pu}df();var Iu={},Nu;function pf(){if(Nu)return Iu;Nu=1;var n=he(),e=J(),r=sn(),t=Pe(),i=qe(),a=on(),s=e("".indexOf);return n({target:"String",proto:!0,forced:!a("includes")},{includes:function(u){return!!~s(i(t(this)),i(r(u)),arguments.length>1?arguments[1]:void 0)}}),Iu}pf();var _u={},_a,Mu;function yf(){if(Mu)return _a;Mu=1;var n=er();return _a=Array.isArray||function(r){return n(r)==="Array"},_a}var qu;function mf(){if(qu)return _u;qu=1;var n=he(),e=J(),r=yf(),t=e([].reverse),i=[1,2];return n({target:"Array",proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return r(this)&&(this.length=this.length),t(this)}}),_u}mf();/*! *****************************************************************************