From fe27ec2bebe7f570b7e520d5ae2998b66c29e910 Mon Sep 17 00:00:00 2001 From: Ashikagi Date: Mon, 23 Mar 2026 23:57:26 +0100 Subject: [PATCH] code spliting und language 2 --- .claude/settings.local.json | 5 +- .gitignore | 1 + Weitere Ideen.txt | 5 +- dist/assets/index-BaBfIFek.css | 1 - dist/assets/index-Cg2UxsRL.js | 86 ------------- dist/assets/index.es-DQ6YK4So.js | 18 --- dist/assets/jspdf.es.min-CLjTnO_I.js | 170 ------------------------- dist/index.html | 7 +- src/App.jsx | 97 ++++++++------ src/components/Analysis/RadarChart.jsx | 8 +- src/components/Analysis/TrendChart.jsx | 9 +- src/components/PatDetail/PatDetail.jsx | 18 ++- src/components/PatList/PatList.jsx | 2 +- src/components/PatTestManager.jsx | 20 +-- src/components/ProfileTab.jsx | 9 +- src/i18n/LanguageContext.jsx | 16 ++- src/i18n/exerciseNames.js | 138 ++++++++++++++++++++ src/i18n/translations.js | 61 +++++++++ vite.config.js | 13 ++ 19 files changed, 335 insertions(+), 349 deletions(-) delete mode 100644 dist/assets/index-BaBfIFek.css delete mode 100644 dist/assets/index-Cg2UxsRL.js delete mode 100644 dist/assets/index.es-DQ6YK4So.js delete mode 100644 dist/assets/jspdf.es.min-CLjTnO_I.js create mode 100644 src/i18n/exerciseNames.js diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 33774c4..cbfee3d 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,7 +1,10 @@ { "permissions": { "allow": [ - "Bash(supabase --version)" + "Bash(supabase --version)", + "Bash(grep -n \"Radar-Profil\\\\|Ist/Soll\\\\|Trend \\(Gesamtpunkte\\)\\\\|Für den Trend\\\\|Kein Radarprofil\\\\|Deutsch\\\\|Englisch\\\\|Italienisch\\\\|Spanisch\\\\|Portugiesisch\\\\|Test final abschließen\\\\|Test als Link teilen\" /d/Projekte/PAT-STATS/src/components/**/*.jsx)", + "Bash(find /d/Projekte/PAT-STATS/src -type f \\\\\\(-name *route* -o -name *Router* \\\\\\))", + "Bash(npm run:*)" ] } } diff --git a/.gitignore b/.gitignore index 3c3629e..76add87 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +dist \ No newline at end of file diff --git a/Weitere Ideen.txt b/Weitere Ideen.txt index c32f453..6bc1483 100644 --- a/Weitere Ideen.txt +++ b/Weitere Ideen.txt @@ -1,7 +1,7 @@ Offen Rangliste -Übersetzen in gängigge Sprachen Englisch Italienisch Spanisch Portugisisch +code splitting Admin Oberfläche (anzahl user mit Mail Adressen/ anelegten Tests / anbindung von Werbung Links und rechts von den Test Übersichten 2fa @@ -11,11 +11,12 @@ Erledigt: Final Speichern do Max Punkte bei Bewertung PAT1 User Profil mit Land und Sprach Auswahl +Übersetzen in gängigge Sprachen Englisch Italienisch Spanisch Portugisisch Termninal vercel deploy git add . -git commit -m "BenutzerProfil " +git commit -m "Übersetzung Teil 1" git push \ No newline at end of file diff --git a/dist/assets/index-BaBfIFek.css b/dist/assets/index-BaBfIFek.css deleted file mode 100644 index 1839610..0000000 --- a/dist/assets/index-BaBfIFek.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap";.public-site{--public-bg: #07131f;--public-bg-strong: #0b1726;--public-surface: rgba(11, 23, 38, .78);--public-surface-soft: rgba(15, 27, 45, .62);--public-border: rgba(148, 163, 184, .16);--public-text: #f8fafc;--public-muted: #9db0c8;--public-accent: #60a5fa;--public-accent-strong: #2563eb;--public-success: #3b82f6;--public-warm: #f59e0b;position:relative;min-height:100vh;color:var(--public-text);background:radial-gradient(circle at top left,rgba(59,130,246,.16),transparent 28%),radial-gradient(circle at top right,rgba(96,165,250,.18),transparent 22%),radial-gradient(circle at 50% 100%,rgba(245,158,11,.08),transparent 30%),linear-gradient(180deg,var(--public-bg) 0%,var(--public-bg-strong) 48%,var(--public-bg) 100%);overflow:hidden}.public-site__backdrop,.public-site__grid{pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.public-site__backdrop{background:radial-gradient(circle at 18% 18%,rgba(59,130,246,.12),transparent 20%),radial-gradient(circle at 82% 22%,rgba(96,165,250,.14),transparent 18%)}.public-site__grid{background-image:linear-gradient(rgba(148,163,184,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.04) 1px,transparent 1px);background-size:52px 52px;-webkit-mask-image:linear-gradient(180deg,transparent,black 18%,black 82%,transparent);mask-image:linear-gradient(180deg,transparent,black 18%,black 82%,transparent)}.public-site__nav{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1.2rem 5vw;background:#07131fd6;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border-bottom:1px solid rgba(148,163,184,.08)}.public-site__brand{display:inline-flex;align-items:center;gap:.85rem;background:none;border:0;color:var(--public-text);font:inherit;cursor:pointer;padding:0}.public-site__brand-mark{display:inline-flex;align-items:center;justify-content:center;width:2.8rem;height:2.8rem;border-radius:1rem;background:linear-gradient(135deg,#60a5faf5,#2563ebeb);color:#eff6ff;box-shadow:0 16px 40px #0ea5e92e}.public-site__brand-copy{display:flex;flex-direction:column;align-items:flex-start;line-height:1.1}.public-site__brand-title{font-size:1.05rem;font-weight:700;letter-spacing:-.02em}.public-site__brand-subtitle{font-size:.8rem;color:var(--public-muted)}.public-site__nav-links,.public-site__footer-links{display:flex;align-items:center;gap:.85rem;flex-wrap:wrap}.public-site__nav-link,.public-site__footer-link,.public-site__text-action{background:none;border:0;color:var(--public-muted);cursor:pointer;font:inherit;font-size:.95rem;font-weight:500;padding:.2rem 0;transition:color .2s ease}.public-site__nav-link:hover,.public-site__footer-link:hover,.public-site__text-action:hover,.public-site__nav-link.is-active,.public-site__footer-link.is-active{color:var(--public-text)}.public-site__nav-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;justify-content:flex-end}.public-site__theme-toggle{display:inline-flex}.public-site__cta,.public-site__button,.public-site__button--secondary{display:inline-flex;align-items:center;justify-content:center;gap:.55rem;border-radius:.95rem;padding:.95rem 1.4rem;font-size:.95rem;font-weight:700;text-decoration:none;transition:transform .22s ease,box-shadow .22s ease,background .22s ease,border-color .22s ease;cursor:pointer}.public-site__cta,.public-site__button{color:#eff6ff;background:linear-gradient(135deg,var(--public-accent),var(--public-accent-strong));border:0;box-shadow:0 14px 34px #2563eb38}.public-site__cta:hover,.public-site__button:hover{transform:translateY(-2px);box-shadow:0 18px 38px #2563eb47}.public-site__cta--nav{min-height:42px;padding:.5rem .75rem;border-radius:.5rem;font-size:.875rem;font-weight:500;gap:.5rem;line-height:1.25rem;box-shadow:none}.public-site__cta--nav:hover{box-shadow:none}.public-site__button--secondary{color:var(--public-text);background:#0f1b2d8c;border:1px solid var(--public-border)}.public-site__button--secondary:hover{transform:translateY(-2px);border-color:#38bdf852;background:#0f1b2dd1}.public-site__main{position:relative;z-index:1;padding:0 5vw 4rem}.public-hero,.public-section,.public-page{max-width:1280px;margin:0 auto}.public-hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);gap:3rem;align-items:center;padding:4.8rem 0 4.5rem}.public-hero__badge,.public-section__tag{display:inline-flex;align-items:center;gap:.55rem;padding:.5rem .95rem;border-radius:999px;border:1px solid rgba(96,165,250,.22);background:#60a5fa1a;color:#dbeafe;font-size:.82rem;font-weight:600;letter-spacing:.02em}.public-hero__title{margin:1.35rem 0 1.1rem;font-size:clamp(2.85rem,6vw,5rem);line-height:.98;letter-spacing:-.04em}.public-hero__title-accent{display:block;color:transparent;background:linear-gradient(135deg,#dbeafe,#60a5fa 45%,#2563eb);background-clip:text;-webkit-background-clip:text}.public-hero__copy{margin:0;max-width:40rem;color:var(--public-muted);font-size:1.1rem;line-height:1.8}.public-hero__actions{display:flex;flex-wrap:wrap;gap:.95rem;margin-top:2rem}.public-hero__meta{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.65rem}.public-chip{display:inline-flex;align-items:center;gap:.5rem;border-radius:999px;border:1px solid var(--public-border);background:#0f1b2d9e;padding:.7rem 1rem;color:var(--public-muted);font-size:.9rem}.public-hero__panel,.public-card,.public-page__card,.public-stats__card,.public-preview__panel{border:1px solid var(--public-border);background:var(--public-surface);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:0 28px 60px #0000003d}.public-preview__panel{padding:1.6rem;border-radius:1.8rem;transform:perspective(1000px) rotateY(-6deg) rotateX(4deg);transition:transform .3s ease}.public-preview__panel:hover{transform:perspective(1000px) rotateY(-2deg) rotateX(1deg)}.public-preview__head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding-bottom:1rem;border-bottom:1px solid rgba(148,163,184,.12)}.public-preview__status{color:#bfdbfe;font-size:.85rem;font-weight:600}.public-preview__status:before{content:"";display:inline-block;width:.55rem;height:.55rem;margin-right:.45rem;border-radius:999px;background:#60a5fa;box-shadow:0 0 0 6px #60a5fa29}.public-preview__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1.2rem}.public-preview__card{border-radius:1.25rem;padding:1.15rem;background:#07131f8f;border:1px solid rgba(148,163,184,.12)}.public-preview__label{color:var(--public-muted);font-size:.8rem}.public-preview__value{margin-top:.55rem;font-size:2rem;font-weight:700;letter-spacing:-.03em}.public-preview__value--accent{color:#93c5fd}.public-preview__value--success{color:#60a5fa}.public-progress{height:.5rem;margin-top:.85rem;overflow:hidden;border-radius:999px;background:#ffffff14}.public-progress>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--public-accent),var(--public-accent-strong))}.public-preview__meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem;margin-top:1rem}.public-preview__meta-card{padding:1rem;border-radius:1rem;background:#0309126b;border:1px solid rgba(148,163,184,.08)}.public-section{margin-bottom:4.5rem}.public-section__header{max-width:48rem;margin:0 auto 2.5rem;text-align:center}.public-section__title{margin:1rem 0 .75rem;font-size:clamp(2rem,4vw,3.25rem);line-height:1.08;letter-spacing:-.03em}.public-section__copy{margin:0;color:var(--public-muted);font-size:1.05rem;line-height:1.75}.public-features,.public-steps,.public-page__grid{display:grid;gap:1.2rem}.public-features{grid-template-columns:repeat(3,minmax(0,1fr))}.public-card{border-radius:1.5rem;padding:1.5rem}.public-card__icon{display:inline-flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:1rem;background:linear-gradient(135deg,#60a5fa33,#2563eb29);color:#dbeafe;margin-bottom:1rem}.public-card__title{margin:0 0 .75rem;font-size:1.2rem}.public-card__copy{margin:0;color:var(--public-muted);line-height:1.75}.public-steps{grid-template-columns:repeat(3,minmax(0,1fr))}.public-step{position:relative;padding:1.6rem;border-radius:1.5rem}.public-step__number{display:inline-flex;align-items:center;justify-content:center;width:3.25rem;height:3.25rem;border-radius:999px;background:#60a5fa1f;border:1px solid rgba(96,165,250,.32);color:#dbeafe;font-weight:700;margin-bottom:1rem}.public-step__title{margin:0 0 .6rem;font-size:1.15rem}.public-step__copy{margin:0;color:var(--public-muted);line-height:1.7}.public-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.public-stats__card{border-radius:1.5rem;padding:1.5rem;text-align:center}.public-stats__value{font-size:clamp(2rem,4vw,3rem);font-weight:800;letter-spacing:-.04em}.public-stats__label{margin-top:.5rem;color:var(--public-muted)}.public-cta-panel{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:2rem;border-radius:1.9rem;background:linear-gradient(135deg,#06121ff0,#0b1726c7);border:1px solid var(--public-border);box-shadow:0 28px 60px #0000003d}.public-cta-panel__title{margin:.75rem 0 .55rem;font-size:clamp(1.8rem,4vw,2.6rem);line-height:1.1}.public-cta-panel__copy{margin:0;color:var(--public-muted);line-height:1.75}.public-cta-panel__actions{display:flex;flex-wrap:wrap;gap:.9rem}.public-page{padding:3.25rem 0 4rem}.public-page__hero{max-width:54rem;margin-bottom:2rem}.public-page__title{margin:1rem 0 .8rem;font-size:clamp(2.25rem,5vw,4rem);line-height:1.02;letter-spacing:-.04em}.public-page__copy{margin:0;color:var(--public-muted);font-size:1.03rem;line-height:1.8}.public-page__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.public-page__card{border-radius:1.5rem;padding:1.5rem}.public-page__card--wide{grid-column:1 / -1}.public-page__card-title{margin:0 0 .8rem;font-size:1.15rem}.public-page__card-copy,.public-page__list{margin:0;color:var(--public-muted);line-height:1.75}.public-page__list{padding-left:1.1rem}.public-page__list li+li{margin-top:.45rem}.public-page__notice{margin-top:1rem;padding:1rem 1.1rem;border-radius:1rem;border:1px solid rgba(245,158,11,.18);background:#f59e0b14;color:#fcd34d;line-height:1.7}.public-site__footer{position:relative;z-index:1;max-width:1280px;margin:0 auto;padding:0 5vw 2.8rem}.public-site__footer-inner{display:flex;align-items:center;justify-content:space-between;gap:1.2rem;padding-top:1.5rem;border-top:1px solid rgba(148,163,184,.12)}.public-site__footer-meta{color:var(--public-muted);font-size:.92rem}html:not(.dark) .public-site{--public-bg: #eef4ff;--public-bg-strong: #f8fbff;--public-surface: rgba(255, 255, 255, .88);--public-surface-soft: rgba(255, 255, 255, .74);--public-border: rgba(37, 99, 235, .14);--public-text: #0f172a;--public-muted: #475569;background:radial-gradient(circle at top left,rgba(96,165,250,.2),transparent 28%),radial-gradient(circle at top right,rgba(191,219,254,.44),transparent 24%),radial-gradient(circle at 50% 100%,rgba(245,158,11,.12),transparent 30%),linear-gradient(180deg,var(--public-bg) 0%,var(--public-bg-strong) 48%,#edf5ff 100%)}html:not(.dark) .public-site__backdrop{background:radial-gradient(circle at 18% 18%,rgba(96,165,250,.14),transparent 22%),radial-gradient(circle at 82% 22%,rgba(59,130,246,.12),transparent 18%)}html:not(.dark) .public-site__grid{background-image:linear-gradient(rgba(37,99,235,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(37,99,235,.05) 1px,transparent 1px)}html:not(.dark) .public-site__nav{background:#ffffffd6;border-bottom:1px solid rgba(37,99,235,.12)}html:not(.dark) .public-site__brand-mark{box-shadow:0 16px 40px #2563eb29}html:not(.dark) .public-site__button--secondary{background:#ffffffd6;border-color:#2563eb29}html:not(.dark) .public-site__button--secondary:hover{border-color:#2563eb47;background:#fffffff5}html:not(.dark) .public-hero__badge,html:not(.dark) .public-section__tag{color:#1d4ed8;background:#60a5fa1f}html:not(.dark) .public-chip{background:#ffffffc7}html:not(.dark) .public-preview__panel,html:not(.dark) .public-card,html:not(.dark) .public-page__card,html:not(.dark) .public-stats__card{box-shadow:0 24px 52px #2563eb1f}html:not(.dark) .public-preview__card{background:#ffffffd6;border-color:#2563eb1f}html:not(.dark) .public-progress{background:#2563eb1a}html:not(.dark) .public-preview__meta-card{background:#f4f7ffe6;border-color:#2563eb1f}html:not(.dark) .public-cta-panel{background:linear-gradient(135deg,#fffffff2,#eff6ffeb);box-shadow:0 24px 52px #2563eb1f}html:not(.dark) .public-site__footer-inner{border-top:1px solid rgba(37,99,235,.12)}@media (max-width: 1100px){.public-hero{grid-template-columns:1fr}.public-preview__panel{transform:none}.public-features,.public-steps,.public-stats,.public-page__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.public-cta-panel{flex-direction:column;align-items:flex-start}}@media (max-width: 780px){.public-site__nav{align-items:flex-start;flex-direction:column}.public-site__nav-links,.public-site__nav-actions,.public-site__footer-inner{width:100%}.public-site__footer-inner{flex-direction:column;align-items:flex-start}.public-preview__grid,.public-preview__meta,.public-features,.public-steps,.public-stats,.public-page__grid{grid-template-columns:1fr}.public-hero__title{font-size:clamp(2.4rem,12vw,4rem)}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.left-4{left:1rem}.right-0{right:0}.right-4{right:1rem}.top-4{top:1rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mr-1{margin-right:.25rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-16{height:4rem}.h-28{height:7rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-auto{height:auto}.h-full{height:100%}.max-h-72{max-height:18rem}.max-h-80{max-height:20rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-16{width:4rem}.w-3{width:.75rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-80{width:20rem}.w-full{width:100%}.min-w-10{min-width:2.5rem}.min-w-12{min-width:3rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[420px\]{max-width:420px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-200\/70{border-color:#fde68ab3}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-cyan-200{--tw-border-opacity: 1;border-color:rgb(165 243 252 / var(--tw-border-opacity, 1))}.border-emerald-100{--tw-border-opacity: 1;border-color:rgb(209 250 229 / var(--tw-border-opacity, 1))}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-emerald-200\/70{border-color:#a7f3d0b3}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-200\/60{border-color:#e5e7eb99}.border-gray-200\/70{border-color:#e5e7ebb3}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-900{--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.border-indigo-200{--tw-border-opacity: 1;border-color:rgb(199 210 254 / var(--tw-border-opacity, 1))}.border-indigo-200\/70{border-color:#c7d2feb3}.border-indigo-600{--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-rose-100{--tw-border-opacity: 1;border-color:rgb(255 228 230 / var(--tw-border-opacity, 1))}.border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity, 1))}.border-rose-300{--tw-border-opacity: 1;border-color:rgb(253 164 175 / var(--tw-border-opacity, 1))}.border-sky-100{--tw-border-opacity: 1;border-color:rgb(224 242 254 / var(--tw-border-opacity, 1))}.border-sky-200{--tw-border-opacity: 1;border-color:rgb(186 230 253 / var(--tw-border-opacity, 1))}.border-sky-200\/70{border-color:#bae6fdb3}.border-sky-300{--tw-border-opacity: 1;border-color:rgb(125 211 252 / var(--tw-border-opacity, 1))}.border-white\/70{border-color:#ffffffb3}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-300{--tw-bg-opacity: 1;background-color:rgb(147 197 253 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.bg-cyan-50{--tw-bg-opacity: 1;background-color:rgb(236 254 255 / var(--tw-bg-opacity, 1))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-200\/70{background-color:#a7f3d0b3}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-emerald-50\/60{background-color:#ecfdf599}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-emerald-700{--tw-bg-opacity: 1;background-color:rgb(4 120 87 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-300{--tw-bg-opacity: 1;background-color:rgb(134 239 172 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.bg-indigo-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-rose-200\/70{background-color:#fecdd3b3}.bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.bg-rose-50\/60{background-color:#fff1f299}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity, 1))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-sky-50\/60{background-color:#f0f9ff99}.bg-sky-600{--tw-bg-opacity: 1;background-color:rgb(2 132 199 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-white\/90{background-color:#ffffffe6}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-50{--tw-gradient-from: #ecfeff var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 254 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-50{--tw-gradient-from: #ecfdf5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 253 245 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-100{--tw-gradient-from: #dcfce7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(220 252 231 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-50{--tw-gradient-from: #f0fdf4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 253 244 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-50{--tw-gradient-from: #eef2ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(238 242 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-sky-100{--tw-gradient-from: #e0f2fe var(--tw-gradient-from-position);--tw-gradient-to: rgb(224 242 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-sky-50{--tw-gradient-from: #f0f9ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 249 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-50{--tw-gradient-from: #f8fafc var(--tw-gradient-from-position);--tw-gradient-to: rgb(248 250 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-blue-50{--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #eff6ff var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-sky-50{--tw-gradient-to: rgb(240 249 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #f0f9ff var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #fff var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-amber-50{--tw-gradient-to: #fffbeb var(--tw-gradient-to-position)}.to-blue-100{--tw-gradient-to: #dbeafe var(--tw-gradient-to-position)}.to-emerald-100{--tw-gradient-to: #d1fae5 var(--tw-gradient-to-position)}.to-emerald-50{--tw-gradient-to: #ecfdf5 var(--tw-gradient-to-position)}.to-emerald-600{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.to-indigo-50{--tw-gradient-to: #eef2ff var(--tw-gradient-to-position)}.to-sky-50{--tw-gradient-to: #f0f9ff var(--tw-gradient-to-position)}.fill-gray-200{fill:#e5e7eb}.fill-gray-500{fill:#6b7280}.fill-gray-600{fill:#4b5563}.fill-gray-700{fill:#374151}.fill-indigo-500{fill:#6366f1}.fill-rose-500{fill:#f43f5e}.fill-sky-300\/40{fill:#7dd3fc66}.stroke-gray-300{stroke:#d1d5db}.stroke-indigo-500{stroke:#6366f1}.stroke-sky-600{stroke:#0284c7}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:.25rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.tracking-\[0\.25em\]{letter-spacing:.25em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-wide{letter-spacing:.025em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-700\/80{color:#b45309cc}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-cyan-700{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-700\/80{color:#047857cc}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-700\/80{color:#4338cacc}.text-indigo-900{--tw-text-opacity: 1;color:rgb(49 46 129 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity, 1))}.text-rose-700{--tw-text-opacity: 1;color:rgb(190 18 60 / var(--tw-text-opacity, 1))}.text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity, 1))}.text-sky-600{--tw-text-opacity: 1;color:rgb(2 132 199 / var(--tw-text-opacity, 1))}.text-sky-700{--tw-text-opacity: 1;color:rgb(3 105 161 / var(--tw-text-opacity, 1))}.text-sky-700\/80{color:#0369a1cc}.text-sky-800{--tw-text-opacity: 1;color:rgb(7 89 133 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black\/10{--tw-ring-color: rgb(0 0 0 / .1)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}body{margin:0;font-family:Space Grotesk,Inter,Segoe UI,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.hover\:-translate-y-\[1px\]:hover{--tw-translate-y: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-sky-400:hover{--tw-border-opacity: 1;border-color:rgb(56 189 248 / var(--tw-border-opacity, 1))}.hover\:bg-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-50:hover{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 120 87 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-800:hover{--tw-bg-opacity: 1;background-color:rgb(6 95 70 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-50:hover{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-rose-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.hover\:bg-sky-700:hover{--tw-bg-opacity: 1;background-color:rgb(3 105 161 / var(--tw-bg-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:shadow:hover{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-sky-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(14 165 233 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-amber-900\/70:is(.dark *){border-color:#78350fb3}.dark\:border-cyan-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 94 117 / var(--tw-border-opacity, 1))}.dark\:border-emerald-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.dark\:border-emerald-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(6 95 70 / var(--tw-border-opacity, 1))}.dark\:border-emerald-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(6 78 59 / var(--tw-border-opacity, 1))}.dark\:border-emerald-900\/60:is(.dark *){border-color:#064e3b99}.dark\:border-emerald-900\/70:is(.dark *){border-color:#064e3bb3}.dark\:border-gray-100:is(.dark *){--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\:border-indigo-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 48 163 / var(--tw-border-opacity, 1))}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:border-rose-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(190 18 60 / var(--tw-border-opacity, 1))}.dark\:border-rose-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(159 18 57 / var(--tw-border-opacity, 1))}.dark\:border-rose-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(136 19 55 / var(--tw-border-opacity, 1))}.dark\:border-rose-900\/60:is(.dark *){border-color:#88133799}.dark\:border-rose-900\/70:is(.dark *){border-color:#881337b3}.dark\:border-sky-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(7 89 133 / var(--tw-border-opacity, 1))}.dark\:border-sky-900\/60:is(.dark *){border-color:#0c4a6e99}.dark\:border-sky-900\/70:is(.dark *){border-color:#0c4a6eb3}.dark\:bg-amber-900\/30:is(.dark *){background-color:#78350f4d}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-900\/30:is(.dark *){background-color:#1e3a8a4d}.dark\:bg-cyan-900\/30:is(.dark *){background-color:#164e634d}.dark\:bg-emerald-800\/60:is(.dark *){background-color:#065f4699}.dark\:bg-emerald-900\/30:is(.dark *){background-color:#064e3b4d}.dark\:bg-emerald-900\/40:is(.dark *){background-color:#064e3b66}.dark\:bg-emerald-950\/20:is(.dark *){background-color:#022c2233}.dark\:bg-emerald-950\/30:is(.dark *){background-color:#022c224d}.dark\:bg-emerald-950\/40:is(.dark *){background-color:#022c2266}.dark\:bg-gray-100:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/60:is(.dark *){background-color:#1f293799}.dark\:bg-gray-800\/70:is(.dark *){background-color:#1f2937b3}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900\/70:is(.dark *){background-color:#111827b3}.dark\:bg-gray-900\/80:is(.dark *){background-color:#111827cc}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950\/40:is(.dark *){background-color:#03071266}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-indigo-900\/30:is(.dark *){background-color:#312e814d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-rose-800\/60:is(.dark *){background-color:#9f123999}.dark\:bg-rose-950\/20:is(.dark *){background-color:#4c051933}.dark\:bg-rose-950\/30:is(.dark *){background-color:#4c05194d}.dark\:bg-sky-900\/40:is(.dark *){background-color:#0c4a6e66}.dark\:bg-sky-950\/20:is(.dark *){background-color:#082f4933}.dark\:bg-sky-950\/30:is(.dark *){background-color:#082f494d}.dark\:bg-sky-950\/40:is(.dark *){background-color:#082f4966}.dark\:from-amber-900\/30:is(.dark *){--tw-gradient-from: rgb(120 53 15 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(120 53 15 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-emerald-900\/30:is(.dark *){--tw-gradient-from: rgb(6 78 59 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 78 59 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-gray-800:is(.dark *){--tw-gradient-from: #1f2937 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-gray-950:is(.dark *){--tw-gradient-from: #030712 var(--tw-gradient-from-position);--tw-gradient-to: rgb(3 7 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-indigo-900\/30:is(.dark *){--tw-gradient-from: rgb(49 46 129 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-sky-900\/30:is(.dark *){--tw-gradient-from: rgb(12 74 110 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(12 74 110 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-gray-900:is(.dark *){--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #111827 var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:via-gray-950:is(.dark *){--tw-gradient-to: rgb(3 7 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #030712 var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-amber-900\/20:is(.dark *){--tw-gradient-to: rgb(120 53 15 / .2) var(--tw-gradient-to-position)}.dark\:to-emerald-900\/20:is(.dark *){--tw-gradient-to: rgb(6 78 59 / .2) var(--tw-gradient-to-position)}.dark\:to-gray-700:is(.dark *){--tw-gradient-to: #374151 var(--tw-gradient-to-position)}.dark\:to-gray-900:is(.dark *){--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.dark\:to-gray-950:is(.dark *){--tw-gradient-to: #030712 var(--tw-gradient-to-position)}.dark\:to-indigo-900\/20:is(.dark *){--tw-gradient-to: rgb(49 46 129 / .2) var(--tw-gradient-to-position)}.dark\:to-sky-900\/20:is(.dark *){--tw-gradient-to: rgb(12 74 110 / .2) var(--tw-gradient-to-position)}.dark\:fill-gray-200:is(.dark *){fill:#e5e7eb}.dark\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\:fill-gray-400:is(.dark *){fill:#9ca3af}.dark\:fill-gray-800:is(.dark *){fill:#1f2937}.dark\:fill-sky-500\/30:is(.dark *){fill:#0ea5e94d}.dark\:stroke-gray-700:is(.dark *){stroke:#374151}.dark\:stroke-sky-400:is(.dark *){stroke:#38bdf8}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.dark\:text-amber-200\/70:is(.dark *){color:#fde68ab3}.dark\:text-amber-200\/80:is(.dark *){color:#fde68acc}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-cyan-200:is(.dark *){--tw-text-opacity: 1;color:rgb(165 243 252 / var(--tw-text-opacity, 1))}.dark\:text-cyan-300:is(.dark *){--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.dark\:text-emerald-100:is(.dark *){--tw-text-opacity: 1;color:rgb(209 250 229 / var(--tw-text-opacity, 1))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.dark\:text-emerald-200\/70:is(.dark *){color:#a7f3d0b3}.dark\:text-emerald-300:is(.dark *){--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-gray-700:is(.dark *){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.dark\:text-gray-900:is(.dark *){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-indigo-100:is(.dark *){--tw-text-opacity: 1;color:rgb(224 231 255 / var(--tw-text-opacity, 1))}.dark\:text-indigo-200:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:text-indigo-200\/70:is(.dark *){color:#c7d2feb3}.dark\:text-indigo-300:is(.dark *){--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-rose-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 205 211 / var(--tw-text-opacity, 1))}.dark\:text-rose-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.dark\:text-sky-100:is(.dark *){--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity, 1))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity, 1))}.dark\:text-sky-200\/70:is(.dark *){color:#bae6fdb3}.dark\:text-sky-300:is(.dark *){--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-emerald-900\/40:hover:is(.dark *){background-color:#064e3b66}.dark\:hover\:bg-gray-200:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-800\/40:hover:is(.dark *){background-color:#1f293766}.dark\:hover\:bg-indigo-900\/40:hover:is(.dark *){background-color:#312e8166}.dark\:hover\:bg-rose-950\/40:hover:is(.dark *){background-color:#4c051966}.dark\:hover\:text-gray-100:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:self-end{align-self:flex-end}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/dist/assets/index-Cg2UxsRL.js b/dist/assets/index-Cg2UxsRL.js deleted file mode 100644 index c935d66..0000000 --- a/dist/assets/index-Cg2UxsRL.js +++ /dev/null @@ -1,86 +0,0 @@ -function jp(t,e){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function gs(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var _d={exports:{}},Xi={},Ed={exports:{}},W={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ms=Symbol.for("react.element"),Np=Symbol.for("react.portal"),Tp=Symbol.for("react.fragment"),Pp=Symbol.for("react.strict_mode"),Cp=Symbol.for("react.profiler"),Ap=Symbol.for("react.provider"),Op=Symbol.for("react.context"),Rp=Symbol.for("react.forward_ref"),zp=Symbol.for("react.suspense"),Ip=Symbol.for("react.memo"),Lp=Symbol.for("react.lazy"),Ou=Symbol.iterator;function Dp(t){return t===null||typeof t!="object"?null:(t=Ou&&t[Ou]||t["@@iterator"],typeof t=="function"?t:null)}var Sd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jd=Object.assign,Nd={};function yn(t,e,r){this.props=t,this.context=e,this.refs=Nd,this.updater=r||Sd}yn.prototype.isReactComponent={};yn.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yn.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Td(){}Td.prototype=yn.prototype;function Sl(t,e,r){this.props=t,this.context=e,this.refs=Nd,this.updater=r||Sd}var jl=Sl.prototype=new Td;jl.constructor=Sl;jd(jl,yn.prototype);jl.isPureReactComponent=!0;var Ru=Array.isArray,Pd=Object.prototype.hasOwnProperty,Nl={current:null},Cd={key:!0,ref:!0,__self:!0,__source:!0};function Ad(t,e,r){var n,s={},i=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)Pd.call(e,n)&&!Cd.hasOwnProperty(n)&&(s[n]=e[n]);var o=arguments.length-2;if(o===1)s.children=r;else if(1>>1,ie=R[X];if(0>>1;Xs(lr,H))ats(jt,lr)?(R[X]=jt,R[at]=H,X=at):(R[X]=lr,R[We]=H,X=We);else if(ats(jt,H))R[X]=jt,R[at]=H,X=at;else break e}}return M}function s(R,M){var H=R.sortIndex-M.sortIndex;return H!==0?H:R.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var u=[],c=[],d=1,h=null,f=3,y=!1,w=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(R){for(var M=r(c);M!==null;){if(M.callback===null)n(c);else if(M.startTime<=R)n(c),M.sortIndex=M.expirationTime,e(u,M);else break;M=r(c)}}function k(R){if(x=!1,g(R),!w)if(r(u)!==null)w=!0,he(E);else{var M=r(c);M!==null&&Re(k,M.startTime-R)}}function E(R,M){w=!1,x&&(x=!1,p(_),_=-1),y=!0;var H=f;try{for(g(M),h=r(u);h!==null&&(!(h.expirationTime>M)||R&&!A());){var X=h.callback;if(typeof X=="function"){h.callback=null,f=h.priorityLevel;var ie=X(h.expirationTime<=M);M=t.unstable_now(),typeof ie=="function"?h.callback=ie:h===r(u)&&n(u),g(M)}else n(u);h=r(u)}if(h!==null)var St=!0;else{var We=r(c);We!==null&&Re(k,We.startTime-M),St=!1}return St}finally{h=null,f=H,y=!1}}var S=!1,j=null,_=-1,N=5,C=-1;function A(){return!(t.unstable_now()-CR||125X?(R.sortIndex=H,e(c,R),r(u)===null&&R===r(c)&&(x?(p(_),_=-1):x=!0,Re(k,H-X))):(R.sortIndex=ie,e(u,R),w||y||(w=!0,he(E))),R},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(R){var M=f;return function(){var H=f;f=M;try{return R.apply(this,arguments)}finally{f=H}}}})(Ld);Id.exports=Ld;var Gp=Id.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jp=T,Ye=Gp;function P(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ho=Object.prototype.hasOwnProperty,Qp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Iu={},Lu={};function Yp(t){return ho.call(Lu,t)?!0:ho.call(Iu,t)?!1:Qp.test(t)?Lu[t]=!0:(Iu[t]=!0,!1)}function Zp(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Xp(t,e,r,n){if(e===null||typeof e>"u"||Zp(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function De(t,e,r,n,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ne[t]=new De(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ne[e]=new De(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ne[t]=new De(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ne[t]=new De(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ne[t]=new De(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ne[t]=new De(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ne[t]=new De(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ne[t]=new De(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ne[t]=new De(t,5,!1,t.toLowerCase(),null,!1,!1)});var Pl=/[\-:]([a-z])/g;function Cl(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Pl,Cl);Ne[e]=new De(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Pl,Cl);Ne[e]=new De(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Pl,Cl);Ne[e]=new De(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ne[t]=new De(t,1,!1,t.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ne[t]=new De(t,1,!1,t.toLowerCase(),null,!0,!0)});function Al(t,e,r,n){var s=Ne.hasOwnProperty(e)?Ne[e]:null;(s!==null?s.type!==0:n||!(2o||s[a]!==i[o]){var u=` -`+s[a].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=a&&0<=o);break}}}finally{Sa=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?On(t):""}function eg(t){switch(t.tag){case 5:return On(t.type);case 16:return On("Lazy");case 13:return On("Suspense");case 19:return On("SuspenseList");case 0:case 2:case 15:return t=ja(t.type,!1),t;case 11:return t=ja(t.type.render,!1),t;case 1:return t=ja(t.type,!0),t;default:return""}}function mo(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $r:return"Fragment";case Fr:return"Portal";case fo:return"Profiler";case Ol:return"StrictMode";case po:return"Suspense";case go:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Fd:return(t.displayName||"Context")+".Consumer";case Md:return(t._context.displayName||"Context")+".Provider";case Rl:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case zl:return e=t.displayName||null,e!==null?e:mo(t.type)||"Memo";case $t:e=t._payload,t=t._init;try{return mo(t(e))}catch{}}return null}function tg(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mo(e);case 8:return e===Ol?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function rr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Bd(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function rg(t){var e=Bd(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function js(t){t._valueTracker||(t._valueTracker=rg(t))}function Ud(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=Bd(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function yi(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function yo(t,e){var r=e.checked;return ce({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Mu(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=rr(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Hd(t,e){e=e.checked,e!=null&&Al(t,"checked",e,!1)}function vo(t,e){Hd(t,e);var r=rr(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?wo(t,e.type,r):e.hasOwnProperty("defaultValue")&&wo(t,e.type,rr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Fu(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function wo(t,e,r){(e!=="number"||yi(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Rn=Array.isArray;function Zr(t,e,r,n){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=Ns.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Yn(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var $n={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ng=["Webkit","ms","Moz","O"];Object.keys($n).forEach(function(t){ng.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),$n[e]=$n[t]})});function qd(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||$n.hasOwnProperty(t)&&$n[t]?(""+e).trim():e+"px"}function Gd(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=qd(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var sg=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ko(t,e){if(e){if(sg[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(P(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(P(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(P(61))}if(e.style!=null&&typeof e.style!="object")throw Error(P(62))}}function _o(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Eo=null;function Il(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var So=null,Xr=null,en=null;function Uu(t){if(t=ws(t)){if(typeof So!="function")throw Error(P(280));var e=t.stateNode;e&&(e=sa(e),So(t.stateNode,t.type,e))}}function Jd(t){Xr?en?en.push(t):en=[t]:Xr=t}function Qd(){if(Xr){var t=Xr,e=en;if(en=Xr=null,Uu(t),e)for(t=0;t>>=0,t===0?32:31-(gg(t)/mg|0)|0}var Ts=64,Ps=4194304;function zn(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function bi(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,s=t.suspendedLanes,i=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~s;o!==0?n=zn(o):(i&=a,i!==0&&(n=zn(i)))}else a=r&~s,a!==0?n=zn(a):i!==0&&(n=zn(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&s)&&(s=n&-n,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function ys(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-gt(e),t[e]=r}function xg(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Un),Yu=" ",Zu=!1;function mh(t,e){switch(t){case"keyup":return Gg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Br=!1;function Qg(t,e){switch(t){case"compositionend":return yh(e);case"keypress":return e.which!==32?null:(Zu=!0,Yu);case"textInput":return t=e.data,t===Yu&&Zu?null:t;default:return null}}function Yg(t,e){if(Br)return t==="compositionend"||!Hl&&mh(t,e)?(t=ph(),ni=$l=Kt=null,Br=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rc(r)}}function bh(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?bh(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function kh(){for(var t=window,e=yi();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=yi(t.document)}return e}function Vl(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function am(t){var e=kh(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&bh(r.ownerDocument.documentElement,r)){if(n!==null&&Vl(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!t.extend&&i>n&&(s=n,n=i,i=s),s=nc(r,i);var a=nc(r,n);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Ur=null,Ao=null,Vn=null,Oo=!1;function sc(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Oo||Ur==null||Ur!==yi(n)||(n=Ur,"selectionStart"in n&&Vl(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Vn&&ns(Vn,n)||(Vn=n,n=Ei(Ao,"onSelect"),0Wr||(t.current=Mo[Wr],Mo[Wr]=null,Wr--)}function re(t,e){Wr++,Mo[Wr]=t.current,t.current=e}var nr={},Oe=ir(nr),Ue=ir(!1),Er=nr;function ln(t,e){var r=t.type.contextTypes;if(!r)return nr;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function He(t){return t=t.childContextTypes,t!=null}function ji(){se(Ue),se(Oe)}function dc(t,e,r){if(Oe.current!==nr)throw Error(P(168));re(Oe,e),re(Ue,r)}function Ah(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in e))throw Error(P(108,tg(t)||"Unknown",s));return ce({},r,n)}function Ni(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||nr,Er=Oe.current,re(Oe,t),re(Ue,Ue.current),!0}function hc(t,e,r){var n=t.stateNode;if(!n)throw Error(P(169));r?(t=Ah(t,e,Er),n.__reactInternalMemoizedMergedChildContext=t,se(Ue),se(Oe),re(Oe,t)):se(Ue),re(Ue,r)}var Pt=null,ia=!1,$a=!1;function Oh(t){Pt===null?Pt=[t]:Pt.push(t)}function vm(t){ia=!0,Oh(t)}function ar(){if(!$a&&Pt!==null){$a=!0;var t=0,e=Z;try{var r=Pt;for(Z=1;t>=a,s-=a,Ct=1<<32-gt(e)+s|r<_?(N=j,j=null):N=j.sibling;var C=f(p,j,g[_],k);if(C===null){j===null&&(j=N);break}t&&j&&C.alternate===null&&e(p,j),m=i(C,m,_),S===null?E=C:S.sibling=C,S=C,j=N}if(_===g.length)return r(p,j),oe&&dr(p,_),E;if(j===null){for(;__?(N=j,j=null):N=j.sibling;var A=f(p,j,C.value,k);if(A===null){j===null&&(j=N);break}t&&j&&A.alternate===null&&e(p,j),m=i(A,m,_),S===null?E=A:S.sibling=A,S=A,j=N}if(C.done)return r(p,j),oe&&dr(p,_),E;if(j===null){for(;!C.done;_++,C=g.next())C=h(p,C.value,k),C!==null&&(m=i(C,m,_),S===null?E=C:S.sibling=C,S=C);return oe&&dr(p,_),E}for(j=n(p,j);!C.done;_++,C=g.next())C=y(j,p,_,C.value,k),C!==null&&(t&&C.alternate!==null&&j.delete(C.key===null?_:C.key),m=i(C,m,_),S===null?E=C:S.sibling=C,S=C);return t&&j.forEach(function(U){return e(p,U)}),oe&&dr(p,_),E}function b(p,m,g,k){if(typeof g=="object"&&g!==null&&g.type===$r&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ss:e:{for(var E=g.key,S=m;S!==null;){if(S.key===E){if(E=g.type,E===$r){if(S.tag===7){r(p,S.sibling),m=s(S,g.props.children),m.return=p,p=m;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===$t&&gc(E)===S.type){r(p,S.sibling),m=s(S,g.props),m.ref=Tn(p,S,g),m.return=p,p=m;break e}r(p,S);break}else e(p,S);S=S.sibling}g.type===$r?(m=_r(g.props.children,p.mode,k,g.key),m.return=p,p=m):(k=di(g.type,g.key,g.props,null,p.mode,k),k.ref=Tn(p,m,g),k.return=p,p=k)}return a(p);case Fr:e:{for(S=g.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){r(p,m.sibling),m=s(m,g.children||[]),m.return=p,p=m;break e}else{r(p,m);break}else e(p,m);m=m.sibling}m=Ga(g,p.mode,k),m.return=p,p=m}return a(p);case $t:return S=g._init,b(p,m,S(g._payload),k)}if(Rn(g))return w(p,m,g,k);if(_n(g))return x(p,m,g,k);Ls(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(r(p,m.sibling),m=s(m,g),m.return=p,p=m):(r(p,m),m=qa(g,p.mode,k),m.return=p,p=m),a(p)):r(p,m)}return b}var cn=Lh(!0),Dh=Lh(!1),Ci=ir(null),Ai=null,Gr=null,Gl=null;function Jl(){Gl=Gr=Ai=null}function Ql(t){var e=Ci.current;se(Ci),t._currentValue=e}function Bo(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function rn(t,e){Ai=t,Gl=Gr=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Be=!0),t.firstContext=null)}function st(t){var e=t._currentValue;if(Gl!==t)if(t={context:t,memoizedValue:e,next:null},Gr===null){if(Ai===null)throw Error(P(308));Gr=t,Ai.dependencies={lanes:0,firstContext:t}}else Gr=Gr.next=t;return e}var wr=null;function Yl(t){wr===null?wr=[t]:wr.push(t)}function Mh(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,Yl(e)):(r.next=s.next,s.next=r),e.interleaved=r,It(t,n)}function It(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Bt=!1;function Zl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fh(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ot(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Zt(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,J&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,It(t,r)}return s=n.interleaved,s===null?(e.next=e,Yl(n)):(e.next=s.next,s.next=e),n.interleaved=e,It(t,r)}function ii(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Dl(t,r)}}function mc(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?s=i=e:i=i.next=e}else s=i=e;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Oi(t,e,r,n){var s=t.updateQueue;Bt=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?i=c:a.next=c,a=u;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=u))}if(i!==null){var h=s.baseState;a=0,d=c=u=null,o=i;do{var f=o.lane,y=o.eventTime;if((n&f)===f){d!==null&&(d=d.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var w=t,x=o;switch(f=e,y=r,x.tag){case 1:if(w=x.payload,typeof w=="function"){h=w.call(y,h,f);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=x.payload,f=typeof w=="function"?w.call(y,h,f):w,f==null)break e;h=ce({},h,f);break e;case 2:Bt=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[o]:f.push(o))}else y={eventTime:y,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=y,u=h):d=d.next=y,a|=f;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;f=o,o=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(u=h),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Nr|=a,t.lanes=a,t.memoizedState=h}}function yc(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=Ua.transition;Ua.transition={};try{t(!1),e()}finally{Z=r,Ua.transition=n}}function rf(){return it().memoizedState}function km(t,e,r){var n=er(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},nf(t))sf(e,r);else if(r=Mh(t,e,r,n),r!==null){var s=Ie();mt(r,t,n,s),af(r,e,n)}}function _m(t,e,r){var n=er(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(nf(t))sf(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,r);if(s.hasEagerState=!0,s.eagerState=o,yt(o,a)){var u=e.interleaved;u===null?(s.next=s,Yl(e)):(s.next=u.next,u.next=s),e.interleaved=s;return}}catch{}finally{}r=Mh(t,e,s,n),r!==null&&(s=Ie(),mt(r,t,n,s),af(r,e,n))}}function nf(t){var e=t.alternate;return t===ue||e!==null&&e===ue}function sf(t,e){Wn=zi=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function af(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Dl(t,r)}}var Ii={readContext:st,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},Em={readContext:st,useCallback:function(t,e){return xt().memoizedState=[t,e===void 0?null:e],t},useContext:st,useEffect:wc,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,oi(4194308,4,Yh.bind(null,e,t),r)},useLayoutEffect:function(t,e){return oi(4194308,4,t,e)},useInsertionEffect:function(t,e){return oi(4,2,t,e)},useMemo:function(t,e){var r=xt();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=xt();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=km.bind(null,ue,t),[n.memoizedState,t]},useRef:function(t){var e=xt();return t={current:t},e.memoizedState=t},useState:vc,useDebugValue:au,useDeferredValue:function(t){return xt().memoizedState=t},useTransition:function(){var t=vc(!1),e=t[0];return t=bm.bind(null,t[1]),xt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ue,s=xt();if(oe){if(r===void 0)throw Error(P(407));r=r()}else{if(r=e(),be===null)throw Error(P(349));jr&30||Hh(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,wc(Wh.bind(null,n,i,t),[t]),n.flags|=2048,ds(9,Vh.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=xt(),e=be.identifierPrefix;if(oe){var r=At,n=Ct;r=(n&~(1<<32-gt(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=us++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[kt]=e,t[as]=n,mf(t,e,!1,!1),e.stateNode=t;e:{switch(a=_o(r,n),r){case"dialog":ne("cancel",t),ne("close",t),s=n;break;case"iframe":case"object":case"embed":ne("load",t),s=n;break;case"video":case"audio":for(s=0;sfn&&(e.flags|=128,n=!0,Pn(i,!1),e.lanes=4194304)}else{if(!n)if(t=Ri(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Pn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!oe)return Pe(e),null}else 2*fe()-i.renderingStartTime>fn&&r!==1073741824&&(e.flags|=128,n=!0,Pn(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(r=i.last,r!==null?r.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=fe(),e.sibling=null,r=le.current,re(le,n?r&1|2:r&1),e):(Pe(e),null);case 22:case 23:return hu(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?qe&1073741824&&(Pe(e),e.subtreeFlags&6&&(e.flags|=8192)):Pe(e),null;case 24:return null;case 25:return null}throw Error(P(156,e.tag))}function Om(t,e){switch(Kl(e),e.tag){case 1:return He(e.type)&&ji(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return dn(),se(Ue),se(Oe),tu(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return eu(e),null;case 13:if(se(le),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(P(340));un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return se(le),null;case 4:return dn(),null;case 10:return Ql(e.type._context),null;case 22:case 23:return hu(),null;case 24:return null;default:return null}}var Ms=!1,Ce=!1,Rm=typeof WeakSet=="function"?WeakSet:Set,z=null;function Jr(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){de(t,e,n)}else r.current=null}function Qo(t,e,r){try{r()}catch(n){de(t,e,n)}}var Cc=!1;function zm(t,e){if(Ro=ki,t=kh(),Vl(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,o=-1,u=-1,c=0,d=0,h=t,f=null;t:for(;;){for(var y;h!==r||s!==0&&h.nodeType!==3||(o=a+s),h!==i||n!==0&&h.nodeType!==3||(u=a+n),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)f=h,h=y;for(;;){if(h===t)break t;if(f===r&&++c===s&&(o=a),f===i&&++d===n&&(u=a),(y=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=y}r=o===-1||u===-1?null:{start:o,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(zo={focusedElem:t,selectionRange:r},ki=!1,z=e;z!==null;)if(e=z,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,z=t;else for(;z!==null;){e=z;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var x=w.memoizedProps,b=w.memoizedState,p=e.stateNode,m=p.getSnapshotBeforeUpdate(e.elementType===e.type?x:ut(e.type,x),b);p.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(k){de(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,z=t;break}z=e.return}return w=Cc,Cc=!1,w}function Kn(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Qo(e,r,i)}s=s.next}while(s!==n)}}function la(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Yo(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function wf(t){var e=t.alternate;e!==null&&(t.alternate=null,wf(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[kt],delete e[as],delete e[Do],delete e[mm],delete e[ym])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function xf(t){return t.tag===5||t.tag===3||t.tag===4}function Ac(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zo(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Si));else if(n!==4&&(t=t.child,t!==null))for(Zo(t,e,r),t=t.sibling;t!==null;)Zo(t,e,r),t=t.sibling}function Xo(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Xo(t,e,r),t=t.sibling;t!==null;)Xo(t,e,r),t=t.sibling}var Ee=null,dt=!1;function Ft(t,e,r){for(r=r.child;r!==null;)bf(t,e,r),r=r.sibling}function bf(t,e,r){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(ea,r)}catch{}switch(r.tag){case 5:Ce||Jr(r,e);case 6:var n=Ee,s=dt;Ee=null,Ft(t,e,r),Ee=n,dt=s,Ee!==null&&(dt?(t=Ee,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ee.removeChild(r.stateNode));break;case 18:Ee!==null&&(dt?(t=Ee,r=r.stateNode,t.nodeType===8?Fa(t.parentNode,r):t.nodeType===1&&Fa(t,r),ts(t)):Fa(Ee,r.stateNode));break;case 4:n=Ee,s=dt,Ee=r.stateNode.containerInfo,dt=!0,Ft(t,e,r),Ee=n,dt=s;break;case 0:case 11:case 14:case 15:if(!Ce&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Qo(r,e,a),s=s.next}while(s!==n)}Ft(t,e,r);break;case 1:if(!Ce&&(Jr(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){de(r,e,o)}Ft(t,e,r);break;case 21:Ft(t,e,r);break;case 22:r.mode&1?(Ce=(n=Ce)||r.memoizedState!==null,Ft(t,e,r),Ce=n):Ft(t,e,r);break;default:Ft(t,e,r)}}function Oc(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Rm),e.forEach(function(n){var s=Hm.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function ot(t,e){var r=e.deletions;if(r!==null)for(var n=0;ns&&(s=a),n&=~i}if(n=s,n=fe()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Lm(n/1960))-n,10t?16:t,qt===null)var n=!1;else{if(t=qt,qt=null,Mi=0,J&6)throw Error(P(331));var s=J;for(J|=4,z=t.current;z!==null;){var i=z,a=i.child;if(z.flags&16){var o=i.deletions;if(o!==null){for(var u=0;ufe()-cu?kr(t,0):uu|=r),Ve(t,e)}function Pf(t,e){e===0&&(t.mode&1?(e=Ps,Ps<<=1,!(Ps&130023424)&&(Ps=4194304)):e=1);var r=Ie();t=It(t,e),t!==null&&(ys(t,e,r),Ve(t,r))}function Um(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Pf(t,r)}function Hm(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,s=t.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(P(314))}n!==null&&n.delete(e),Pf(t,r)}var Cf;Cf=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ue.current)Be=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Be=!1,Cm(t,e,r);Be=!!(t.flags&131072)}else Be=!1,oe&&e.flags&1048576&&Rh(e,Pi,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;li(t,e),t=e.pendingProps;var s=ln(e,Oe.current);rn(e,r),s=nu(null,e,n,t,s,r);var i=su();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,He(n)?(i=!0,Ni(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Zl(e),s.updater=oa,e.stateNode=s,s._reactInternals=e,Ho(e,n,t,r),e=Ko(null,e,n,!0,i,r)):(e.tag=0,oe&&i&&Wl(e),ze(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(li(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=Wm(n),t=ut(n,t),s){case 0:e=Wo(null,e,n,t,r);break e;case 1:e=Nc(null,e,n,t,r);break e;case 11:e=Sc(null,e,n,t,r);break e;case 14:e=jc(null,e,n,ut(n.type,t),r);break e}throw Error(P(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:ut(n,s),Wo(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:ut(n,s),Nc(t,e,n,s,r);case 3:e:{if(ff(e),t===null)throw Error(P(387));n=e.pendingProps,i=e.memoizedState,s=i.element,Fh(t,e),Oi(e,n,null,r);var a=e.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=hn(Error(P(423)),e),e=Tc(t,e,n,r,s);break e}else if(n!==s){s=hn(Error(P(424)),e),e=Tc(t,e,n,r,s);break e}else for(Je=Yt(e.stateNode.containerInfo.firstChild),Qe=e,oe=!0,ft=null,r=Dh(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(un(),n===s){e=Lt(t,e,r);break e}ze(t,e,n,r)}e=e.child}return e;case 5:return $h(e),t===null&&$o(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,Io(n,s)?a=null:i!==null&&Io(n,i)&&(e.flags|=32),hf(t,e),ze(t,e,a,r),e.child;case 6:return t===null&&$o(e),null;case 13:return pf(t,e,r);case 4:return Xl(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=cn(e,null,n,r):ze(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:ut(n,s),Sc(t,e,n,s,r);case 7:return ze(t,e,e.pendingProps,r),e.child;case 8:return ze(t,e,e.pendingProps.children,r),e.child;case 12:return ze(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,re(Ci,n._currentValue),n._currentValue=a,i!==null)if(yt(i.value,a)){if(i.children===s.children&&!Ue.current){e=Lt(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var u=o.firstContext;u!==null;){if(u.context===n){if(i.tag===1){u=Ot(-1,r&-r),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=r,u=i.alternate,u!==null&&(u.lanes|=r),Bo(i.return,r,e),o.lanes|=r;break}u=u.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(P(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),Bo(a,r,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}ze(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,rn(e,r),s=st(s),n=n(s),e.flags|=1,ze(t,e,n,r),e.child;case 14:return n=e.type,s=ut(n,e.pendingProps),s=ut(n.type,s),jc(t,e,n,s,r);case 15:return cf(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:ut(n,s),li(t,e),e.tag=1,He(n)?(t=!0,Ni(e)):t=!1,rn(e,r),of(e,n,s),Ho(e,n,s,r),Ko(null,e,n,!0,t,r);case 19:return gf(t,e,r);case 22:return df(t,e,r)}throw Error(P(156,e.tag))};function Af(t,e){return nh(t,e)}function Vm(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rt(t,e,r,n){return new Vm(t,e,r,n)}function pu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Wm(t){if(typeof t=="function")return pu(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Rl)return 11;if(t===zl)return 14}return 2}function tr(t,e){var r=t.alternate;return r===null?(r=rt(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function di(t,e,r,n,s,i){var a=2;if(n=t,typeof t=="function")pu(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case $r:return _r(r.children,s,i,e);case Ol:a=8,s|=8;break;case fo:return t=rt(12,r,e,s|2),t.elementType=fo,t.lanes=i,t;case po:return t=rt(13,r,e,s),t.elementType=po,t.lanes=i,t;case go:return t=rt(19,r,e,s),t.elementType=go,t.lanes=i,t;case $d:return ca(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Md:a=10;break e;case Fd:a=9;break e;case Rl:a=11;break e;case zl:a=14;break e;case $t:a=16,n=null;break e}throw Error(P(130,t==null?t:typeof t,""))}return e=rt(a,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function _r(t,e,r,n){return t=rt(7,t,n,e),t.lanes=r,t}function ca(t,e,r,n){return t=rt(22,t,n,e),t.elementType=$d,t.lanes=r,t.stateNode={isHidden:!1},t}function qa(t,e,r){return t=rt(6,t,null,e),t.lanes=r,t}function Ga(t,e,r){return e=rt(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Km(t,e,r,n,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ta(0),this.expirationTimes=Ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function gu(t,e,r,n,s,i,a,o,u){return t=new Km(t,e,r,o,u),e===1?(e=1,i===!0&&(e|=8)):e=0,i=rt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zl(i),t}function qm(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(If)}catch(t){console.error(t)}}If(),zd.exports=Ze;var Zm=zd.exports,$c=Zm;co.createRoot=$c.createRoot,co.hydrateRoot=$c.hydrateRoot;var Xm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ey=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ty=(t,e)=>{const r=T.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:a,children:o,...u},c)=>T.createElement("svg",{ref:c,...Xm,width:s,height:s,stroke:n,strokeWidth:a?Number(i)*24/Number(s):i,className:`lucide lucide-${ey(t)}`,...u},[...e.map(([d,h])=>T.createElement(d,h)),...(Array.isArray(o)?o:[o])||[]]));return r.displayName=`${t}`,r};var Q=ty;const Lf=Q("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),ry=Q("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ny=Q("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Bi=Q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),sy=Q("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),iy=Q("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),ay=Q("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),Bc=Q("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]),sl=Q("CheckCircle2",[["path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",key:"14v8dr"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Ja=Q("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),Df=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),oy=Q("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),ly=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),uy=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),cy=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),Mf=Q("FileDown",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]),dy=Q("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),hy=Q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),fy=Q("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),py=Q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),gy=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),my=Q("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]),yy=Q("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ff=Q("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",key:"3xmgem"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),vy=Q("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),$f=Q("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),wy=Q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Bf=Q("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),xy=Q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Uf=Q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),by=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ky=Q("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),_y=["M","D","M","D","F","S","S"],il=t=>{const e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}-${r}-${n}`},Ey=t=>{if(!t||!t.includes("-"))return null;const[e,r,n]=t.split("-").map(Number);return new Date(e,r-1,n)},Sy=t=>{const e=new Date(t.getFullYear(),t.getMonth(),1),r=(e.getDay()+6)%7,n=new Date(e.getFullYear(),e.getMonth(),1-r);return Array.from({length:42},(s,i)=>{const a=new Date(n.getFullYear(),n.getMonth(),n.getDate()+i);return{key:il(a),date:a,isoValue:il(a),isCurrentMonth:a.getMonth()===t.getMonth()}})},jy=({patTypes:t,assessments:e,overview:r,assessmentShareTokens:n={},testsVisible:s=!0,onCreate:i,onEdit:a,onDelete:o,getPatTypeColor:u,getAchievement:c})=>{const d=T.useRef(null),[h,f]=T.useState(!1),[y,w]=T.useState(null),[x,b]=T.useState({key:"datum",direction:"desc"}),[p,m]=T.useState({name:"",datum:""}),[g,k]=T.useState(()=>{const L=new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),E=Object.keys(t||{}),S=e.filter(L=>!L.isFinalized),j=e.filter(L=>L.isFinalized),_=L=>L.exercises.reduce((O,K)=>O+(K.points||0),0),N=L=>String(L||"").toLowerCase().trim(),C=L=>{if(!L||!L.includes("-"))return"";const[O,K,ee]=L.split("-");return`${ee}.${K}.${O}`},A=L=>{if(!L||!L.includes("-"))return L||"";const[O,K,ee]=L.split("-");return`${O}.${K}.${ee}`},U=T.useMemo(()=>new Intl.DateTimeFormat("de-DE",{month:"long",year:"numeric"}).format(g),[g]),Y=T.useMemo(()=>Sy(g),[g]);T.useEffect(()=>{if(!y)return;const L=K=>{d.current&&!d.current.contains(K.target)&&w(null)},O=K=>{K.key==="Escape"&&w(null)};return document.addEventListener("mousedown",L),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",O)}},[y]);const G=L=>{const O=!p.name||N(L.name).includes(N(p.name)),K=!p.datum||N(L.datum).includes(N(p.datum));return O&&K},ye=(L,O)=>O==="name"?(L.name||"").toLowerCase():O==="datum"?L.datum||"":O==="result"?_(L):"",he=L=>[...L].sort((O,K)=>{const ee=ye(O,x.key),Ke=ye(K,x.key);return eeKe?x.direction==="asc"?1:-1:0}),Re=T.useMemo(()=>he(S.filter(G)),[S,x,p]),R=T.useMemo(()=>he(j.filter(G)),[j,x,p]),M=L=>{b(O=>O.key===L?{key:L,direction:O.direction==="asc"?"desc":"asc"}:{key:L,direction:L==="datum"?"desc":"asc"})},H=L=>x.key!==L?l.jsx(sy,{className:"w-4 h-4 text-gray-400 dark:text-gray-500","aria-hidden":"true"}):x.direction==="asc"?l.jsx(uy,{className:"w-4 h-4","aria-hidden":"true"}):l.jsx(Df,{className:"w-4 h-4","aria-hidden":"true"}),X=(L,O)=>{m(K=>({...K,[L]:O}))},ie=L=>{const K=Ey(L)||new Date;k(new Date(K.getFullYear(),K.getMonth(),1))},St=L=>{w(O=>O!==L?(ie(p.datum),L):null)},We=L=>{X("datum",L),ie(L),w(null)},lr=()=>{X("datum",""),ie(""),w(null)},at=()=>{We(il(new Date))},jt=(L,O,K,ee,Ke)=>{const vt=y===L;return l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg border border-gray-100 dark:border-gray-800 overflow-hidden",children:[l.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800/70",children:[l.jsx("h2",{className:"text-lg font-bold text-gray-800 dark:text-gray-100",children:O}),l.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:["Anzahl: ",K.length,K.length!==ee?` von ${ee}`:""]})]}),ee===0?l.jsx("div",{className:"px-6 py-8 text-sm text-gray-500 dark:text-gray-400",children:Ke}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800 text-left",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-3 text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{type:"button",onClick:()=>M("name"),className:"inline-flex items-center gap-2 hover:text-gray-900 dark:hover:text-white transition",children:["Name",H("name")]}),l.jsx("input",{type:"text",value:p.name,onChange:q=>X("name",q.target.value),"aria-label":"Nach Name filtern",className:"w-40 rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-950 px-3 py-2 text-sm font-normal text-gray-700 dark:text-gray-200"})]})}),l.jsx("th",{className:"px-6 py-3 text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{type:"button",onClick:()=>M("datum"),className:"inline-flex items-center gap-2 hover:text-gray-900 dark:hover:text-white transition",children:["Datum",H("datum")]}),l.jsxs("div",{ref:vt?d:null,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>St(L),"aria-label":"Nach Datum filtern","aria-expanded":vt,className:"flex w-36 items-center justify-between rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-950 px-3 py-2 text-left text-sm font-normal text-gray-700 dark:text-gray-200",children:[l.jsx("span",{children:C(p.datum)||"tt.mm.jjjj"}),l.jsx(Bc,{className:"h-4 w-4 text-gray-500 dark:text-gray-400","aria-hidden":"true"})]}),vt&&l.jsxs("div",{className:"absolute left-0 top-full z-20 mt-2 w-80 rounded-xl border border-gray-200 bg-white p-3 shadow-2xl dark:border-gray-700 dark:bg-gray-900",children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[l.jsx("button",{type:"button",onClick:()=>k(q=>new Date(q.getFullYear(),q.getMonth()-1,1)),className:"rounded-lg p-2 text-gray-500 transition hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white","aria-label":"Vorheriger Monat",children:l.jsx(oy,{className:"h-4 w-4","aria-hidden":"true"})}),l.jsx("span",{className:"text-sm font-semibold capitalize text-gray-800 dark:text-gray-100",children:U}),l.jsx("button",{type:"button",onClick:()=>k(q=>new Date(q.getFullYear(),q.getMonth()+1,1)),className:"rounded-lg p-2 text-gray-500 transition hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white","aria-label":"Nächster Monat",children:l.jsx(ly,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:_y.map((q,_s)=>l.jsx("span",{children:q},`${q}-${_s}`))}),l.jsx("div",{className:"mt-2 grid grid-cols-7 gap-1",children:Y.map(q=>{const _s=q.isoValue===p.datum;return l.jsx("button",{type:"button",onClick:()=>We(q.isoValue),className:`flex h-10 items-center justify-center rounded-lg text-sm transition ${_s?"bg-indigo-600 text-white":q.isCurrentMonth?"text-gray-800 hover:bg-gray-100 dark:text-gray-100 dark:hover:bg-gray-800":"text-gray-400 hover:bg-gray-100 dark:text-gray-600 dark:hover:bg-gray-800"}`,children:q.date.getDate()},q.key)})}),l.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-gray-200 pt-3 dark:border-gray-700",children:[l.jsx("button",{type:"button",onClick:at,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:"Heute"}),l.jsx("button",{type:"button",onClick:lr,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:"Löschen"})]})]})]})]})}),l.jsx("th",{className:"px-6 py-3 text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("button",{type:"button",onClick:()=>M("result"),className:"inline-flex items-center gap-2 hover:text-gray-900 dark:hover:text-white transition",children:["Ergebnis",H("result")]})})}),l.jsx("th",{className:"px-6 py-3 text-sm font-semibold text-gray-700 dark:text-gray-200 text-right"})]})}),l.jsx("tbody",{children:K.length===0?l.jsx("tr",{className:"border-t border-gray-200 dark:border-gray-800",children:l.jsx("td",{colSpan:"4",className:"px-6 py-8 text-sm text-gray-500 dark:text-gray-400",children:Ke})}):K.map(q=>{const Ep=!!n[q.id],Au=_(q),ka=c(q.patType,Au);return l.jsxs("tr",{className:"border-t border-gray-200 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/40",children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:q.name}),l.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-semibold ${u(q.patType)}`,children:q.patType}),Ep&&l.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-semibold ${s?"bg-sky-100 text-sky-800 dark:bg-sky-900/40 dark:text-sky-200":"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200"}`,children:s?"Freigabe aktiv":"Freigabe pausiert"}),q.isFinalized&&l.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-200",children:"Final abgeschlossen"})]})}),l.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-300 whitespace-nowrap",children:l.jsxs("div",{className:"inline-flex items-center gap-2",children:[l.jsx(Bc,{className:"w-4 h-4","aria-hidden":"true"}),A(q.datum)]})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xl font-bold text-green-600 dark:text-green-300",children:Au.toFixed(0)}),l.jsx("span",{className:`inline-flex px-2 py-1 rounded text-xs font-semibold ${ka.color} ${ka.text}`,children:ka.name})]})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx("button",{onClick:()=>a(q),className:"bg-indigo-600 text-white px-4 py-2 rounded hover:bg-indigo-700 transition text-sm",children:"Öffnen"}),l.jsx("button",{onClick:Sp=>{Sp.stopPropagation(),o(q.id)},className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 p-2",title:"Löschen",children:l.jsx(xy,{className:"w-5 h-5","aria-hidden":"true"})})]})})]},q.id)})})]})})]})};return l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-green-50 to-blue-100 dark:from-gray-950 dark:to-gray-900 p-6 text-gray-900 dark:text-gray-100",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 mb-6 border border-gray-100 dark:border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-gray-100",children:"PAT Test Manager"}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>f(L=>!L),className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition flex items-center justify-center gap-2",children:[l.jsx(gy,{className:"w-4 h-4"}),"Neue Bewertung"]}),h&&l.jsx("div",{className:"absolute right-0 top-full mt-2 w-48 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-lg z-10 overflow-hidden",children:E.map(L=>l.jsx("button",{type:"button",onClick:()=>{f(!1),i(L)},className:"w-full px-4 py-3 text-left text-sm font-medium text-gray-800 dark:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-800 transition",children:L},L))})]})]})}),r&&l.jsx("div",{className:"mt-6",children:r}),e.length>0&&l.jsxs("div",{className:"space-y-6",children:[jt("open","Noch offene Bewertungen",Re,S.length,"Keine offenen Bewertungen mit den aktuellen Suchfiltern gefunden"),jt("finalized","Abgeschlossene Bewertungen",R,j.length,"Keine abgeschlossenen Bewertungen mit den aktuellen Suchfiltern gefunden")]}),e.length===0&&l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-12 text-center border border-gray-100 dark:border-gray-800",children:[l.jsx(by,{className:"w-16 h-16 mx-auto mb-4 text-gray-300 dark:text-gray-700","aria-hidden":"true"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-4",children:"Noch keine Bewertungen vorhanden"}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Lege oben eine neue Bewertung an und wähle dabei PAT Start, PAT 1, PAT 2 oder PAT 3"})]})]})})},Ny=t=>String(t||"").replace(/\D/g,""),Ty=(t,e=null)=>{var r;return e&&((r=t==null?void 0:t.subValueRanges)!=null&&r[e])?t.subValueRanges[e]:{minValue:t==null?void 0:t.minValue,maxValue:t==null?void 0:t.maxValue}},Hf=(t,e,r=null)=>{const n=Ny(e);if(!n)return"";const s=Number.parseInt(n,10),i=Ty(t,r),a=Number.isFinite(i==null?void 0:i.minValue)?i.minValue:0,o=Number.isFinite(i==null?void 0:i.maxValue)?i.maxValue:null,u=o===null?Math.max(s,a):Math.min(Math.max(s,a),o);return String(u)},Qa=t=>`px-3 py-2 border border-gray-300 dark:border-gray-700 rounded text-center bg-white dark:bg-gray-900 ${t?"opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-800":""}`,Py=({exercise:t,exIndex:e,onChange:r,disabled:n=!1})=>{const s=(a,o=null)=>u=>{r(e,a,Hf(t,u.target.value,o),o)};if(t.subA&&t.subB){const[a="a)",o="b)"]=t.subLabels||[];return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-5 gap-2 mb-2",children:[l.jsx("div",{}),l.jsx("div",{className:"font-semibold",children:a}),t.subA.map((u,c)=>l.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off",value:u,onChange:s(c,"a"),disabled:n,className:Qa(n)},`a-${c}`))]}),l.jsxs("div",{className:"grid grid-cols-5 gap-2 mb-2",children:[l.jsx("div",{}),l.jsx("div",{className:"font-semibold",children:o}),t.subB.map((u,c)=>l.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off",value:u,onChange:s(c,"b"),disabled:n,className:Qa(n)},`b-${c}`))]})]})}const i=t.values.length===4?"grid-cols-6":t.values.length===5?"grid-cols-7":"grid-cols-5";return l.jsxs("div",{className:`grid ${i} gap-2 mb-2`,children:[l.jsx("div",{}),l.jsx("div",{}),t.values.map((a,o)=>l.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"off",value:a,onChange:s(o),disabled:n,className:Qa(n)},o))]})},Cy=({show:t,onSave:e,onDiscard:r,onCancel:n})=>t?l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-xl p-6 max-w-md w-full mx-4 border border-gray-200 dark:border-gray-800",children:[l.jsx("h3",{className:"text-xl font-bold text-gray-800 dark:text-gray-100 mb-4",children:"Ungespeicherte Änderungen"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"Sie haben ungespeicherte Änderungen. Möchten Sie diese speichern?"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:e,className:"flex-1 bg-green-600 text-white px-4 py-3 rounded-lg hover:bg-green-700 transition font-semibold",children:"Ja, speichern"}),l.jsx("button",{onClick:r,className:"flex-1 bg-red-600 text-white px-4 py-3 rounded-lg hover:bg-red-700 transition font-semibold",children:"Nein, verwerfen"}),l.jsx("button",{onClick:n,className:"flex-1 bg-gray-500 dark:bg-gray-700 text-white px-4 py-3 rounded-lg hover:bg-gray-600 dark:hover:bg-gray-600 transition font-semibold",children:"Abbrechen"})]})]})}):null,Ay="modulepreload",Oy=function(t){return"/"+t},Uc={},Hc=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(r.map(u=>{if(u=Oy(u),u in Uc)return;Uc[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Ay,c||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),c)return new Promise((f,y)=>{h.addEventListener("load",f),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return e().catch(i)})},Se=14,Ry=12,hi=22,pt=210-Se*2,zy=Se+10,Ya=10.5,Vc=3,Vf=t=>{if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}).format(e)},Za=t=>(t||"pat-test").toLowerCase().replace(/[^a-z0-9-_]+/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Jn=t=>t===""||t===null||typeof t>"u"?"—":String(t),Xa=(t,e=26)=>{const r=String(t||"—");return r.length>e?`${r.slice(0,e-1)}…`:r},Wc="Versuch",Iy=t=>18+(!!(t.subA&&t.subB)?30:21)+21,Ly=t=>{var i;if(t.subA&&t.subB){const a=Math.max(t.subA.length,t.subB.length),o=[Wc,...Array.from({length:a},(d,h)=>`${h+1}`)],u=32,c=(pt-u)/a;return{head:[o],body:[["a.)",...Array.from({length:a},(d,h)=>Jn(t.subA[h]))],["b.)",...Array.from({length:a},(d,h)=>Jn(t.subB[h]))]],columnStyles:{0:{cellWidth:u,halign:"center"},...Object.fromEntries(Array.from({length:a},(d,h)=>[h+1,{cellWidth:c,halign:"center"}]))}}}const e=((i=t.values)==null?void 0:i.length)||0,r=[Wc,...Array.from({length:e},(a,o)=>`${o+1}`)],n=32,s=e>0?(pt-n)/e:pt-n;return{head:[r],body:[["Ist",...(t.values||[]).map(Jn)]],columnStyles:{0:{cellWidth:n,halign:"center"},...Object.fromEntries(Array.from({length:e},(a,o)=>[o+1,{cellWidth:s,halign:"center"}]))}}},Dy=t=>({head:[["Soll","Durchschnitt ist","Faktor","Punkte"]],body:[[Jn(t.soll),(t.durchschnitt||0).toFixed(2),Jn(t.faktor),(t.points||0).toFixed(0)]],columnStyles:{0:{cellWidth:pt/4,halign:"center"},1:{cellWidth:pt/4,halign:"center"},2:{cellWidth:pt/4,halign:"center"},3:{cellWidth:pt/4,halign:"center"}}}),My=({assessment:t,totalPoints:e,achievement:r})=>({head:[["Name","PAT Typ","Datum","Gesamtpunkte","Bewertung"]],body:[[t.name||"—",t.patType||"—",Vf(t.datum),String(Math.round(e||0)),(r==null?void 0:r.name)||"—"]],columnStyles:{0:{cellWidth:42},1:{cellWidth:28},2:{cellWidth:34},3:{cellWidth:34,halign:"center"},4:{cellWidth:44}}}),Fy=({assessment:t,achievement:e,pageNumber:r,pageCount:n})=>[`Name: ${Xa(t==null?void 0:t.name,20)}`,`PAT Typ: ${Xa(t==null?void 0:t.patType,14)}`,`Datum: ${Vf(t==null?void 0:t.datum)}`,`Bewertung: ${Xa(e==null?void 0:e.name,18)}`,`Seite ${r}/${n}`],$y=(t,e,r)=>{const n=t.internal.pageSize.getHeight();return e+r<=n-hi?e:(t.addPage(),zy)},By=(t,{assessment:e,achievement:r})=>{const n=t.getNumberOfPages(),s=t.internal.pageSize.getHeight(),i=t.internal.pageSize.getWidth(),a=s-8,o=[Se,Se+47,Se+88,Se+130,i-Se];for(let u=1;u<=n;u+=1){const[c,d,h,f,y]=Fy({assessment:e,achievement:r,pageNumber:u,pageCount:n});t.setPage(u),t.setDrawColor(226,232,240),t.setLineWidth(.3),t.line(Se,a-4,i-Se,a-4),t.setFont("helvetica","normal"),t.setFontSize(8.5),t.setTextColor(100,116,139),t.text(c,o[0],a),t.text(d,o[1],a),t.text(h,o[2],a),t.text(f,o[3],a),t.text(y,o[4],a,{align:"right"})}},Uy=async({assessment:t,totalPoints:e,achievement:r})=>{if(!t)return;const[{jsPDF:n},{default:s}]=await Promise.all([Hc(()=>import("./jspdf.es.min-CLjTnO_I.js").then(o=>o.j),[]),Hc(()=>import("./jspdf.plugin.autotable-CyVc7Jkq.js"),[])]),i=new n({unit:"mm",format:"a4"});i.setFillColor(16,185,129),i.roundedRect(Se,Ry,pt,18,4,4,"F"),i.setFont("helvetica","bold"),i.setFontSize(20),i.setTextColor(255,255,255),i.text("PAT Test Details",20,24),s(i,{startY:38,margin:{left:Se,right:Se,bottom:hi},theme:"grid",styles:{font:"helvetica",fontSize:Ya,cellPadding:4,textColor:[31,41,55],lineColor:[226,232,240],lineWidth:.3},headStyles:{fillColor:[241,245,249],textColor:[71,85,105],fontStyle:"bold"},bodyStyles:{fillColor:[255,255,255]},tableWidth:pt,...My({assessment:t,totalPoints:e,achievement:r})}),(t.exercises||[]).forEach((o,u)=>{var d,h;const c=$y(i,(((d=i.lastAutoTable)==null?void 0:d.finalY)||38)+8,Iy(o));i.setFont("helvetica","bold"),i.setFontSize(14),i.setTextColor(17,24,39),i.text(o.name||`Übung ${u+1}`,Se,c),s(i,{startY:c+4,margin:{left:Se,right:Se,bottom:hi},theme:"grid",styles:{font:"helvetica",fontSize:Ya,cellPadding:Vc,halign:"center",textColor:[31,41,55],lineColor:[226,232,240],lineWidth:.3},headStyles:{fillColor:[239,246,255],textColor:[30,64,175],fontStyle:"bold",halign:"center"},bodyStyles:{fillColor:[255,255,255],halign:"center"},tableWidth:pt,pageBreak:"avoid",rowPageBreak:"avoid",...Ly(o)}),s(i,{startY:(((h=i.lastAutoTable)==null?void 0:h.finalY)||c+4)+3,margin:{left:Se,right:Se,bottom:hi},theme:"grid",styles:{font:"helvetica",fontSize:Ya,cellPadding:Vc,textColor:[31,41,55],lineColor:[226,232,240],lineWidth:.3},headStyles:{fillColor:[236,253,245],textColor:[6,95,70],fontStyle:"bold"},bodyStyles:{fillColor:[255,255,255],halign:"center"},didParseCell:({section:f,column:y,cell:w})=>{f==="body"&&y.index===3&&(w.styles.fillColor=[241,245,249])},tableWidth:pt,pageBreak:"avoid",rowPageBreak:"avoid",...Dy(o)})});const a=[Za(t.name),Za(t.patType),Za(t.datum)].filter(Boolean).join("_");By(i,{assessment:t,achievement:r}),i.save(`${a||"pat-test"}.pdf`)},Hy=({currentAssessment:t,hasUnsavedChanges:e,onBack:r,onSave:n,onAssessmentChange:s,onUpdateExercise:i,onMarkDirty:a,showSaveDialog:o,onSaveAndExit:u,onDiscardAndExit:c,onCancelExit:d,getPatTypeColor:h,getAchievement:f,calculateTotal:y,isReadOnly:w=!1,canFinalize:x=!1,finalizeDisabledReason:b="",onFinalize:p,isShareActive:m=!1,testsVisible:g=!0,canShare:k=!1,shareDisabledReason:E="",onShare:S,onRevokeShare:j})=>{if(!t)return null;const _=y(),N=f(t==null?void 0:t.patType,_),C=async()=>{await Uy({assessment:t,totalPoints:_,achievement:N})};return l.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-950 p-6 text-gray-900 dark:text-gray-100",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsx(Cy,{show:o,onSave:u,onDiscard:c,onCancel:d}),l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 border border-gray-200 dark:border-gray-800",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("button",{onClick:r,className:"text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 font-medium",children:"← Zurück zur Übersicht"}),e&&l.jsx("span",{className:"text-orange-500 dark:text-orange-300 text-sm font-semibold",children:"● Ungespeicherte Änderungen"}),l.jsx("span",{className:`px-4 py-2 rounded-full text-sm font-semibold ${h(t==null?void 0:t.patType)}`,children:t==null?void 0:t.patType}),m&&l.jsx("span",{className:`px-4 py-2 rounded-full text-sm font-semibold ${g?"bg-sky-100 text-sky-800 dark:bg-sky-900/40 dark:text-sky-200":"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200"}`,children:g?"Freigabe aktiv":"Freigabe pausiert"}),(t==null?void 0:t.isFinalized)&&l.jsx("span",{className:"px-4 py-2 rounded-full text-sm font-semibold bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-200",children:"Final abgeschlossen"})]}),l.jsxs("div",{className:"flex gap-2",children:[!w&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:n,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition flex items-center gap-2 text-sm",children:[l.jsx(my,{className:"w-4 h-4","aria-hidden":"true"}),"Speichern"]}),l.jsxs("button",{onClick:p,disabled:!x,title:b||"Test final abschließen",className:`px-4 py-2 rounded-lg transition flex items-center gap-2 text-sm ${x?"bg-emerald-700 text-white hover:bg-emerald-800":"bg-gray-300 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed"}`,children:[l.jsx(sl,{className:"w-4 h-4","aria-hidden":"true"}),"Final Abschließen"]})]}),l.jsxs("button",{onClick:C,className:"bg-amber-600 text-white px-4 py-2 rounded-lg hover:bg-amber-700 transition flex items-center gap-2 text-sm",children:[l.jsx(Mf,{className:"w-4 h-4","aria-hidden":"true"}),"PDF"]}),l.jsxs("button",{onClick:S,disabled:!k,title:E||"Test als Link teilen",className:`px-4 py-2 rounded-lg transition flex items-center gap-2 text-sm ${k?"bg-sky-600 text-white hover:bg-sky-700":"bg-gray-300 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed"}`,children:[l.jsx(yy,{className:"w-4 h-4","aria-hidden":"true"}),"Teilen"]}),m&&l.jsx("button",{onClick:j,className:"border border-rose-300 text-rose-700 dark:border-rose-700 dark:text-rose-300 px-4 py-2 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-950/40 transition text-sm",children:"Freigabe aufheben"})]})]}),w&&l.jsxs("div",{className:"mb-6 rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-3 text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/40 dark:text-emerald-200",children:[l.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[l.jsx(hy,{className:"h-4 w-4","aria-hidden":"true"}),"Nur Lese-Modus"]}),l.jsx("p",{className:"mt-1 text-sm",children:"Diese Bewertung wurde final abgeschlossen und kann nicht mehr bearbeitet werden."})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-6 bg-gray-50 dark:bg-gray-800 p-4 rounded",children:[l.jsx("div",{className:"font-bold",children:"Datum / Name"}),l.jsx("div",{}),l.jsx("input",{type:"date",value:(t==null?void 0:t.datum)||"",disabled:w,onChange:A=>{s({...t,datum:A.target.value}),a()},className:`px-3 py-2 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-900 ${w?"opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-800":""}`}),l.jsx("input",{type:"text",value:(t==null?void 0:t.name)||"",disabled:w,onChange:A=>{s({...t,name:A.target.value}),a()},placeholder:"Name",className:`px-3 py-2 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-900 ${w?"opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-800":""}`})]}),t==null?void 0:t.exercises.map((A,U)=>l.jsxs("div",{className:"mb-6 border-b pb-4 border-gray-200 dark:border-gray-800",children:[l.jsx("div",{className:"font-bold text-lg mb-2 text-gray-700 dark:text-gray-200",children:A.name}),l.jsx(Py,{exercise:A,exIndex:U,onChange:i,disabled:w}),l.jsxs("div",{className:"grid grid-cols-5 gap-2 mb-1 bg-blue-50 dark:bg-blue-900/30 p-2 rounded",children:[l.jsxs("div",{className:"font-semibold",children:["Durchschnitt Soll ",A.soll]}),l.jsx("div",{className:"font-semibold",children:"Ist"}),l.jsx("div",{className:"font-bold text-center",children:A.durchschnitt.toFixed(2)})]}),l.jsxs("div",{className:"grid grid-cols-5 gap-2 mb-1",children:[l.jsx("div",{children:"Faktor"}),l.jsx("div",{}),l.jsx("div",{className:"text-center font-semibold",children:A.faktor})]}),l.jsxs("div",{className:"grid grid-cols-5 gap-2 bg-green-50 dark:bg-green-900/30 p-2 rounded",children:[l.jsx("div",{className:"font-bold",children:"Points"}),l.jsx("div",{}),l.jsx("div",{className:"text-center font-bold text-green-600 dark:text-green-300",children:A.points.toFixed(0)})]})]},U)),l.jsxs("div",{className:"mt-6 bg-gradient-to-r from-green-100 to-blue-100 dark:from-gray-800 dark:to-gray-700 p-6 rounded-lg",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("span",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:"Ergebnis"}),l.jsx("span",{className:"text-4xl font-bold text-green-600 dark:text-green-300",children:_.toFixed(0)})]}),l.jsxs("div",{className:`mt-4 px-6 py-4 rounded-lg ${N.color} ${N.text} text-center`,children:[l.jsx("p",{className:"text-2xl font-bold",children:N.name}),N.subtitle&&l.jsx("p",{className:"text-lg mt-2",children:N.subtitle})]})]})]})]})})},Wf=t=>{let e=0,r=0;t.subA&&t.subB?[...t.subA,...t.subB].forEach(i=>{const a=parseFloat(i);isNaN(a)||(e+=a,r++)}):t.values.forEach(i=>{const a=parseFloat(i);isNaN(a)||(e+=a,r++)});const n=r>0?e/r:0,s=n*t.faktor;return{durchschnitt:n,points:s}},ga=(t=[])=>t.reduce((e,r)=>e+(r.points||0),0),al=t=>({"PAT Start":"bg-green-100 text-green-800","PAT 1":"bg-blue-100 text-blue-800","PAT 2":"bg-purple-100 text-purple-800","PAT 3":"bg-orange-100 text-orange-800"})[t]||"bg-gray-100 text-gray-800",ol=(t,e)=>{const r={"PAT Start":[{min:1e3,color:"bg-yellow-400",text:"text-black",name:"2. Schwarz-Weiss Sport WPA",subtitle:"Freizeit-Spieler"},{min:800,color:"bg-white",text:"text-black",name:"1. Weiss",subtitle:""},{min:600,color:"bg-gray-200",text:"text-gray-800",name:"PAT Start Teilnahme",subtitle:""},{min:0,color:"bg-gray-100",text:"text-gray-500",name:"Nicht bestanden",subtitle:""}],"PAT 1":[{min:1e3,color:"bg-green-700",text:"text-white",name:"4. Dunkelgrün",subtitle:"ca. Bezirksliga"},{min:800,color:"bg-green-300",text:"text-black",name:"3. Hellgrün",subtitle:"ca. Kreisliga"},{min:600,color:"bg-gray-200",text:"text-gray-800",name:"PAT 1 Teilnahme",subtitle:""},{min:0,color:"bg-gray-100",text:"text-gray-500",name:"Nicht bestanden",subtitle:""}],"PAT 2":[{min:1e3,color:"bg-blue-700",text:"text-white",name:"6. Dunkelblau",subtitle:"ca. Verbandsliga"},{min:800,color:"bg-blue-300",text:"text-black",name:"5. Hellblau",subtitle:"ca. Landesliga"},{min:600,color:"bg-gray-200",text:"text-gray-800",name:"PAT 2 Teilnahme",subtitle:""},{min:0,color:"bg-gray-100",text:"text-gray-500",name:"Nicht bestanden",subtitle:""}],"PAT 3":[{min:1e3,color:"bg-pink-400",text:"text-white",name:"10. Pink",subtitle:"Ein Weltstar!"},{min:850,color:"bg-yellow-400",text:"text-black",name:"9. Gold",subtitle:"internationaler Topsportler"},{min:700,color:"bg-red-600",text:"text-white",name:"8. Rot",subtitle:"ca. 1. Bundesliga"},{min:550,color:"bg-black",text:"text-white",name:"7. Schwarz",subtitle:"ca. 2. Bundesliga"},{min:0,color:"bg-gray-100",text:"text-gray-500",name:"Nicht bestanden",subtitle:""}]},n=r[t]||r["PAT Start"];return n.find(s=>e>=s.min)||n[n.length-1]},Bs=(t,e=0)=>{const r=Number(t);return Number.isFinite(r)?r:e},Nt=(t,e=4)=>{const r=10**e;return Math.round(t*r)/r},Ui=t=>t.length?t.reduce((e,r)=>e+r,0)/t.length:0,Vy=t=>{if(t.length<=1)return 0;const e=Ui(t),r=Ui(t.map(n=>(n-e)**2));return Math.sqrt(r)},Wy=(t=[])=>[...t].sort((e,r)=>{const n=new Date((e==null?void 0:e.datum)||0).getTime(),s=new Date((r==null?void 0:r.datum)||0).getTime();if(n===s){const i=new Date((e==null?void 0:e.created_at)||0).getTime();return new Date((r==null?void 0:r.created_at)||0).getTime()-i}return s-n}),Ky=t=>!t||typeof t!="object"?[]:Array.isArray(t.subA)||Array.isArray(t.subB)?[...t.subA||[],...t.subB||[]].map(e=>Number(e)).filter(e=>Number.isFinite(e)):(t.values||[]).map(e=>Number(e)).filter(e=>Number.isFinite(e)),qy=(t,e="zero")=>{if(!t)return e==="zero"?0:null;const r=Number(t.durchschnitt);if(Number.isFinite(r))return r;const n=Ky(t);return n.length?Ui(n):e==="zero"?0:null},Gy=t=>{if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}).format(e)},Kf=(t=[],e,r={})=>{const n=Bs(r.windowSize,5),s=r.missingStrategy||"zero",a=Wy(t.filter(x=>(x==null?void 0:x.patType)===e)).slice(0,n);if(!a.length)return{windowedAssessments:[],exerciseMetrics:[],topWeaknesses:[],topStrengths:[],trendSeries:[],radarSeries:[],isLimitedData:!1,patType:e,windowSize:n};const o=a[0],u=(o==null?void 0:o.exercises)||[],c=Math.max(...u.map(x=>Bs(x==null?void 0:x.faktor,0)),1),d=u.map((x,b)=>{const p=a.map(he=>{var M;const Re=(M=he==null?void 0:he.exercises)==null?void 0:M[b],R=qy(Re,s);return R===null?0:R}),m=Ui(p),g=Bs(x==null?void 0:x.soll,0),k=Bs(x==null?void 0:x.faktor,0),E=g>0?g:1,S=Math.max(0,(g-m)/E),j=c>0?k/c:0,_=Math.min(1,Vy(p)/E),N=S*j*(1+_),C=Math.max(0,(m-g)/E),A=1-_,U=C*j*Math.max(A,.1),Y=p[0]||0,G=p[p.length-1]||0,ye=Y-G;return{index:b,name:(x==null?void 0:x.name)||`Übung ${b+1}`,soll:g,factor:k,actualMean:Nt(m,4),latestActual:Nt(Y,4),trendDelta:Nt(ye,4),gapScore:Nt(S,4),consistencyScore:Nt(_,4),priorityScore:Nt(N,4),strengthScore:Nt(U,4),actualSeries:p.map(he=>Nt(he,4))}}),h=[...d].sort((x,b)=>b.priorityScore-x.priorityScore).slice(0,3),f=[...d].sort((x,b)=>b.strengthScore-x.strengthScore).slice(0,3),y=[...a].reverse().map(x=>({assessmentId:x.id,datum:x.datum,label:Gy(x.datum),totalPoints:Math.round(ga(x.exercises||[]))})),w=[...d].sort((x,b)=>b.factor-x.factor).slice(0,6).map(x=>({name:x.name,soll:x.soll,actual:x.actualMean,ratio:x.soll>0?Nt(Math.min(1.2,x.actualMean/x.soll),4):0,priorityScore:x.priorityScore}));return{windowedAssessments:a,exerciseMetrics:d,topWeaknesses:h,topStrengths:f,trendSeries:y,radarSeries:w,isLimitedData:a.length=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function Jf(t,e){return function(r,n){e(r,n,t)}}function Qf(t,e,r,n,s,i){function a(p){if(p!==void 0&&typeof p!="function")throw new TypeError("Function expected");return p}for(var o=n.kind,u=o==="getter"?"get":o==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),h,f=!1,y=r.length-1;y>=0;y--){var w={};for(var x in n)w[x]=x==="access"?{}:n[x];for(var x in n.access)w.access[x]=n.access[x];w.addInitializer=function(p){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(p||null))};var b=(0,r[y])(o==="accessor"?{get:d.get,set:d.set}:d[u],w);if(o==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=a(b.get))&&(d.get=h),(h=a(b.set))&&(d.set=h),(h=a(b.init))&&s.unshift(h)}else(h=a(b))&&(o==="field"?s.unshift(h):d[u]=h)}c&&Object.defineProperty(c,n.name,d),f=!0}function Yf(t,e,r){for(var n=arguments.length>2,s=0;s0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function xu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],a;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function n0(){for(var t=[],e=0;e1||u(y,x)})},w&&(s[y]=w(s[y])))}function u(y,w){try{c(n[y](w))}catch(x){f(i[0][3],x)}}function c(y){y.value instanceof pn?Promise.resolve(y.value.v).then(d,h):f(i[0][2],y)}function d(y){u("next",y)}function h(y){u("throw",y)}function f(y,w){y(w),i.shift(),i.length&&u(i[0][0],i[0][1])}}function o0(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(a){return(r=!r)?{value:pn(t[s](a)),done:!1}:i?i(a):a}:i}}function l0(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Wi=="function"?Wi(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(o,u){a=t[i](a),s(o,u,a.done,a.value)})}}function s(i,a,o,u){Promise.resolve(u).then(function(c){i({value:c,done:o})},a)}}function u0(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Jy=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},ul=function(t){return ul=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},ul(t)};function c0(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=ul(t),n=0;nt?(...e)=>t(...e):(...e)=>fetch(...e);let ya=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}},v0=class extends ya{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},cl=class extends ya{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},dl=class extends ya{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};var Ki;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Ki||(Ki={}));class ev{constructor(e,{headers:r={},customFetch:n,region:s=Ki.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=Xy(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return I(this,arguments,void 0,function*(r,n={}){var s;let i,a;try{const{headers:o,method:u,body:c,signal:d,timeout:h}=n;let f={},{region:y}=n;y||(y=this.region);const w=new URL(`${this.url}/${r}`);y&&y!=="any"&&(f["x-region"]=y,w.searchParams.set("forceFunctionRegion",y));let x;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",x=c):typeof c=="string"?(f["Content-Type"]="text/plain",x=c):typeof FormData<"u"&&c instanceof FormData?x=c:(f["Content-Type"]="application/json",x=JSON.stringify(c)):x=c;let b=d;h&&(a=new AbortController,i=setTimeout(()=>a.abort(),h),d?(b=a.signal,d.addEventListener("abort",()=>a.abort())):b=a.signal);const p=yield this.fetch(w.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:x,signal:b}).catch(E=>{throw new v0(E)}),m=p.headers.get("x-relay-error");if(m&&m==="true")throw new cl(p);if(!p.ok)throw new dl(p);let g=((s=p.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return g==="application/json"?k=yield p.json():g==="application/octet-stream"||g==="application/pdf"?k=yield p.blob():g==="text/event-stream"?k=p:g==="multipart/form-data"?k=yield p.formData():k=yield p.text(),{data:k,error:null,response:p}}catch(o){return{data:null,error:o,response:o instanceof dl||o instanceof cl?o.context:void 0}}finally{i&&clearTimeout(i)}})}}const tv=Object.freeze(Object.defineProperty({__proto__:null,get FunctionRegion(){return Ki},FunctionsClient:ev,FunctionsError:ya,FunctionsFetchError:v0,FunctionsHttpError:dl,FunctionsRelayError:cl},Symbol.toStringTag,{value:"Module"})),w0=gs(tv);var Ae={};const bn=gs(Zy);var Us={},Hs={},Vs={},Ws={},Ks={},qs={},Kc;function x0(){if(Kc)return qs;Kc=1,Object.defineProperty(qs,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return qs.default=t,qs}var qc;function b0(){if(qc)return Ks;qc=1,Object.defineProperty(Ks,"__esModule",{value:!0});const e=bn.__importDefault(x0());let r=class{constructor(s){var i,a;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(i=s.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=s.signal,this.isMaybeSingle=(a=s.isMaybeSingle)!==null&&a!==void 0?a:!1,s.fetch?this.fetch=s.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,i){return this.headers=new Headers(this.headers),this.headers.set(s,i),this}then(s,i){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const a=this.fetch;let o=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async u=>{var c,d,h,f;let y=null,w=null,x=null,b=u.status,p=u.statusText;if(u.ok){if(this.method!=="HEAD"){const E=await u.text();E===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((c=this.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?w=E:w=JSON.parse(E))}const g=(d=this.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),k=(h=u.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");g&&k&&k.length>1&&(x=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(w)&&(w.length>1?(y={code:"PGRST116",details:`Results contain ${w.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},w=null,x=null,b=406,p="Not Acceptable"):w.length===1?w=w[0]:w=null)}else{const g=await u.text();try{y=JSON.parse(g),Array.isArray(y)&&u.status===404&&(w=[],y=null,b=200,p="OK")}catch{u.status===404&&g===""?(b=204,p="No Content"):y={message:g}}if(y&&this.isMaybeSingle&&(!((f=y==null?void 0:y.details)===null||f===void 0)&&f.includes("0 rows"))&&(y=null,b=200,p="OK"),y&&this.shouldThrowOnError)throw new e.default(y)}return{error:y,data:w,count:x,status:b,statusText:p}});return this.shouldThrowOnError||(o=o.catch(u=>{var c,d,h,f,y,w;let x="";const b=u==null?void 0:u.cause;if(b){const p=(c=b==null?void 0:b.message)!==null&&c!==void 0?c:"",m=(d=b==null?void 0:b.code)!==null&&d!==void 0?d:"";x=`${(h=u==null?void 0:u.name)!==null&&h!==void 0?h:"FetchError"}: ${u==null?void 0:u.message}`,x+=` - -Caused by: ${(f=b==null?void 0:b.name)!==null&&f!==void 0?f:"Error"}: ${p}`,m&&(x+=` (${m})`),b!=null&&b.stack&&(x+=` -${b.stack}`)}else x=(y=u==null?void 0:u.stack)!==null&&y!==void 0?y:"";return{error:{message:`${(w=u==null?void 0:u.name)!==null&&w!==void 0?w:"FetchError"}: ${u==null?void 0:u.message}`,details:x,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(s,i)}returns(){return this}overrideTypes(){return this}};return Ks.default=r,Ks}var Gc;function k0(){if(Gc)return Ws;Gc=1,Object.defineProperty(Ws,"__esModule",{value:!0});const e=bn.__importDefault(b0());let r=class extends e.default{select(s){let i=!1;const a=(s??"*").split("").map(o=>/\s/.test(o)&&!i?"":(o==='"'&&(i=!i),o)).join("");return this.url.searchParams.set("select",a),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:i=!0,nullsFirst:a,foreignTable:o,referencedTable:u=o}={}){const c=u?`${u}.order`:"order",d=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${d?`${d},`:""}${s}.${i?"asc":"desc"}${a===void 0?"":a?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:i,referencedTable:a=i}={}){const o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(o,`${s}`),this}range(s,i,{foreignTable:a,referencedTable:o=a}={}){const u=typeof o>"u"?"offset":`${o}.offset`,c=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(u,`${s}`),this.url.searchParams.set(c,`${i-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:s=!1,verbose:i=!1,settings:a=!1,buffers:o=!1,wal:u=!1,format:c="text"}={}){var d;const h=[s?"analyze":null,i?"verbose":null,a?"settings":null,o?"buffers":null,u?"wal":null].filter(Boolean).join("|"),f=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${f}"; options=${h};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}};return Ws.default=r,Ws}var Jc;function bu(){if(Jc)return Vs;Jc=1,Object.defineProperty(Vs,"__esModule",{value:!0});const e=bn.__importDefault(k0()),r=new RegExp("[,()]");let n=class extends e.default{eq(i,a){return this.url.searchParams.append(i,`eq.${a}`),this}neq(i,a){return this.url.searchParams.append(i,`neq.${a}`),this}gt(i,a){return this.url.searchParams.append(i,`gt.${a}`),this}gte(i,a){return this.url.searchParams.append(i,`gte.${a}`),this}lt(i,a){return this.url.searchParams.append(i,`lt.${a}`),this}lte(i,a){return this.url.searchParams.append(i,`lte.${a}`),this}like(i,a){return this.url.searchParams.append(i,`like.${a}`),this}likeAllOf(i,a){return this.url.searchParams.append(i,`like(all).{${a.join(",")}}`),this}likeAnyOf(i,a){return this.url.searchParams.append(i,`like(any).{${a.join(",")}}`),this}ilike(i,a){return this.url.searchParams.append(i,`ilike.${a}`),this}ilikeAllOf(i,a){return this.url.searchParams.append(i,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(i,a){return this.url.searchParams.append(i,`ilike(any).{${a.join(",")}}`),this}regexMatch(i,a){return this.url.searchParams.append(i,`match.${a}`),this}regexIMatch(i,a){return this.url.searchParams.append(i,`imatch.${a}`),this}is(i,a){return this.url.searchParams.append(i,`is.${a}`),this}isDistinct(i,a){return this.url.searchParams.append(i,`isdistinct.${a}`),this}in(i,a){const o=Array.from(new Set(a)).map(u=>typeof u=="string"&&r.test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(i,`in.(${o})`),this}contains(i,a){return typeof a=="string"?this.url.searchParams.append(i,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(i,`cs.{${a.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(a)}`),this}containedBy(i,a){return typeof a=="string"?this.url.searchParams.append(i,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(i,`cd.{${a.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(a)}`),this}rangeGt(i,a){return this.url.searchParams.append(i,`sr.${a}`),this}rangeGte(i,a){return this.url.searchParams.append(i,`nxl.${a}`),this}rangeLt(i,a){return this.url.searchParams.append(i,`sl.${a}`),this}rangeLte(i,a){return this.url.searchParams.append(i,`nxr.${a}`),this}rangeAdjacent(i,a){return this.url.searchParams.append(i,`adj.${a}`),this}overlaps(i,a){return typeof a=="string"?this.url.searchParams.append(i,`ov.${a}`):this.url.searchParams.append(i,`ov.{${a.join(",")}}`),this}textSearch(i,a,{config:o,type:u}={}){let c="";u==="plain"?c="pl":u==="phrase"?c="ph":u==="websearch"&&(c="w");const d=o===void 0?"":`(${o})`;return this.url.searchParams.append(i,`${c}fts${d}.${a}`),this}match(i){return Object.entries(i).forEach(([a,o])=>{this.url.searchParams.append(a,`eq.${o}`)}),this}not(i,a,o){return this.url.searchParams.append(i,`not.${a}.${o}`),this}or(i,{foreignTable:a,referencedTable:o=a}={}){const u=o?`${o}.or`:"or";return this.url.searchParams.append(u,`(${i})`),this}filter(i,a,o){return this.url.searchParams.append(i,`${a}.${o}`),this}};return Vs.default=n,Vs}var Qc;function _0(){if(Qc)return Hs;Qc=1,Object.defineProperty(Hs,"__esModule",{value:!0});const e=bn.__importDefault(bu());let r=class{constructor(s,{headers:i={},schema:a,fetch:o}){this.url=s,this.headers=new Headers(i),this.schema=a,this.fetch=o}select(s,i){const{head:a=!1,count:o}=i??{},u=a?"HEAD":"GET";let c=!1;const d=(s??"*").split("").map(h=>/\s/.test(h)&&!c?"":(h==='"'&&(c=!c),h)).join("");return this.url.searchParams.set("select",d),o&&this.headers.append("Prefer",`count=${o}`),new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:i,defaultToNull:a=!0}={}){var o;const u="POST";if(i&&this.headers.append("Prefer",`count=${i}`),a||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const c=s.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(c.length>0){const d=[...new Set(c)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(s,{onConflict:i,ignoreDuplicates:a=!1,count:o,defaultToNull:u=!0}={}){var c;const d="POST";if(this.headers.append("Prefer",`resolution=${a?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),o&&this.headers.append("Prefer",`count=${o}`),u||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const h=s.reduce((f,y)=>f.concat(Object.keys(y)),[]);if(h.length>0){const f=[...new Set(h)].map(y=>`"${y}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}update(s,{count:i}={}){var a;const o="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}delete({count:s}={}){var i;const a="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}};return Hs.default=r,Hs}var Yc;function rv(){if(Yc)return Us;Yc=1,Object.defineProperty(Us,"__esModule",{value:!0});const t=bn,e=t.__importDefault(_0()),r=t.__importDefault(bu());let n=class E0{constructor(i,{headers:a={},schema:o,fetch:u}={}){this.url=i,this.headers=new Headers(a),this.schemaName=o,this.fetch=u}from(i){if(!i||typeof i!="string"||i.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const a=new URL(`${this.url}/${i}`);return new e.default(a,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new E0(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,a={},{head:o=!1,get:u=!1,count:c}={}){var d;let h;const f=new URL(`${this.url}/rpc/${i}`);let y;o||u?(h=o?"HEAD":"GET",Object.entries(a).filter(([x,b])=>b!==void 0).map(([x,b])=>[x,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([x,b])=>{f.searchParams.append(x,b)})):(h="POST",y=a);const w=new Headers(this.headers);return c&&w.set("Prefer",`count=${c}`),new r.default({method:h,url:f,headers:w,schema:this.schemaName,body:y,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}};return Us.default=n,Us}Object.defineProperty(Ae,"__esModule",{value:!0});Ae.PostgrestError=Ae.PostgrestBuilder=Ae.PostgrestTransformBuilder=Ae.PostgrestFilterBuilder=Ae.PostgrestQueryBuilder=Ae.PostgrestClient=void 0;const kn=bn,S0=kn.__importDefault(rv());Ae.PostgrestClient=S0.default;const j0=kn.__importDefault(_0());Ae.PostgrestQueryBuilder=j0.default;const N0=kn.__importDefault(bu());Ae.PostgrestFilterBuilder=N0.default;const T0=kn.__importDefault(k0());Ae.PostgrestTransformBuilder=T0.default;const P0=kn.__importDefault(b0());Ae.PostgrestBuilder=P0.default;const C0=kn.__importDefault(x0());Ae.PostgrestError=C0.default;Ae.default={PostgrestClient:S0.default,PostgrestQueryBuilder:j0.default,PostgrestFilterBuilder:N0.default,PostgrestTransformBuilder:T0.default,PostgrestBuilder:P0.default,PostgrestError:C0.default};class A0{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: -import ws from "ws" -new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=` - -Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const nv="2.86.2",sv=`realtime-js/${nv}`,O0="1.0.0",iv="2.0.0",Zc=O0,hl=1e4,av=1e3,ov=100;var mr;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(mr||(mr={}));var pe;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(pe||(pe={}));var ht;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(ht||(ht={}));var fl;(function(t){t.websocket="websocket"})(fl||(fl={}));var yr;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(yr||(yr={}));class lv{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,r,n){var s,i;const a=e.topic,o=(s=e.ref)!==null&&s!==void 0?s:"",u=(i=e.join_ref)!==null&&i!==void 0?i:"",c=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+o.length+a.length+c.length+h.length,y=new ArrayBuffer(this.HEADER_LENGTH+f);let w=new DataView(y),x=0;w.setUint8(x++,this.KINDS.userBroadcastPush),w.setUint8(x++,u.length),w.setUint8(x++,o.length),w.setUint8(x++,a.length),w.setUint8(x++,c.length),w.setUint8(x++,h.length),w.setUint8(x++,r),Array.from(u,p=>w.setUint8(x++,p.charCodeAt(0))),Array.from(o,p=>w.setUint8(x++,p.charCodeAt(0))),Array.from(a,p=>w.setUint8(x++,p.charCodeAt(0))),Array.from(c,p=>w.setUint8(x++,p.charCodeAt(0))),Array.from(h,p=>w.setUint8(x++,p.charCodeAt(0)));var b=new Uint8Array(y.byteLength+n.byteLength);return b.set(new Uint8Array(y),0),b.set(new Uint8Array(n),y.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,i,a,o,u]=n;return r({join_ref:s,ref:i,topic:a,event:o,payload:u})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),i=r.getUint8(2),a=r.getUint8(3),o=r.getUint8(4);let u=this.HEADER_LENGTH+4;const c=n.decode(e.slice(u,u+s));u=u+s;const d=n.decode(e.slice(u,u+i));u=u+i;const h=n.decode(e.slice(u,u+a));u=u+a;const f=e.slice(u,e.byteLength),y=o===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,w={type:this.BROADCAST_EVENT,event:d,payload:y};return a>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}class R0{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var te;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(te||(te={}));const Xc=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,a)=>(i[a]=uv(a,t,e,s),i),{}):{}},uv=(t,e,r,n)=>{const s=e.find(o=>o.name===t),i=s==null?void 0:s.type,a=r[t];return i&&!n.includes(i)?z0(i,a):pl(a)},z0=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return fv(e,r)}switch(t){case te.bool:return cv(e);case te.float4:case te.float8:case te.int2:case te.int4:case te.int8:case te.numeric:case te.oid:return dv(e);case te.json:case te.jsonb:return hv(e);case te.timestamp:return pv(e);case te.abstime:case te.date:case te.daterange:case te.int4range:case te.int8range:case te.money:case te.reltime:case te.text:case te.time:case te.timestamptz:case te.timetz:case te.tsrange:case te.tstzrange:return pl(e);default:return pl(e)}},pl=t=>t,cv=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},dv=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},hv=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},fv=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let i;const a=t.slice(1,r);try{i=JSON.parse("["+a+"]")}catch{i=a?a.split(","):[]}return i.map(o=>z0(e,o))}return t},pv=t=>typeof t=="string"?t.replace(" ","T"):t,I0=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class eo{constructor(e,r,n={},s=hl){this.channel=e,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var gl;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(gl||(gl={}));let L0=class fi{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:i,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=fi.syncState(this.state,s,i,a),this.pendingDiffs.forEach(u=>{this.state=fi.syncDiff(this.state,u,i,a)}),this.pendingDiffs=[],o()}),this.channel._on(n.diff,{},s=>{const{onJoin:i,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=fi.syncDiff(this.state,s,i,a),o())}),this.onJoin((s,i,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:a})}),this.onLeave((s,i,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,s){const i=this.cloneDeep(e),a=this.transformState(r),o={},u={};return this.map(i,(c,d)=>{a[c]||(u[c]=d)}),this.map(a,(c,d)=>{const h=i[c];if(h){const f=d.map(b=>b.presence_ref),y=h.map(b=>b.presence_ref),w=d.filter(b=>y.indexOf(b.presence_ref)<0),x=h.filter(b=>f.indexOf(b.presence_ref)<0);w.length>0&&(o[c]=w),x.length>0&&(u[c]=x)}else o[c]=d}),this.syncDiff(i,{joins:o,leaves:u},n,s)}static syncDiff(e,r,n,s){const{joins:i,leaves:a}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(i,(o,u)=>{var c;const d=(c=e[o])!==null&&c!==void 0?c:[];if(e[o]=this.cloneDeep(u),d.length>0){const h=e[o].map(y=>y.presence_ref),f=d.filter(y=>h.indexOf(y.presence_ref)<0);e[o].unshift(...f)}n(o,d,u)}),this.map(a,(o,u)=>{let c=e[o];if(!c)return;const d=u.map(h=>h.presence_ref);c=c.filter(h=>d.indexOf(h.presence_ref)<0),e[o]=c,s(o,c,u),c.length===0&&delete e[o]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return"metas"in s?r[n]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=s,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var ml;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(ml||(ml={}));var sn;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(sn||(sn={}));var bt;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(bt||(bt={}));const gv=pe;let D0=class M0{constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=pe.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new eo(this,ht.join,this.params,this.timeout),this.rejoinTimer=new R0(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=pe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=pe.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ht.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new L0(this),this.broadcastEndpointURL=I0(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==pe.closed){const{config:{broadcast:a,presence:o,private:u}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(y=>y.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[sn.PRESENCE]&&this.bindings[sn.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},f={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:c,private:u};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(y=>e==null?void 0:e(bt.CHANNEL_ERROR,y)),this._onClose(()=>e==null?void 0:e(bt.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:y})=>{var w;if(this.socket.setAuth(),y===void 0){e==null||e(bt.SUBSCRIBED);return}else{const x=this.bindings.postgres_changes,b=(w=x==null?void 0:x.length)!==null&&w!==void 0?w:0,p=[];for(let m=0;m{this.state=pe.errored,e==null||e(bt.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(y).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(bt.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){return this.state===pe.joined&&e===sn.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var s;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const a={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(o.status===202)return{success:!0};let u=o.statusText;try{const c=await o.json();u=c.error||c.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var n,s;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:a}=e,u={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:a,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var a,o,u;const c=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||u===void 0)&&u.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=pe.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ht.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new eo(this,ht.leave,{},e),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=pe.closed,this.bindings={}}async _fetchWithTimeout(e,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),a}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new eo(this,e,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>ov){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var s,i;const a=e.toLocaleLowerCase(),{close:o,error:u,leave:c,join:d}=ht;if(n&&[o,u,c,d].indexOf(a)>=0&&n!==this._joinRef())return;let f=this._onMessage(a,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(y=>{var w,x,b;return((w=y.filter)===null||w===void 0?void 0:w.event)==="*"||((b=(x=y.filter)===null||x===void 0?void 0:x.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===a}).map(y=>y.callback(f,n)):(i=this.bindings[a])===null||i===void 0||i.filter(y=>{var w,x,b,p,m,g;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in y){const k=y.id,E=(w=y.filter)===null||w===void 0?void 0:w.event;return k&&((x=r.ids)===null||x===void 0?void 0:x.includes(k))&&(E==="*"||(E==null?void 0:E.toLocaleLowerCase())===((b=r.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const k=(m=(p=y==null?void 0:y.filter)===null||p===void 0?void 0:p.event)===null||m===void 0?void 0:m.toLocaleLowerCase();return k==="*"||k===((g=r==null?void 0:r.event)===null||g===void 0?void 0:g.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===a}).map(y=>{if(typeof f=="object"&&"ids"in f){const w=f.data,{schema:x,table:b,commit_timestamp:p,type:m,errors:g}=w;f=Object.assign(Object.assign({},{schema:x,table:b,commit_timestamp:p,eventType:m,new:{},old:{},errors:g}),this._getPayloadRecords(w))}y.callback(f,n)})}_isClosed(){return this.state===pe.closed}_isJoined(){return this.state===pe.joined}_isJoining(){return this.state===pe.joining}_isLeaving(){return this.state===pe.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const s=e.toLocaleLowerCase(),i={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&M0.isEqual(s.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(ht.close,{},e)}_onError(e){this._on(ht.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=pe.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Xc(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Xc(e.columns,e.old_record)),r}};const to=()=>{},Gs={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},mv=[1e3,2e3,5e3,1e4],yv=1e4,vv=` - addEventListener("message", (e) => { - if (e.data.event === "start") { - setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); - } - });`;let wv=class{constructor(e,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=hl,this.transport=null,this.heartbeatIntervalMs=Gs.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=to,this.ref=0,this.reconnectTimer=null,this.vsn=Zc,this.logger=to,this.conn=null,this.sendBuffer=[],this.serializer=new lv,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${e}/${fl.websocket}`,this.httpEndpoint=I0(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=A0.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r} - -To use Realtime in Node.js, you need to provide a WebSocket implementation: - -Option 1: Use Node.js 22+ which has native WebSocket support -Option 2: Install and provide the "ws" package: - - npm install ws - - import ws from "ws" - const client = new RealtimeClient(url, { - ...options, - transport: ws - })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case mr.connecting:return yr.Connecting;case mr.open:return yr.Open;case mr.closing:return yr.Closing;default:return yr.Closed}}isConnected(){return this.connectionState()===yr.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new D0(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){const{topic:r,event:n,payload:s,ref:i}=e,a=()=>{this.encode(e,o=>{var u;(u=this.conn)===null||u===void 0||u.send(o)})};this.log("push",`${r} ${n} (${i})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(av,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Gs.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(c){this.log("error","error in heartbeat callback",c)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:i,ref:a}=r,o=a?`(${a})`:"",u=i.status||"";this.log("receive",`${u} ${n} ${s} ${o}`.trim(),i),this.channels.filter(c=>c._isMember(n)).forEach(c=>c._trigger(s,i,a)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===mr.open||this.conn.readyState===mr.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(ht.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${e}${n}${s}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([vv],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:sv};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(ht.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new R0(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Gs.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,s,i,a,o,u,c,d,h,f,y;switch(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:hl,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Gs.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(a=e==null?void 0:e.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:to,this.vsn=(u=e==null?void 0:e.vsn)!==null&&u!==void 0?u:Zc,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:w=>mv[w-1]||yv,this.vsn){case O0:this.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:(w,x)=>x(JSON.stringify(w)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:(w,x)=>x(JSON.parse(w));break;case iv:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(y=e==null?void 0:e.decode)!==null&&y!==void 0?y:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}};const xv=Object.freeze(Object.defineProperty({__proto__:null,REALTIME_CHANNEL_STATES:gv,get REALTIME_LISTEN_TYPES(){return sn},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return ml},get REALTIME_PRESENCE_LISTEN_EVENTS(){return gl},get REALTIME_SUBSCRIBE_STATES(){return bt},RealtimeChannel:D0,RealtimeClient:wv,RealtimePresence:L0,WebSocketFactory:A0},Symbol.toStringTag,{value:"Module"})),F0=gs(xv);class bs extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function ae(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class $0 extends bs{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class qi extends bs{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const ku=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),bv=()=>Response,yl=t=>{if(Array.isArray(t))return t.map(r=>yl(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=yl(n)}),e},kv=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},_v=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),ro=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},Ev=(t,e,r)=>I(void 0,void 0,void 0,function*(){const n=yield bv();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(s=>{const i=t.status||500,a=(s==null?void 0:s.statusCode)||i+"";e(new $0(ro(s),i,a))}).catch(s=>{e(new qi(ro(s),s))}):e(new qi(ro(t),t))}),Sv=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?s:(kv(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,e!=null&&e.duplex&&(s.duplex=e.duplex),Object.assign(Object.assign({},s),r))};function ks(t,e,r,n,s,i){return I(this,void 0,void 0,function*(){return new Promise((a,o)=>{t(r,Sv(e,n,s,i)).then(u=>{if(!u.ok)throw u;return n!=null&&n.noResolveJson?u:u.json()}).then(u=>a(u)).catch(u=>Ev(u,o,n))})})}function fs(t,e,r,n){return I(this,void 0,void 0,function*(){return ks(t,"GET",e,r,n)})}function ct(t,e,r,n,s){return I(this,void 0,void 0,function*(){return ks(t,"POST",e,n,s,r)})}function vl(t,e,r,n,s){return I(this,void 0,void 0,function*(){return ks(t,"PUT",e,n,s,r)})}function jv(t,e,r,n){return I(this,void 0,void 0,function*(){return ks(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function _u(t,e,r,n,s){return I(this,void 0,void 0,function*(){return ks(t,"DELETE",e,n,s,r)})}class Nv{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return I(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ae(e))return{data:null,error:e};throw e}})}}var B0;class Tv{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[B0]="BlobDownloadBuilder",this.promise=null}asStream(){return new Nv(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return I(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ae(e))return{data:null,error:e};throw e}})}}B0=Symbol.toStringTag;const Pv={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ed={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Cv{constructor(e,r={},n,s){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=ku(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,s){return I(this,void 0,void 0,function*(){try{let i;const a=Object.assign(Object.assign({},ed),s);let o=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const u=a.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),u&&i.append("metadata",this.encodeMetadata(u)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",a.cacheControl),u&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(u))):(i=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,u&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(u))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!a.duplex&&(a.duplex="half")),s!=null&&s.headers&&(o=Object.assign(Object.assign({},o),s.headers));const c=this._removeEmptyFolders(r),d=this._getFinalPath(c),h=yield(e=="PUT"?vl:ct)(this.fetch,`${this.url}/object/${d}`,i,Object.assign({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{data:{path:c,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(ae(i))return{data:null,error:i};throw i}})}upload(e,r,n){return I(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,s){return I(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),a=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${a}`);o.searchParams.set("token",r);try{let u;const c=Object.assign({upsert:ed.upsert},s),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType);const h=yield vl(this.fetch,o.toString(),u,{headers:d});return{data:{path:i,fullPath:h.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if(ae(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return I(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const i=yield ct(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(this.url+i.url),o=a.searchParams.get("token");if(!o)throw new bs("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:o},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ae(n))return{data:null,error:n};throw n}})}update(e,r,n){return I(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return I(this,void 0,void 0,function*(){try{return{data:yield ct(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}copy(e,r,n){return I(this,void 0,void 0,function*(){try{return{data:{path:(yield ct(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}createSignedUrl(e,r,n){return I(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield ct(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${a}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}createSignedUrls(e,r,n){return I(this,void 0,void 0,function*(){try{const s=yield ct(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}download(e,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),a=i?`?${i}`:"",o=this._getFinalPath(e),u=()=>fs(this.fetch,`${this.url}/${s}/${o}${a}`,{headers:this.headers,noResolveJson:!0});return new Tv(u,this.shouldThrowOnError)}info(e){return I(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield fs(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:yl(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ae(n))return{data:null,error:n};throw n}})}exists(e){return I(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield jv(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ae(n)&&n instanceof qi){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),s=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&s.push(i);const o=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",u=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});u!==""&&s.push(u);let c=s.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}${c}`)}}}remove(e){return I(this,void 0,void 0,function*(){try{return{data:yield _u(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}list(e,r,n){return I(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},Pv),r),{prefix:e||""});return{data:yield ct(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}listV2(e,r){return I(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield ct(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ae(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const U0="2.86.2",H0={"X-Client-Info":`storage-js/${U0}`};class Av{constructor(e,r={},n,s){this.shouldThrowOnError=!1;const i=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},H0),r),this.fetch=ku(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return I(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield fs(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}getBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield fs(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}createBucket(e){return I(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield ct(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ae(s))return{data:null,error:s};throw s}})}updateBucket(e,r){return I(this,void 0,void 0,function*(){try{return{data:yield vl(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ae(n))return{data:null,error:n};throw n}})}emptyBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield ct(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}deleteBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield _u(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}var ps=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Ov(t,e,r){const n=new URL(e,t);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function Rv(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function zv(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){const o=Ov(t.baseUrl,n,s),u=await Rv(t.auth),c=await e(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...u,...a},body:i?JSON.stringify(i):void 0}),d=await c.text(),h=(c.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!c.ok){const y=h?f:void 0,w=y==null?void 0:y.error;throw new ps((w==null?void 0:w.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:y})}return{status:c.status,headers:c.headers,data:f}}}}function Js(t){return t.join("")}var Iv=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Js(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Js(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Js(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Js(t.namespace)}`}),!0}catch(e){if(e instanceof ps&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof ps&&r.status===409)return;throw r}}};function Rr(t){return t.join("")}var Lv=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Rr(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof ps&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof ps&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},Dv=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=zv({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new Iv(this.client,e),this.tableOps=new Lv(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};class V0{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},H0),r),this.fetch=ku(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield ct(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}listBuckets(e){return I(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield fs(this.fetch,s,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}deleteBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield _u(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ae(r))return{data:null,error:r};throw r}})}from(e){if(!_v(e))throw new bs("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new Dv({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:()=>I(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const Eu={"X-Client-Info":`storage-js/${U0}`,"Content-Type":"application/json"};class Su extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function $e(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class pi extends Su{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class W0 extends Su{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var wl;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(wl||(wl={}));const va=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Mv=()=>Response,K0=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Fv=t=>Array.from(new Float32Array(t)),$v=(t,e)=>{if(e!==void 0&&t.float32.length!==e)throw new Error(`Vector dimension mismatch: expected ${e}, got ${t.float32.length}`)},td=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Bv=(t,e,r)=>I(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const s=t.status||500,i=t;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";e(new pi(td(a),s,o))}).catch(()=>{const a=s+"",o=i.statusText||`HTTP ${s} error`;e(new pi(o,s,a))});else{const a=s+"",o=i.statusText||`HTTP ${s} error`;e(new pi(o,s,a))}}else e(new W0(td(t),t))}),Uv=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(K0(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,Object.assign(Object.assign({},s),r)):s};function Hv(t,e,r,n,s,i){return I(this,void 0,void 0,function*(){return new Promise((a,o)=>{t(r,Uv(e,n,s,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;const c=u.headers.get("content-type");return!c||!c.includes("application/json")?{}:u.json()}).then(u=>a(u)).catch(u=>Bv(u,o,n))})})}function Ge(t,e,r,n,s){return I(this,void 0,void 0,function*(){return Hv(t,"POST",e,n,s,r)})}class q0{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Eu),r),this.fetch=va(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return I(this,void 0,void 0,function*(){try{return{data:(yield Ge(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}getIndex(e,r){return I(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if($e(n))return{data:null,error:n};throw n}})}listIndexes(e){return I(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return I(this,void 0,void 0,function*(){try{return{data:(yield Ge(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if($e(n))return{data:null,error:n};throw n}})}}class G0{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Eu),r),this.fetch=va(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return I(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield Ge(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}getVectors(e){return I(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}listVectors(e){return I(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield Ge(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}queryVectors(e){return I(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}deleteVectors(e){return I(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield Ge(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}}class J0{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Eu),r),this.fetch=va(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return I(this,void 0,void 0,function*(){try{return{data:(yield Ge(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}getBucket(e){return I(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}listBuckets(){return I(this,arguments,void 0,function*(e={}){try{return{data:yield Ge(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}deleteBucket(e){return I(this,void 0,void 0,function*(){try{return{data:(yield Ge(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if($e(r))return{data:null,error:r};throw r}})}}class Q0 extends J0{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new Y0(this.url,this.headers,e,this.fetch)}createBucket(e){const r=Object.create(null,{createBucket:{get:()=>super.createBucket}});return I(this,void 0,void 0,function*(){return r.createBucket.call(this,e)})}getBucket(e){const r=Object.create(null,{getBucket:{get:()=>super.getBucket}});return I(this,void 0,void 0,function*(){return r.getBucket.call(this,e)})}listBuckets(){const e=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return I(this,arguments,void 0,function*(r={}){return e.listBuckets.call(this,r)})}deleteBucket(e){const r=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return I(this,void 0,void 0,function*(){return r.deleteBucket.call(this,e)})}}class Y0 extends q0{constructor(e,r,n,s){super(e,r,s),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return I(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return I(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return I(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return I(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new Z0(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class Z0 extends G0{constructor(e,r,n,s,i){super(e,r,i),this.vectorBucketName=n,this.indexName=s}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return I(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return I(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return I(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return I(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return I(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class Vv extends Av{constructor(e,r={},n,s){super(e,r,n,s)}from(e){return new Cv(this.url,this.headers,e,this.fetch)}get vectors(){return new Q0(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new V0(this.url+"/iceberg",this.headers,this.fetch)}}const Wv=Object.freeze(Object.defineProperty({__proto__:null,StorageAnalyticsClient:V0,StorageApiError:$0,StorageClient:Vv,StorageError:bs,StorageUnknownError:qi,StorageVectorsApiError:pi,StorageVectorsClient:Q0,StorageVectorsError:Su,get StorageVectorsErrorCode(){return wl},StorageVectorsUnknownError:W0,VectorBucketApi:J0,VectorBucketScope:Y0,VectorDataApi:G0,VectorIndexApi:q0,VectorIndexScope:Z0,isPlainObject:K0,isStorageError:ae,isStorageVectorsError:$e,normalizeToFloat32:Fv,resolveFetch:va,resolveResponse:Mv,validateVectorDimension:$v},Symbol.toStringTag,{value:"Module"})),Kv=gs(Wv);var X0={},wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.version=void 0;wa.version="2.86.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_REALTIME_OPTIONS=t.DEFAULT_AUTH_OPTIONS=t.DEFAULT_DB_OPTIONS=t.DEFAULT_GLOBAL_OPTIONS=t.DEFAULT_HEADERS=void 0;const e=wa;let r="";typeof Deno<"u"?r="deno":typeof document<"u"?r="web":typeof navigator<"u"&&navigator.product==="ReactNative"?r="react-native":r="node",t.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${r}/${e.version}`},t.DEFAULT_GLOBAL_OPTIONS={headers:t.DEFAULT_HEADERS},t.DEFAULT_DB_OPTIONS={schema:"public"},t.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},t.DEFAULT_REALTIME_OPTIONS={}})(X0);var ep={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWithAuth=t.resolveHeadersConstructor=t.resolveFetch=void 0;const e=s=>s?(...i)=>s(...i):(...i)=>fetch(...i);t.resolveFetch=e;const r=()=>Headers;t.resolveHeadersConstructor=r;const n=(s,i,a)=>{const o=(0,t.resolveFetch)(a),u=(0,t.resolveHeadersConstructor)();return async(c,d)=>{var h;const f=(h=await i())!==null&&h!==void 0?h:s;let y=new u(d==null?void 0:d.headers);return y.has("apikey")||y.set("apikey",s),y.has("Authorization")||y.set("Authorization",`Bearer ${f}`),o(c,Object.assign(Object.assign({},d),{headers:y}))}};t.fetchWithAuth=n})(ep);var or={};Object.defineProperty(or,"__esModule",{value:!0});or.isBrowser=void 0;or.uuid=qv;or.ensureTrailingSlash=tp;or.applySettingDefaults=Jv;or.validateSupabaseUrl=Qv;function qv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}function tp(t){return t.endsWith("/")?t:t+"/"}const Gv=()=>typeof window<"u";or.isBrowser=Gv;function Jv(t,e){var r,n;const{db:s,auth:i,realtime:a,global:o}=t,{db:u,auth:c,realtime:d,global:h}=e,f={db:Object.assign(Object.assign({},u),s),auth:Object.assign(Object.assign({},c),i),realtime:Object.assign(Object.assign({},d),a),storage:{},global:Object.assign(Object.assign(Object.assign({},h),o),{headers:Object.assign(Object.assign({},(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{}),(n=o==null?void 0:o.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function Qv(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(tp(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var xa={};const rp="2.86.2",Dr=30*1e3,xl=3,no=xl*Dr,Yv="http://localhost:9999",Zv="supabase.auth.token",Xv={"X-Client-Info":`gotrue-js/${rp}`},bl="X-Supabase-Api-Version",np={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},e1=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,t1=10*60*1e3;let gn=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};function D(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}let sp=class extends gn{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};function ip(t){return D(t)&&t.name==="AuthApiError"}let Vt=class extends gn{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}},Mt=class extends gn{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}},Me=class extends Mt{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function ap(t){return D(t)&&t.name==="AuthSessionMissingError"}let fr=class extends Mt{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Ln=class extends Mt{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},Dn=class extends Mt{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function op(t){return D(t)&&t.name==="AuthImplicitGrantRedirectError"}let kl=class extends Mt{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Gi=class extends Mt{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};function gi(t){return D(t)&&t.name==="AuthRetryableFetchError"}let _l=class extends Mt{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};function r1(t){return D(t)&&t.name==="AuthWeakPasswordError"}let Ji=class extends Mt{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}};const Qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rd=` -\r=`.split(""),n1=(()=>{const t=new Array(128);for(let e=0;e=6;){const n=e.queue>>e.queuedBits-6&63;r(Qi[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Qi[n]),e.queuedBits-=6}}function lp(t,e,r){const n=n1[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function sd(t){const e=[],r=a=>{e.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=a=>{a1(a,n,r)};for(let a=0;a>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function i1(t,e){for(let r=0;r55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}s1(n,e)}}function a1(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function an(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;se.push(r)),new Uint8Array(e)}function br(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>nd(s,r,n)),nd(null,r,n),e.join("")}function l1(t){return Math.round(Date.now()/1e3)+t}function u1(){return Symbol("auth-callback")}const _e=()=>typeof window<"u"&&typeof document<"u",ur={tested:!1,writable:!1},up=()=>{if(!_e())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ur.tested)return ur.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ur.tested=!0,ur.writable=!0}catch{ur.tested=!0,ur.writable=!1}return ur.writable};function c1(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const cp=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),d1=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Mr=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},cr=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ke=async(t,e)=>{await t.removeItem(e)};class ba{constructor(){this.promise=new ba.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}ba.promiseConstructor=Promise;function so(t){const e=t.split(".");if(e.length!==3)throw new Ji("Invalid JWT structure");for(let n=0;n{setTimeout(()=>e(null),t)})}function f1(t,e){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const a=await t(i);if(!e(i,null,a)){n(a);return}}catch(a){if(!e(i,a)){s(a);return}}})()})}function p1(t){return("0"+t.toString(16)).substr(-2)}function g1(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,p1).join("")}async function m1(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function y1(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await m1(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function zr(t,e,r=!1){const n=g1();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await Mr(t,`${e}-code-verifier`,s);const i=await y1(n);return[i,n===i?"plain":"s256"]}const v1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function w1(t){const e=t.headers.get(bl);if(!e||!e.match(v1))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function x1(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function b1(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const k1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ir(t){if(!k1.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function io(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function _1(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function id(t){return JSON.parse(JSON.stringify(t))}const pr=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),E1=[502,503,504];async function ad(t){var e;if(!d1(t))throw new Gi(pr(t),0);if(E1.includes(t.status))throw new Gi(pr(t),t.status);let r;try{r=await t.json()}catch(i){throw new Vt(pr(i),i)}let n;const s=w1(t);if(s&&s.getTime()>=np["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new _l(pr(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Me}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,a)=>i&&typeof a=="string",!0))throw new _l(pr(r),t.status,r.weak_password.reasons);throw new sp(pr(r),t.status||500,n)}const S1=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function F(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[bl]||(i[bl]=np["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const a=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",u=await j1(t,e,r+o,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(u):{data:Object.assign({},u),error:null}}async function j1(t,e,r,n,s,i){const a=S1(e,n,s,i);let o;try{o=await t(r,Object.assign({},a))}catch(u){throw console.error(u),new Gi(pr(u),0)}if(o.ok||await ad(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(u){await ad(u)}}function lt(t){var e;let r=null;P1(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=l1(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function od(t){const e=lt(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Wt(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function N1(t){return{data:t,error:null}}function T1(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,a=xn(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},u=Object.assign({},a);return{data:{properties:o,user:u},error:null}}function ld(t){return t}function P1(t){return t.access_token&&t.refresh_token&&t.expires_in}const mi=["global","local","others"];let ju=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=cp(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,r=mi[0]){if(mi.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${mi.join(", ")}`);try{return await F(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(D(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await F(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Wt})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=xn(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await F(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:T1,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(D(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await F(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Wt})}catch(r){if(D(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,i,a,o,u;try{const c={nextPage:null,lastPage:0,total:0},d=await F(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ld});if(d.error)throw d.error;const h=await d.json(),f=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,y=(u=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&u!==void 0?u:[];return y.length>0&&(y.forEach(w=>{const x=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);c[`${b}Page`]=x}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(D(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Ir(e);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Wt})}catch(r){if(D(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Ir(e);try{return await F(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Wt})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Ir(e);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Wt})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Ir(e.userId);try{const{data:r,error:n}=await F(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Ir(e.userId),Ir(e.id);try{return{data:await F(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,i,a,o,u;try{const c={nextPage:null,lastPage:0,total:0},d=await F(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ld});if(d.error)throw d.error;const h=await d.json(),f=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,y=(u=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&u!==void 0?u:[];return y.length>0&&(y.forEach(w=>{const x=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);c[`${b}Page`]=x}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(D(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await F(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await F(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(D(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await F(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}};function ud(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const gr={debug:!!(globalThis&&up()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Nu extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}let dp=class extends Nu{};class C1 extends Nu{}async function hp(t,e,r){gr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),gr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){gr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await r()}finally{gr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw gr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new dp(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(gr.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}const cd={};async function A1(t,e,r){var n;const s=(n=cd[t])!==null&&n!==void 0?n:Promise.resolve(),i=Promise.race([s.catch(()=>null),e>=0?new Promise((a,o)=>{setTimeout(()=>{o(new C1(`Acquring process lock with name "${t}" timed out`))},e)}):null].filter(a=>a)).catch(a=>{if(a&&a.isAcquireTimeout)throw a;return null}).then(async()=>await r());return cd[t]=i.catch(async a=>{if(a&&a.isAcquireTimeout)return await s,null;throw a}),await i}function O1(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function fp(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function R1(t){return parseInt(t,16)}function z1(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function I1(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:u,resources:c,scheme:d,uri:h,version:f}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(` -`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const y=fp(t.address),w=d?`${d}://${n}`:n,x=t.statement?`${t.statement} -`:"",b=`${w} wants you to sign in with your Ethereum account: -${y} - -${x}`;let p=`URI: ${h} -Version: ${f} -Chain ID: ${r}${a?` -Nonce: ${a}`:""} -Issued At: ${i.toISOString()}`;if(s&&(p+=` -Expiration Time: ${s.toISOString()}`),o&&(p+=` -Not Before: ${o.toISOString()}`),u&&(p+=` -Request ID: ${u}`),c){let m=` -Resources:`;for(const g of c){if(!g||typeof g!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${g}`);m+=` -- ${g}`}p+=m}return`${b} -${p}`}class ge extends Error{constructor({message:e,code:r,cause:n,name:s}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class Yi extends ge{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function L1({error:t,options:e}){var r,n,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ge({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new ge({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new ge({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ge({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new ge({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new ge({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new ge({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new ge({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(pp(a)){if(i.rp.id!==a)return new ge({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ge({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new ge({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new ge({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function D1({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ge({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new ge({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(pp(n)){if(r.rpId!==n)return new ge({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ge({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new ge({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class M1{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const F1=new M1;function $1(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=xn(t,["challenge","user","excludeCredentials"]),i=an(e).buffer,a=Object.assign(Object.assign({},r),{id:an(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let u=0;u0){i.allowCredentials=new Array(r.length);for(let a=0;as!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const i in s){const a=s[i];if(a!==void 0)if(Array.isArray(a))n[i]=a;else if(r(a))n[i]=a;else if(e(a)){const o=n[i];e(o)?n[i]=Zi(o,a):n[i]=Zi(a)}else n[i]=a}return n}function G1(t,e){return Zi(K1,t,e||{})}function J1(t,e){return Zi(q1,t,e||{})}class Q1{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},i){try{const{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!a)return{data:null,error:o};const u=s??F1.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:c}=a.webauthn.credential_options.publicKey;c.name||(c.name=`${c.id}:${n}`),c.displayName||(c.displayName=c.name)}switch(a.webauthn.type){case"create":{const c=G1(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:h}=await V1({publicKey:c,signal:u});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const c=J1(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:h}=await W1(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:c,signal:u}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return D(a)?{data:null,error:a}:{data:null,error:new Vt("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new gn("rpId is required for WebAuthn authentication")};try{if(!dd())return{data:null,error:new Vt("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!a)return{data:null,error:o};const{webauthn:u}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(a){return D(a)?{data:null,error:a}:{data:null,error:new Vt("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new gn("rpId is required for WebAuthn registration")};try{if(!dd())return{data:null,error:new Vt("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:u,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return u?this._verify({factorId:a.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:c}}catch(a){return D(a)?{data:null,error:a}:{data:null,error:new Vt("Unexpected error in register",a)}}}}O1();const Y1={url:Yv,storageKey:Zv,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Xv,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function hd(t,e,r){return await r()}const Lr={};let Tu=class El{get jwks(){var e,r;return(r=(e=Lr[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Lr[this.storageKey]=Object.assign(Object.assign({},Lr[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Lr[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Lr[this.storageKey]=Object.assign(Object.assign({},Lr[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},Y1),e);if(this.storageKey=i.storageKey,this.instanceID=(r=El.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,El.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&_e()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new ju({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=cp(i.fetch),this.lock=i.lock||hd,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:_e()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=hp:this.lock=hd,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Q1(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:up()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ud(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=ud(this.memoryStorage)),_e()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${rp}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(_e()&&(r=c1(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),_e()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),op(i)){const u=(e=i.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:a,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return D(r)?this._returnResult({error:r}):this._returnResult({error:new Vt("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const i=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:lt}),{data:a,error:o}=i;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const u=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(i){if(D(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var r,n,s;try{let i;if("email"in e){const{email:d,password:h,options:f}=e;let y=null,w=null;this.flowType==="pkce"&&([y,w]=await zr(this.storage,this.storageKey)),i=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:y,code_challenge_method:w},xform:lt})}else if("phone"in e){const{phone:d,password:h,options:f}=e;i=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:lt})}else throw new Ln("You must provide either an email or phone number and a password");const{data:a,error:o}=i;if(o||!a)return await ke(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const u=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(i){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let r;if("email"in e){const{email:i,password:a,options:o}=e;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:od})}else if("phone"in e){const{phone:i,password:a,options:o}=e;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:od})}else throw new Ln("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new fr;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,i,a,o,u,c,d,h,f;let y,w;if("message"in e)y=e.message,w=e.signature;else{const{chain:x,wallet:b,statement:p,options:m}=e;let g;if(_e())if(typeof b=="object")g=b;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")g=N.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(m!=null&&m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");g=b}const k=new URL((r=m==null?void 0:m.url)!==null&&r!==void 0?r:window.location.href),E=await g.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=fp(E[0]);let j=(n=m==null?void 0:m.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!j){const N=await g.request({method:"eth_chainId"});j=R1(N)}const _={domain:k.host,address:S,statement:p,uri:k.href,version:"1",chainId:j,nonce:(s=m==null?void 0:m.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(i=m==null?void 0:m.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=m==null?void 0:m.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(u=m==null?void 0:m.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(c=m==null?void 0:m.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(d=m==null?void 0:m.signInWithEthereum)===null||d===void 0?void 0:d.resources};y=I1(_),w=await g.request({method:"personal_sign",params:[z1(y),S]})}try{const{data:x,error:b}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:y,signature:w},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:lt});if(b)throw b;if(!x||!x.session||!x.user){const p=new fr;return this._returnResult({data:{user:null,session:null},error:p})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:b})}catch(x){if(D(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(e){var r,n,s,i,a,o,u,c,d,h,f,y;let w,x;if("message"in e)w=e.message,x=e.signature;else{const{chain:b,wallet:p,statement:m,options:g}=e;let k;if(_e())if(typeof p=="object")k=p;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))k=S.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof p!="object"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=p}const E=new URL((r=g==null?void 0:g.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in k&&k.signIn){const S=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},g==null?void 0:g.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),m?{statement:m}:null));let j;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")j=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)j=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in j&&"signature"in j&&(typeof j.signedMessage=="string"||j.signedMessage instanceof Uint8Array)&&j.signature instanceof Uint8Array)w=typeof j.signedMessage=="string"?j.signedMessage:new TextDecoder().decode(j.signedMessage),x=j.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${E.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(s=(n=g==null?void 0:g.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=g==null?void 0:g.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${g.signInWithSolana.notBefore}`]:[],...!((a=g==null?void 0:g.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${g.signInWithSolana.expirationTime}`]:[],...!((o=g==null?void 0:g.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${g.signInWithSolana.chainId}`]:[],...!((u=g==null?void 0:g.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${g.signInWithSolana.nonce}`]:[],...!((c=g==null?void 0:g.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${g.signInWithSolana.requestId}`]:[],...!((h=(d=g==null?void 0:g.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...g.signInWithSolana.resources.map(j=>`- ${j}`)]:[]].join(` -`);const S=await k.signMessage(new TextEncoder().encode(w),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=S}}try{const{data:b,error:p}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:br(x)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:lt});if(p)throw p;if(!b||!b.session||!b.user){const m=new fr;return this._returnResult({data:{user:null,session:null},error:m})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:p})}catch(b){if(D(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await cr(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:i,error:a}=await F(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:lt});if(await ke(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!i||!i.session||!i.user){const o=new fr;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:a})}catch(i){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:i,nonce:a}=e,o=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:lt}),{data:u,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u||!u.session||!u.user){const d=new fr;return this._returnResult({data:{user:null,session:null},error:d})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:c})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,i,a;try{if("email"in e){const{email:o,options:u}=e;let c=null,d=null;this.flowType==="pkce"&&([c,d]=await zr(this.storage,this.storageKey));const{error:h}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:c,code_challenge_method:d},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:o,options:u}=e,{data:c,error:d}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=u==null?void 0:u.data)!==null&&s!==void 0?s:{},create_user:(i=u==null?void 0:u.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(a=u==null?void 0:u.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:d})}throw new Ln("You must provide either an email or phone number.")}catch(o){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var r,n;try{let s,i;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:o}=await F(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:lt});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const u=a.session,c=a.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(s){if(D(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,i,a;try{let o=null,u=null;this.flowType==="pkce"&&([o,u]=await zr(this.storage,this.storageKey));const c=await F(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:u}),headers:this.headers,xform:N1});return!((i=c.data)===null||i===void 0)&&i.url&&_e()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Me;const{error:s}=await F(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(D(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:i}=e,{error:a}=await F(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:n,type:s,options:i}=e,{data:a,error:o}=await F(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new Ln("You must provide either an email or phone number and a type")}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await cr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Wt}):await this._useSession(async r=>{var n,s,i;const{data:a,error:o}=r;if(o)throw o;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Me}:await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Wt})})}catch(r){if(D(r))return ap(r)&&(await this._removeSession(),await ke(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new Me;const a=s.session;let o=null,u=null;this.flowType==="pkce"&&e.email!=null&&([o,u]=await zr(this.storage,this.storageKey));const{data:c,error:d}=await F(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:u}),jwt:a.access_token,xform:Wt});if(d)throw d;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Me;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:a}=so(e.access_token);if(a.exp&&(n=a.exp,s=n<=r),s){const{data:o,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:u}=await this._getUser(e.access_token);if(u)throw u;i={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(D(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:a,error:o}=r;if(o)throw o;e=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Me;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!_e())throw new Dn("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Dn(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new kl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Dn("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new kl("No code detected.");const{data:m,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:m.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:a,expires_in:o,expires_at:u,token_type:c}=e;if(!i||!o||!a||!c)throw new Dn("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let f=d+h;u&&(f=parseInt(u));const y=f-d;y*1e3<=Dr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${y}s, should have been closer to ${h}s`);const w=f-h;d-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,f,d):d-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,f,d);const{data:x,error:b}=await this._getUser(i);if(b)throw b;const p={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:h,expires_at:f,refresh_token:a,token_type:c,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:p,redirectType:e.type},error:null})}catch(n){if(D(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await cr(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({error:i});const a=(n=s.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(ip(o)&&(o.status===404||o.status===401||o.status===403)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await ke(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=u1(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await zr(this.storage,this.storageKey,!0));try{return await F(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var a,o,u,c,d;const{data:h,error:f}=i;if(f)throw f;const y=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await F(this.fetch,"GET",y,{headers:this.headers,jwt:(d=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return _e()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(D(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:a,provider:o,token:u,access_token:c,nonce:d}=e,h=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:u,access_token:c,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:lt}),{data:f,error:y}=h;return y?this._returnResult({data:{user:null,session:null},error:y}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new fr}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:y}))}catch(s){if(await ke(this.storage,`${this.storageKey}-code-verifier`),D(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:a}=r;if(a)throw a;return await F(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await f1(async s=>(s>0&&await h1(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await F(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:lt})),(s,i)=>{const a=200*Math.pow(2,s);return i&&gi(i)&&Date.now()+a-n{try{await o.callback(e,r)}catch(u){i.push(u)}});if(await Promise.all(a),i.length>0){for(let o=0;othis._autoRefreshTokenTick(),Dr);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Dr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Dr}ms, refresh threshold is ${xl} ticks`),s<=xl&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Nu)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!_e()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,a]=await zr(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(o.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await F(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:c}=await F(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&u.type==="totp"&&(!((s=u==null?void 0:u.totp)===null||s===void 0)&&s.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?U1(e.webauthn.credential_response):H1(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:u}=await F(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:u}))})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=await F(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:$1(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:B1(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var e,r;const{data:{session:n},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=so(n.access_token);let a=null;i.aal&&(a=i.aal);let o=a;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(d=>d.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(o="aal2");const c=i.amr||[];return{data:{currentLevel:a,nextLevel:o,currentAuthenticationMethods:c},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await F(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Me})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Me});const a=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&_e()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Me});const a=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&_e()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await F(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Me})})}catch(e){if(D(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await F(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Me})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(o=>o.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+t1>s)return n;const{data:i,error:a}=await F(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:y,error:w}=await this.getSession();if(w||!y.session)return this._returnResult({data:null,error:w});n=y.session.access_token}const{header:s,payload:i,signature:a,raw:{header:o,payload:u}}=so(n);r!=null&&r.allowExpired||x1(i.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:y}=await this.getUser(n);if(y)throw y;return{data:{claims:i,header:s,signature:a},error:null}}const d=b1(s.alg),h=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,a,o1(`${o}.${u}`)))throw new Ji("Invalid JWT signature");return{data:{claims:i,header:s,signature:a},error:null}}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}};Tu.nextInstanceID={};const Z1=ju,X1=Tu,ew=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:Z1,AuthApiError:sp,AuthClient:X1,AuthError:gn,AuthImplicitGrantRedirectError:Dn,AuthInvalidCredentialsError:Ln,AuthInvalidJwtError:Ji,AuthInvalidTokenResponseError:fr,AuthPKCEGrantCodeExchangeError:kl,AuthRetryableFetchError:Gi,AuthSessionMissingError:Me,AuthUnknownError:Vt,AuthWeakPasswordError:_l,CustomAuthError:Mt,GoTrueAdminApi:ju,GoTrueClient:Tu,NavigatorLockAcquireTimeoutError:dp,SIGN_OUT_SCOPES:mi,isAuthApiError:ip,isAuthError:D,isAuthImplicitGrantRedirectError:op,isAuthRetryableFetchError:gi,isAuthSessionMissingError:ap,isAuthWeakPasswordError:r1,lockInternals:gr,navigatorLock:hp,processLock:A1},Symbol.toStringTag,{value:"Module"})),gp=gs(ew);Object.defineProperty(xa,"__esModule",{value:!0});xa.SupabaseAuthClient=void 0;const tw=gp;class rw extends tw.AuthClient{constructor(e){super(e)}}xa.SupabaseAuthClient=rw;Object.defineProperty(Hi,"__esModule",{value:!0});const nw=w0,sw=Ae,iw=F0,aw=Kv,Qs=X0,ow=ep,fd=or,lw=xa;let uw=class{constructor(e,r,n){var s,i,a;this.supabaseUrl=e,this.supabaseKey=r;const o=(0,fd.validateSupabaseUrl)(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const u=`sb-${o.hostname.split(".")[0]}-auth-token`,c={db:Qs.DEFAULT_DB_OPTIONS,realtime:Qs.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Qs.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Qs.DEFAULT_GLOBAL_OPTIONS},d=(0,fd.applySettingDefaults)(n??{},c);this.storageKey=(s=d.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=d.global.headers)!==null&&i!==void 0?i:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=d.auth)!==null&&a!==void 0?a:{},this.headers,d.global.fetch),this.fetch=(0,ow.fetchWithAuth)(r,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.accessToken&&this.accessToken().then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new sw.PostgrestClient(new URL("rest/v1",o).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new aw.StorageClient(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new nw.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,storageKey:a,flowType:o,lock:u,debug:c,throwOnError:d},h,f){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new lw.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},y),h),storageKey:a,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,flowType:o,lock:u,debug:c,throwOnError:d,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new iw.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};Hi.default=uw;(function(t){var e=Ar&&Ar.__createBinding||(Object.create?function(d,h,f,y){y===void 0&&(y=f);var w=Object.getOwnPropertyDescriptor(h,f);(!w||("get"in w?!h.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return h[f]}}),Object.defineProperty(d,y,w)}:function(d,h,f,y){y===void 0&&(y=f),d[y]=h[f]}),r=Ar&&Ar.__exportStar||function(d,h){for(var f in d)f!=="default"&&!Object.prototype.hasOwnProperty.call(h,f)&&e(h,d,f)},n=Ar&&Ar.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.SupabaseClient=t.FunctionRegion=t.FunctionsError=t.FunctionsRelayError=t.FunctionsFetchError=t.FunctionsHttpError=t.PostgrestError=void 0;const s=n(Hi);r(gp,t);var i=Ae;Object.defineProperty(t,"PostgrestError",{enumerable:!0,get:function(){return i.PostgrestError}});var a=w0;Object.defineProperty(t,"FunctionsHttpError",{enumerable:!0,get:function(){return a.FunctionsHttpError}}),Object.defineProperty(t,"FunctionsFetchError",{enumerable:!0,get:function(){return a.FunctionsFetchError}}),Object.defineProperty(t,"FunctionsRelayError",{enumerable:!0,get:function(){return a.FunctionsRelayError}}),Object.defineProperty(t,"FunctionsError",{enumerable:!0,get:function(){return a.FunctionsError}}),Object.defineProperty(t,"FunctionRegion",{enumerable:!0,get:function(){return a.FunctionRegion}}),r(F0,t);var o=Hi;Object.defineProperty(t,"SupabaseClient",{enumerable:!0,get:function(){return n(o).default}});const u=(d,h,f)=>new s.default(d,h,f);t.createClient=u;function c(){if(typeof window<"u"||typeof process>"u")return!1;const d=process.version;if(d==null)return!1;const h=d.match(/^v(\d+)\./);return h?parseInt(h[1],10)<=18:!1}c()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")})(wu);const mp=kd(wu),cw=jp({__proto__:null,default:mp},[wu]),{PostgrestError:O2,FunctionsHttpError:R2,FunctionsFetchError:z2,FunctionsRelayError:I2,FunctionsError:L2,FunctionRegion:D2,SupabaseClient:M2,createClient:dw,GoTrueAdminApi:F2,GoTrueClient:$2,AuthAdminApi:B2,AuthClient:U2,navigatorLock:H2,NavigatorLockAcquireTimeoutError:V2,lockInternals:W2,processLock:K2,SIGN_OUT_SCOPES:q2,AuthError:G2,AuthApiError:J2,AuthUnknownError:Q2,CustomAuthError:Y2,AuthSessionMissingError:Z2,AuthInvalidTokenResponseError:X2,AuthInvalidCredentialsError:ek,AuthImplicitGrantRedirectError:tk,AuthPKCEGrantCodeExchangeError:rk,AuthRetryableFetchError:nk,AuthWeakPasswordError:sk,AuthInvalidJwtError:ik,isAuthError:ak,isAuthApiError:ok,isAuthSessionMissingError:lk,isAuthImplicitGrantRedirectError:uk,isAuthRetryableFetchError:ck,isAuthWeakPasswordError:dk,RealtimePresence:hk,RealtimeChannel:fk,RealtimeClient:pk,REALTIME_LISTEN_TYPES:gk,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:mk,REALTIME_PRESENCE_LISTEN_EVENTS:yk,REALTIME_SUBSCRIBE_STATES:vk,REALTIME_CHANNEL_STATES:wk}=mp||cw,hw="https://vzudjibddwcvfdnyvhhs.supabase.co",fw="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6dWRqaWJkZHdjdmZkbnl2aGhzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjUwMjk4MDksImV4cCI6MjA4MDYwNTgwOX0.wE8R1mpd2FY6m6d5-Hf3hlCG8OfeCkra6SjUvbt1mD0",V=dw(hw,fw),pw=t=>Array.isArray(t)?t.map(e=>({type:(e==null?void 0:e.type)||"task",title:(e==null?void 0:e.title)||"",durationMin:Number((e==null?void 0:e.durationMin)||0),repetitions:(e==null?void 0:e.repetitions)??null,intensity:(e==null?void 0:e.intensity)||null,instructions:(e==null?void 0:e.instructions)||""})):[],gw=t=>({weekNo:Number((t==null?void 0:t.weekNo)||(t==null?void 0:t.week_no)||1),sessionNo:Number((t==null?void 0:t.sessionNo)||(t==null?void 0:t.session_no)||1),mainExercise:(t==null?void 0:t.mainExercise)||(t==null?void 0:t.main_exercise)||"Basistechnik",secondaryExercises:Array.isArray(t==null?void 0:t.secondaryExercises)?t.secondaryExercises:Array.isArray(t==null?void 0:t.secondary_exercises)?t.secondary_exercises:[],tasks:pw(t==null?void 0:t.tasks),state:(t==null?void 0:t.state)||"open",notes:(t==null?void 0:t.notes)||""}),yp=async({patType:t,analysisSnapshot:e,durationWeeks:r,sessionsPerWeek:n,sessions:s})=>{if(!V)return{ok:!1,error:new Error("Supabase ist nicht konfiguriert.")};try{const i={p_pat_type:t,p_analysis_snapshot:e,p_duration_weeks:Number(r),p_sessions_per_week:Number(n),p_sessions:(s||[]).map(gw)},{data:a,error:o}=await V.rpc("create_training_plan_with_sessions",i);if(o)throw o;return{ok:!0,planId:a}}catch(i){return{ok:!1,error:i}}},pd=[0,1,0,2,0,1,0,1,2,0],gd=(t,e,r)=>e.includes(t)?t:r,mw=t=>t>=.7?"hoch":t>=.4?"mittel":"leicht",yw=()=>({type:"warmup",title:"Warm-up",durationMin:10,instructions:"Lockere Stoßserie, Fokus auf saubere Ansprechposition und Rhythmus."}),vw=(t,e)=>{const r={hoch:24,mittel:18,leicht:12};return{type:"main",title:`Hauptblock: ${t}`,durationMin:e==="hoch"?35:28,repetitions:r[e],intensity:e,instructions:"Dokumentiere Trefferquote pro Serie und halte Pausen kurz (30-45 Sek.)."}},md=(t,e)=>({type:"secondary",title:`Nebenblock ${e}: ${t}`,durationMin:18,repetitions:10,intensity:"mittel",instructions:"Konstanter Ablauf, Fokus auf Präzision statt Tempo."}),ww=()=>({type:"cooldown",title:"Cool-down",durationMin:8,instructions:"Kurze Reflexion: 2 Dinge die gut liefen, 1 Punkt für den nächsten Tag."}),xw=(t,e)=>{if(!e.length)return{name:"Generelle Basistechnik",gapScore:.3,priorityScore:.3};const n=pd[t%pd.length]%e.length;return e[n]},bw=(t,e,r)=>{const n=[...e.map(i=>i==null?void 0:i.name),...r.map(i=>i==null?void 0:i.name)].filter(Boolean),s=[...new Set(n)].filter(i=>i!==t);return s.length>=2?s.slice(0,2):s.length===1?[s[0],"Positionsspiel Basis"]:["Positionsspiel Basis","Stoßroutine Stabilisierung"]},Pu=({topWeaknesses:t=[],topStrengths:e=[],durationWeeks:r=4,sessionsPerWeek:n=3,sessionMix:s="1-main-2-secondary"}={})=>{const i=gd(Number(r),[2,4,6],4),a=gd(Number(n),[2,3,4],3),o=i*a,u=Array.from({length:o},(c,d)=>{const h=Math.floor(d/a)+1,f=d%a+1,y=xw(d,t),w=mw(Number((y==null?void 0:y.gapScore)||0)),x=bw(y==null?void 0:y.name,t,e),b=[yw(),vw((y==null?void 0:y.name)||"Basistechnik",w),md(x[0],1),md(x[1],2),ww()];return{weekNo:h,sessionNo:f,mainExercise:(y==null?void 0:y.name)||"Basistechnik",secondaryExercises:x,sessionMix:s,intensity:w,state:"open",notes:"",tasks:b,meta:{gapScore:Number((y==null?void 0:y.gapScore)||0),priorityScore:Number((y==null?void 0:y.priorityScore)||0)}}});return{durationWeeks:i,sessionsPerWeek:a,sessions:u}},kw=t=>({id:t.id,patType:t.pat_type,status:t.status,analysisSnapshot:t.analysis_snapshot||{},durationWeeks:t.duration_weeks,sessionsPerWeek:t.sessions_per_week,generatedAt:t.generated_at,archivedAt:t.archived_at,createdAt:t.created_at,updatedAt:t.updated_at,sessions:[]}),_w=t=>({id:t.id,planId:t.plan_id,weekNo:t.week_no,sessionNo:t.session_no,mainExercise:t.main_exercise,secondaryExercises:t.secondary_exercises||[],tasks:t.tasks||[],state:t.state||"open",notes:t.notes||"",completedAt:t.completed_at,createdAt:t.created_at,updatedAt:t.updated_at}),Ys=(t,e,r)=>!t||!t.sessions.some(s=>s.id===e)?t:{...t,sessions:t.sessions.map(s=>s.id===e?{...s,...r}:s)},Ew=({user:t,patType:e})=>{const[r,n]=T.useState(null),[s,i]=T.useState([]),[a,o]=T.useState(!1),[u,c]=T.useState(!1),[d,h]=T.useState(""),f=T.useMemo(()=>!!(V&&(t!=null&&t.id)),[t]),y=T.useCallback(async()=>{if(!f||!e){n(null),i([]);return}o(!0),h("");try{const{data:p,error:m}=await V.from("training_plans").select("*").eq("user_id",t.id).eq("pat_type",e).order("generated_at",{ascending:!1});if(m)throw m;const g=(p||[]).map(kw),k=g.map(N=>N.id);let E=new Map;if(k.length){const{data:N,error:C}=await V.from("training_plan_sessions").select("*").in("plan_id",k).order("week_no",{ascending:!0}).order("session_no",{ascending:!0});if(C)throw C;E=(N||[]).reduce((A,U)=>{const Y=_w(U),G=A.get(Y.planId)||[];return G.push(Y),A.set(Y.planId,G),A},new Map)}const S=g.map(N=>({...N,sessions:E.get(N.id)||[]})),j=S.find(N=>N.status==="active")||S[0]||null,_=S.filter(N=>!j||N.id!==j.id);n(j),i(_)}catch(p){h(p.message||"Fehler beim Laden der Trainingspläne.")}finally{o(!1)}},[f,e,t==null?void 0:t.id]);T.useEffect(()=>{y()},[y]);const w=T.useCallback(async({analysis:p,durationWeeks:m=4,sessionsPerWeek:g=3,sessions:k=null})=>{if(!f||!e)return{ok:!1,error:new Error("Supabase oder PAT-Typ nicht verfügbar.")};c(!0),h("");try{const E=k||Pu({topWeaknesses:(p==null?void 0:p.topWeaknesses)||[],topStrengths:(p==null?void 0:p.topStrengths)||[],durationWeeks:m,sessionsPerWeek:g}).sessions,S=await yp({patType:e,analysisSnapshot:p,durationWeeks:m,sessionsPerWeek:g,sessions:E});if(!S.ok)throw S.error;return await y(),{ok:!0,planId:S.planId}}catch(E){return h(E.message||"Fehler beim Speichern des Trainingsplans."),{ok:!1,error:E}}finally{c(!1)}},[f,y,e]),x=T.useCallback(async(p,m)=>{if(!f)return{ok:!1};const g=m==="done"?new Date().toISOString():null,k=r,E=s;n(j=>Ys(j,p,{state:m,completedAt:g})),i(j=>j.map(_=>Ys(_,p,{state:m,completedAt:g})));const{error:S}=await V.from("training_plan_sessions").update({state:m,completed_at:g}).eq("id",p);return S?(n(k),i(E),h(S.message||"Session-Status konnte nicht gespeichert werden."),{ok:!1,error:S}):{ok:!0}},[r,f,s]),b=T.useCallback(async(p,m)=>{if(!f)return{ok:!1};const g={...m},k=r,E=s;n(_=>Ys(_,p,g)),i(_=>_.map(N=>Ys(N,p,g)));const S={};Object.prototype.hasOwnProperty.call(g,"mainExercise")&&(S.main_exercise=g.mainExercise),Object.prototype.hasOwnProperty.call(g,"secondaryExercises")&&(S.secondary_exercises=g.secondaryExercises),Object.prototype.hasOwnProperty.call(g,"tasks")&&(S.tasks=g.tasks),Object.prototype.hasOwnProperty.call(g,"notes")&&(S.notes=g.notes);const{error:j}=await V.from("training_plan_sessions").update(S).eq("id",p);return j?(n(k),i(E),h(j.message||"Session-Änderung konnte nicht gespeichert werden."),{ok:!1,error:j}):{ok:!0}},[r,f,s]);return{activePlan:r,historyPlans:s,loading:a,saving:u,error:d,loadPlans:y,saveGeneratedPlan:w,updateSessionState:x,updateSessionPartial:b}},Sw=(t,e=26)=>t.length>e?`${t.slice(0,e-1)}…`:t;function jw({metrics:t=[]}){const e=[...t].sort((h,f)=>f.priorityScore-h.priorityScore).slice(0,8);if(!e.length)return l.jsx("div",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Kein Gap-Chart verfügbar."});const r=760,n=220,s=24,i=38,a=20,u=a+24+i*e.length,c=Math.max(...e.map(h=>h.priorityScore),.01),d=r-n-s;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 p-4 shadow-sm h-full flex flex-col",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100 mb-3",children:"Gap-Bar-Chart (Priorität)"}),l.jsx("svg",{viewBox:`0 0 ${r} ${u}`,className:"w-full h-auto",role:"img","aria-label":"Gap-Balkendiagramm",children:e.map((h,f)=>{const y=a+f*i,w=h.priorityScore/c*d;return l.jsxs("g",{children:[l.jsx("text",{x:10,y:y+20,className:"fill-gray-700 dark:fill-gray-200",style:{fontSize:12,fontWeight:500},children:Sw(h.name)}),l.jsx("rect",{x:n,y:y+8,width:d,height:16,rx:8,className:"fill-gray-200 dark:fill-gray-800"}),l.jsx("rect",{x:n,y:y+8,width:Math.max(3,w),height:16,rx:8,className:"fill-rose-500"}),l.jsx("text",{x:n+Math.max(8,w)+8,y:y+20,className:"fill-gray-700 dark:fill-gray-300",style:{fontSize:11,fontWeight:600},children:h.priorityScore.toFixed(2)})]},h.name)})})]})}const Zs=(t,e,r,n)=>({x:t+r*Math.cos(n),y:e+r*Math.sin(n)}),Nw=(t,e=16)=>t.length>e?`${t.slice(0,e-1)}…`:t;function Tw({radarSeries:t=[]}){const e=t.slice(0,6);if(!e.length)return l.jsx("div",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Kein Radarprofil verfügbar."});const r=420,n=320,s=r/2,i=n/2,a=105,o=Math.PI*2/e.length,u=(d,h)=>{const f=-Math.PI/2+h*o;return Zs(s,i,a*(Math.max(0,Math.min(1.2,d))/1.2),f)},c=e.map((d,h)=>{const f=u(d.ratio,h);return`${f.x},${f.y}`}).join(" ");return l.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 p-4 shadow-sm h-full flex flex-col",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100 mb-3",children:"Radar-Profil (Ist/Soll)"}),l.jsxs("svg",{viewBox:`0 0 ${r} ${n}`,className:"w-full h-auto max-w-[420px] mx-auto",role:"img","aria-label":"Radarprofil",children:[[.25,.5,.75,1].map(d=>l.jsx("polygon",{points:e.map((h,f)=>{const y=-Math.PI/2+f*o,w=Zs(s,i,a*d,y);return`${w.x},${w.y}`}).join(" "),fill:"none",className:"stroke-gray-300 dark:stroke-gray-700",strokeWidth:"1"},d)),e.map((d,h)=>{const f=-Math.PI/2+h*o,y=Zs(s,i,a+16,f),w=Zs(s,i,a,f);return l.jsxs("g",{children:[l.jsx("line",{x1:s,y1:i,x2:w.x,y2:w.y,className:"stroke-gray-300 dark:stroke-gray-700",strokeWidth:"1"}),l.jsx("text",{x:y.x,y:y.y,textAnchor:"middle",className:"fill-gray-600 dark:fill-gray-300",style:{fontSize:10},children:Nw(d.name)})]},d.name)}),l.jsx("polygon",{points:c,className:"fill-sky-300/40 dark:fill-sky-500/30 stroke-sky-600 dark:stroke-sky-400",strokeWidth:"2"})]})]})}const Pw=t=>Math.round(Math.max(0,Math.min(1.5,t))*100);function Cw({strengths:t=[]}){return t.length?l.jsxs("div",{className:"rounded-2xl border border-emerald-200 dark:border-emerald-900 bg-white dark:bg-gray-900 p-5 shadow-sm",children:[l.jsx("h3",{className:"text-lg font-semibold text-emerald-700 dark:text-emerald-300 mb-4",children:"Top-3 Stärken"}),l.jsx("div",{className:"space-y-3",children:t.map((e,r)=>l.jsxs("div",{className:"rounded-xl border border-emerald-100 dark:border-emerald-900/60 bg-emerald-50/60 dark:bg-emerald-950/20 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("p",{className:"font-semibold text-gray-900 dark:text-gray-100",children:[r+1,". ",e.name]}),l.jsx("span",{className:"text-xs px-2 py-1 rounded-full bg-emerald-200/70 dark:bg-emerald-800/60 text-emerald-800 dark:text-emerald-200 font-semibold",children:Pw(e.strengthScore)})]}),l.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-xs text-gray-600 dark:text-gray-300",children:[l.jsxs("p",{children:["Ist: ",e.actualMean.toFixed(2)]}),l.jsxs("p",{children:["Soll: ",e.soll.toFixed(2)]}),l.jsxs("p",{children:["Trend: ",e.trendDelta.toFixed(2)]})]})]},e.name))})]}):l.jsx("div",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Keine Stärken-Daten verfügbar."})}const yd=t=>{if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(e)},Aw=(t,e)=>t.type!=="main"?t:{...t,intensity:e,repetitions:{hoch:24,mittel:18,leicht:12}[e]||18},Ow=t=>t?"bg-indigo-600 text-white border-indigo-600":"bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-700";function Rw({patType:t,analysis:e,activePlan:r,historyPlans:n,loading:s,saving:i,error:a,onSavePlan:o,onUpdateSessionState:u,onUpdateSessionPartial:c,onReload:d}){const[h,f]=T.useState(4),[y,w]=T.useState(3),[x,b]=T.useState([]),[p,m]=T.useState(""),g=T.useMemo(()=>{const _=x.length,N=x.filter(U=>U.intensity==="hoch").length,C=x.filter(U=>U.intensity==="mittel").length,A=x.filter(U=>U.intensity==="leicht").length;return{total:_,high:N,medium:C,low:A}},[x]),k=()=>{const _=Pu({topWeaknesses:(e==null?void 0:e.topWeaknesses)||[],topStrengths:(e==null?void 0:e.topStrengths)||[],durationWeeks:h,sessionsPerWeek:y,sessionMix:"1-main-2-secondary"});b(_.sessions),m("Neuer Entwurf erstellt. Du kannst jetzt Intensität und Übungen je Session anpassen.")},E=(_,N)=>{b(C=>C.map((A,U)=>{if(U!==_)return A;const Y={...A,...N};return Object.prototype.hasOwnProperty.call(N,"intensity")&&(Y.tasks=Y.tasks.map(G=>Aw(G,N.intensity))),Y}))},S=async()=>{var N;if(!x.length){m("Erstelle zuerst einen Entwurf.");return}const _=await o({analysis:e,durationWeeks:h,sessionsPerWeek:y,sessions:x});if(!(_!=null&&_.ok)){m(((N=_==null?void 0:_.error)==null?void 0:N.message)||"Trainingsplan konnte nicht gespeichert werden.");return}m("Trainingsplan gespeichert. Der vorherige aktive Plan wurde archiviert."),b([])},j=(_,N)=>{const C=_.secondaryExercises.join(", ");return l.jsxs("div",{className:"rounded-xl border border-sky-100 dark:border-sky-900/60 bg-sky-50/60 dark:bg-sky-950/20 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("p",{className:"text-sm font-semibold text-sky-800 dark:text-sky-200",children:["Woche ",_.weekNo," · Einheit ",_.sessionNo]}),l.jsx("span",{className:"text-xs text-sky-700 dark:text-sky-300",children:_.intensity})]}),l.jsxs("div",{className:"grid md:grid-cols-3 gap-2 text-sm",children:[l.jsx("input",{value:_.mainExercise,onChange:A=>E(N,{mainExercise:A.target.value}),className:"px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",placeholder:"Hauptübung"}),l.jsx("input",{value:C,onChange:A=>{const U=A.target.value.split(",").map(Y=>Y.trim()).filter(Boolean).slice(0,2);E(N,{secondaryExercises:U.length===2?U:[...U,"Positionsspiel Basis"].slice(0,2)})},className:"px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",placeholder:"Nebenübungen, getrennt mit Komma"}),l.jsxs("select",{value:_.intensity,onChange:A=>E(N,{intensity:A.target.value}),className:"px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",children:[l.jsx("option",{value:"hoch",children:"hoch"}),l.jsx("option",{value:"mittel",children:"mittel"}),l.jsx("option",{value:"leicht",children:"leicht"})]})]})]},`draft-${N}`)};return l.jsxs("section",{className:"rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 p-5 shadow-sm",children:[l.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3 mb-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:["Trainingsplan (",t,")"]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"1 aktiver Plan + Historie, Session-Status: offen / erledigt / übersprungen."})]}),l.jsx("button",{onClick:d,type:"button",className:"px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-800",children:"Neu laden"})]}),a&&l.jsx("div",{className:"mb-3 rounded-lg border border-red-300 dark:border-red-800 bg-red-50 dark:bg-red-900/30 p-3 text-sm text-red-700 dark:text-red-200",children:a}),l.jsxs("div",{className:"grid md:grid-cols-4 gap-3 mb-4",children:[l.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Dauer",l.jsxs("select",{value:h,onChange:_=>f(Number(_.target.value)),className:"mt-1 w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",children:[l.jsx("option",{value:2,children:"2 Wochen"}),l.jsx("option",{value:4,children:"4 Wochen"}),l.jsx("option",{value:6,children:"6 Wochen"})]})]}),l.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Einheiten/Woche",l.jsxs("select",{value:y,onChange:_=>w(Number(_.target.value)),className:"mt-1 w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",children:[l.jsx("option",{value:2,children:"2"}),l.jsx("option",{value:3,children:"3"}),l.jsx("option",{value:4,children:"4"})]})]}),l.jsx("button",{onClick:k,type:"button",className:"md:self-end px-4 py-2 rounded-lg bg-indigo-600 text-white hover:bg-indigo-700",children:"Plan (neu) generieren"}),l.jsx("button",{onClick:S,type:"button",disabled:i||!x.length,className:"md:self-end px-4 py-2 rounded-lg bg-emerald-600 text-white hover:bg-emerald-700 disabled:opacity-60",children:i?"Speichert…":"Entwurf speichern"})]}),p&&l.jsx("div",{className:"mb-4 rounded-lg border border-indigo-200 dark:border-indigo-800 bg-indigo-50 dark:bg-indigo-900/30 p-3 text-sm text-indigo-700 dark:text-indigo-200",children:p}),x.length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:"Entwurf (teilweise editierbar)"}),l.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Sessions: ",g.total," · hoch ",g.high," · mittel ",g.medium," · leicht ",g.low]})]}),l.jsx("div",{className:"max-h-80 overflow-y-auto space-y-2 pr-1",children:x.map(j)})]}),l.jsxs("div",{className:"grid lg:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"rounded-xl border border-emerald-100 dark:border-emerald-900/60 p-3 bg-emerald-50/50 dark:bg-emerald-950/20",children:[l.jsx("h4",{className:"font-semibold text-emerald-800 dark:text-emerald-200 mb-2",children:"Aktiver Plan"}),s?l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Lädt…"}):r?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-300 mb-2",children:["Generiert: ",yd(r.generatedAt)," · ",r.durationWeeks," Wochen · ",r.sessionsPerWeek," Einheiten/Woche"]}),l.jsx("div",{className:"max-h-80 overflow-y-auto space-y-2 pr-1",children:r.sessions.map(_=>l.jsxs("div",{className:"rounded-lg border border-emerald-200/70 dark:border-emerald-800 bg-white dark:bg-gray-900 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[l.jsxs("p",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["W",_.weekNo," · E",_.sessionNo]}),l.jsx("div",{className:"flex gap-1",children:["open","done","skipped"].map(N=>l.jsx("button",{type:"button",onClick:()=>u(_.id,N),className:`text-xs px-2 py-1 border rounded ${Ow(_.state===N)}`,children:N==="open"?"offen":N==="done"?"erledigt":"übersprungen"},N))})]}),l.jsx("input",{defaultValue:_.mainExercise,onBlur:N=>c(_.id,{mainExercise:N.target.value}),className:"w-full mb-2 px-3 py-2 text-sm rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900"}),l.jsx("input",{defaultValue:_.secondaryExercises.join(", "),onBlur:N=>c(_.id,{secondaryExercises:N.target.value.split(",").map(C=>C.trim()).filter(Boolean).slice(0,2)}),className:"w-full mb-2 px-3 py-2 text-sm rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900"}),l.jsx("textarea",{defaultValue:_.notes||"",onBlur:N=>c(_.id,{notes:N.target.value}),placeholder:"Notiz",className:"w-full px-3 py-2 text-sm rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900",rows:2})]},_.id))})]}):l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Noch kein aktiver Trainingsplan vorhanden."})]}),l.jsxs("div",{className:"rounded-xl border border-gray-200 dark:border-gray-800 p-3 bg-gray-50 dark:bg-gray-950/40",children:[l.jsx("h4",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Plan-Historie"}),n.length?l.jsx("div",{className:"space-y-2 max-h-80 overflow-y-auto pr-1",children:n.map(_=>l.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 p-3",children:[l.jsx("p",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:yd(_.generatedAt)}),l.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:[_.durationWeeks," Wochen · ",_.sessionsPerWeek," Einheiten/Woche · ",_.sessions.length," Sessions"]})]},_.id))}):l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Keine archivierten Pläne vorhanden."})]})]})]})}function zw({trendSeries:t=[]}){if(t.length<2)return l.jsx("div",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Für den Trend werden mindestens 2 Assessments benötigt."});const e=760,r=280,n=50,s=20,i=16,a=52,o=t.map(x=>x.totalPoints),u=Math.min(...o),d=Math.max(...o)-u||1,h=e-n-s,f=r-i-a,y=t.map((x,b)=>{const p=n+b/(t.length-1)*h,m=(x.totalPoints-u)/d,g=i+f-m*f;return{...x,x:p,y:g}}),w=y.map((x,b)=>`${b===0?"M":"L"}${x.x},${x.y}`).join(" ");return l.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 p-4 shadow-sm",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100 mb-3",children:"Trend (Gesamtpunkte)"}),l.jsxs("svg",{viewBox:`0 0 ${e} ${r}`,className:"w-full h-auto",role:"img","aria-label":"Trenddiagramm",children:[l.jsx("line",{x1:n,y1:i,x2:n,y2:i+f,className:"stroke-gray-300 dark:stroke-gray-700",strokeWidth:"1"}),l.jsx("line",{x1:n,y1:i+f,x2:n+h,y2:i+f,className:"stroke-gray-300 dark:stroke-gray-700",strokeWidth:"1"}),l.jsx("path",{d:w,fill:"none",className:"stroke-indigo-500",strokeWidth:"3",strokeLinecap:"round"}),y.map(x=>l.jsxs("g",{children:[l.jsx("circle",{cx:x.x,cy:x.y,r:"4",className:"fill-indigo-500"}),l.jsx("text",{x:x.x,y:x.y-10,textAnchor:"middle",className:"fill-gray-700 dark:fill-gray-200",style:{fontSize:11,fontWeight:600},children:x.totalPoints}),l.jsx("text",{x:x.x,y:r-18,textAnchor:"middle",className:"fill-gray-500 dark:fill-gray-400",style:{fontSize:10},children:x.label})]},x.assessmentId))]})]})}const Iw=t=>Math.round(Math.max(0,Math.min(1.5,t))*100);function Lw({weaknesses:t=[]}){return t.length?l.jsxs("div",{className:"rounded-2xl border border-rose-200 dark:border-rose-900 bg-white dark:bg-gray-900 p-5 shadow-sm",children:[l.jsx("h3",{className:"text-lg font-semibold text-rose-700 dark:text-rose-300 mb-4",children:"Top-3 Schwächen"}),l.jsx("div",{className:"space-y-3",children:t.map((e,r)=>l.jsxs("div",{className:"rounded-xl border border-rose-100 dark:border-rose-900/60 bg-rose-50/60 dark:bg-rose-950/20 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("p",{className:"font-semibold text-gray-900 dark:text-gray-100",children:[r+1,". ",e.name]}),l.jsx("span",{className:"text-xs px-2 py-1 rounded-full bg-rose-200/70 dark:bg-rose-800/60 text-rose-800 dark:text-rose-200 font-semibold",children:Iw(e.priorityScore)})]}),l.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-xs text-gray-600 dark:text-gray-300",children:[l.jsxs("p",{children:["Gap: ",e.gapScore.toFixed(2)]}),l.jsxs("p",{children:["Konstanz: ",e.consistencyScore.toFixed(2)]}),l.jsxs("p",{children:["Trend: ",e.trendDelta.toFixed(2)]})]})]},e.name))})]}):l.jsx("div",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Keine Schwächen-Daten verfügbar."})}function Dw({assessments:t,selectedPatType:e,onPatTypeChange:r,patTypes:n,user:s}){const i=Object.keys(n||{});T.useEffect(()=>{!e&&i.length&&r(i[0])},[r,i,e]);const a=T.useMemo(()=>Kf(t,e,{windowSize:5,missingStrategy:"zero"}),[t,e]),o=t.filter(g=>g.patType===e),u=t.length>0,{activePlan:c,historyPlans:d,loading:h,saving:f,error:y,saveGeneratedPlan:w,updateSessionState:x,updateSessionPartial:b,loadPlans:p}=Ew({user:s,patType:e}),m=({durationWeeks:g,sessionsPerWeek:k,sessions:E})=>w({analysis:a,durationWeeks:g,sessionsPerWeek:k,sessions:E});return l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-cyan-50 via-white to-emerald-50 dark:from-gray-950 dark:via-gray-950 dark:to-gray-900 p-6 text-gray-900 dark:text-gray-100",children:l.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[l.jsxs("section",{className:"rounded-2xl border border-gray-200 dark:border-gray-800 bg-white/90 dark:bg-gray-900/80 backdrop-blur p-5 shadow-sm",children:[l.jsx("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-cyan-700 dark:text-cyan-300",children:"Analyse"}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Wo solltest du besser werden?"}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"Priorisierung nach Gap × Faktor × Konstanz basierend auf den letzten 5 Assessments."})]})}),l.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:i.map(g=>{const k=g===e;return l.jsx("button",{type:"button",onClick:()=>r(g),className:`px-4 py-2 rounded-lg border text-sm font-semibold transition ${k?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 border-gray-900 dark:border-gray-100":"bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:g},g)})}),l.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs",children:[l.jsxs("span",{className:"px-3 py-1 rounded-full border border-cyan-200 dark:border-cyan-800 bg-cyan-50 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-200 font-semibold",children:[l.jsx(Lf,{className:"w-3 h-3 inline-block mr-1"}),"Assessments: ",o.length]}),l.jsxs("span",{className:"px-3 py-1 rounded-full border border-indigo-200 dark:border-indigo-800 bg-indigo-50 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-200 font-semibold",children:[l.jsx(Bf,{className:"w-3 h-3 inline-block mr-1"}),"Analysefenster: ",a.windowedAssessments.length,"/5"]}),a.isLimitedData&&l.jsxs("span",{className:"px-3 py-1 rounded-full border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-900/30 text-amber-700 dark:text-amber-200 font-semibold",children:[l.jsx(ry,{className:"w-3 h-3 inline-block mr-1"}),"Begrenzte Datenbasis"]})]})]}),u?o.length===0?l.jsxs("section",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/80 dark:bg-gray-900/70 p-6 text-center",children:[l.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-1",children:["Keine Bewertungen für ",e]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Wähle einen anderen PAT-Typ oder erstelle eine neue Bewertung."})]}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"grid lg:grid-cols-2 gap-4",children:[l.jsx("div",{className:"h-full",children:l.jsx(jw,{metrics:a.exerciseMetrics})}),l.jsx("div",{className:"h-full",children:l.jsx(Tw,{radarSeries:a.radarSeries})}),l.jsx("div",{className:"lg:col-span-2",children:l.jsx(zw,{trendSeries:a.trendSeries})})]}),l.jsxs("section",{className:"grid lg:grid-cols-2 gap-4",children:[l.jsx(Lw,{weaknesses:a.topWeaknesses}),l.jsx(Cw,{strengths:a.topStrengths})]}),l.jsx(Rw,{patType:e,analysis:a,activePlan:c,historyPlans:d,loading:h,saving:f,error:y,onSavePlan:m,onUpdateSessionState:x,onUpdateSessionPartial:b,onReload:p})]}):l.jsxs("section",{className:"rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/80 dark:bg-gray-900/70 p-6 text-center",children:[l.jsx(ay,{className:"w-10 h-10 mx-auto mb-3 text-gray-400 dark:text-gray-500"}),l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-1",children:"Noch keine Daten für die Analyse"}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:'Lege zuerst eine Bewertung im Bereich "Bewertungen" an.'})]})]})})}const Mw={"PAT Start":[{name:"1) Stoß-Geschwindigkeit",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"2) Stoß-Gradlinigkeit",values:["","","",""],soll:2,durchschnitt:0,faktor:50,points:0},{name:"3) Winkelbälle",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"4) Nachlauf Wirkung",values:["","",""],soll:9,durchschnitt:0,faktor:11.11,points:0},{name:"5) Rücklauf-Wirkung",values:["","",""],soll:7,durchschnitt:0,faktor:14.29,points:0},{name:"6) Kl. Positions-Spiel",subA:["","",""],subB:["","",""],soll:4,durchschnitt:0,faktor:25,points:0},{name:"7) Gr. Pos. Bereich",subA:["","",""],subB:["","",""],soll:5,durchschnitt:0,faktor:20,points:0},{name:"8) Press Bande",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"9) Standardbälle",values:["","","","",""],soll:2,durchschnitt:0,faktor:50,points:0},{name:"10) 8-Ball Situation",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0}],"PAT 1":[{name:"1) Geschwindigkeit",values:["","",""],soll:3.33,durchschnitt:0,faktor:30,points:0,minValue:0,maxValue:4},{name:"2) Geradlinigkeit (Speed 2)",values:["","","",""],soll:2.5,durchschnitt:0,faktor:40,points:0,minValue:0,maxValue:3},{name:"3) Nachlauf",values:["","",""],soll:11,durchschnitt:0,faktor:9.1,points:0,minValue:0,maxValue:12},{name:"4) Rücklauf",values:["","",""],soll:10,durchschnitt:0,faktor:10,points:0,minValue:0,maxValue:12},{name:"5) Kl. Pos.-Bereich",subA:["","",""],subB:["","",""],subLabels:["1","2"],soll:3.33,durchschnitt:0,faktor:30,points:0,minValue:0,maxValue:5},{name:"6) Gr. Pos.-Bereich",subA:["","",""],subB:["","",""],subLabels:["1","2"],soll:3.33,durchschnitt:0,faktor:30,points:0,minValue:0,maxValue:6},{name:"7) Press Bande",subA:["","",""],subB:["","",""],subLabels:["1","2"],soll:4,durchschnitt:0,faktor:25,points:0,subValueRanges:{a:{minValue:0,maxValue:6},b:{minValue:0,maxValue:10}}},{name:"8) Endlos-Übung (Max: 9)",values:["","",""],soll:4.5,durchschnitt:0,faktor:22.22,points:0,minValue:0,maxValue:9},{name:"9) Standardbälle",values:["","","","",""],soll:2,durchschnitt:0,faktor:50,points:0,minValue:0,maxValue:3},{name:"10) 9-Ball Situation 5",values:["","",""],soll:4.5,durchschnitt:0,faktor:22.22,points:0,minValue:0,maxValue:9}],"PAT 2":[{name:"1) Übung PAT 2-1",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"2) Übung PAT 2-2",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"3) Übung PAT 2-3",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0}],"PAT 3":[{name:"1) Übung PAT 3-1",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"2) Übung PAT 3-2",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0},{name:"3) Übung PAT 3-3",values:["","",""],soll:3,durchschnitt:0,faktor:33.33,points:0}]},Yr=t=>t?JSON.parse(JSON.stringify(t)):null,mn=t=>t===null||typeof t>"u"?!1:typeof t=="string"?t.trim()!=="":!0,Fw=(t={})=>t.subA&&t.subB?[...t.subA||[],...t.subB||[]].every(mn):(t.values||[]).every(mn),vp=t=>{if(!t||!mn(t.name)||!mn(t.datum))return!1;const e=t.exercises||[];return e.length?e.every(Fw):!1},wp=t=>t?t.isFinalized?"Dieser Test wurde bereits final abgeschlossen":!mn(t.name)||!mn(t.datum)?"Bitte zuerst Name und Datum ausfüllen":vp(t)?"":"Bitte alle Übungsfelder ausfüllen, bevor du final abschließt":"Kein Test geöffnet",$w=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Date.now().toString(),ao=t=>({id:t.id,patType:t.pat_type,datum:t.datum,name:t.name,exercises:Yr(t.exercises||[]),isFinalized:!!t.is_finalized,finalizedAt:t.finalized_at||null,finalizationReminderSentAt:t.finalization_reminder_sent_at||null}),Bw=(t,e)=>({id:t.id,user_id:e,pat_type:t.patType,datum:t.datum,name:t.name,exercises:Yr(t.exercises),is_finalized:!!t.isFinalized,finalized_at:t.finalizedAt||null,finalization_reminder_sent_at:t.finalizationReminderSentAt||null}),Uw=(t,e,r={})=>{const{onAfterSave:n}=r,[s,i]=T.useState([]),[a,o]=T.useState(null),[u,c]=T.useState(!1),d=T.useMemo(()=>!!V&&!!(e!=null&&e.id),[e]);T.useEffect(()=>{d&&h()},[d]);const h=async()=>{if(d)try{const{data:g,error:k}=await V.from("assessments").select("*").eq("user_id",e.id).order("created_at",{ascending:!1});if(k)throw k;i((g||[]).map(ao))}catch(g){console.error("Fehler beim Laden:",g),alert("Fehler beim Laden der Daten aus Supabase: "+g.message)}},f=g=>{const k={id:$w(),patType:g,datum:new Date().toISOString().split("T")[0],name:"",exercises:Yr(t[g]),isFinalized:!1,finalizedAt:null,finalizationReminderSentAt:null};o(k),c(!1)},y=g=>{o(Yr(g)),c(!1)},w=async({finalize:g=!1}={})=>{if(!(a!=null&&a.name)||!(a!=null&&a.datum))return alert("Bitte Name und Datum ausfüllen"),{ok:!1};if(a!=null&&a.isFinalized&&!g)return alert("Final abgeschlossene Bewertungen können nicht mehr geändert werden."),{ok:!1};if(g){const E=wp(a);if(E||!vp(a))return alert(E||"Bitte alle Felder ausfüllen, bevor du final abschließt."),{ok:!1}}if(!d)return alert("Supabase ist nicht konfiguriert. Bitte .env prüfen."),{ok:!1};const k=s.find(E=>E.id===a.id);try{const E=Yr(a);E.name=E.name.trim(),g&&(E.isFinalized=!0,E.finalizedAt=new Date().toISOString(),E.finalizationReminderSentAt=null);const S=Bw(E,e.id);let j=null,_=[];if(k){const{data:N,error:C}=await V.from("assessments").update(S).eq("id",a.id).eq("user_id",e.id).select().single();if(C)throw C;j=ao(N),_=s.map(A=>A.id===j.id?j:A),i(_),o(j)}else{const{data:N,error:C}=await V.from("assessments").insert(S).select().single();if(C)throw C;j=ao(N),_=[j,...s.filter(A=>A.id!==j.id)],i(_),o(j)}if(typeof n=="function")try{await n({savedAssessment:j,assessments:_})}catch(N){console.warn("Post-save hook failed:",N)}return c(!1),{ok:!0,assessment:j,assessments:_}}catch(E){return alert("Fehler beim Speichern in Supabase: "+E.message),{ok:!1,error:E}}};return{assessments:s,currentAssessment:a,setCurrentAssessment:o,hasUnsavedChanges:u,setHasUnsavedChanges:c,createNewAssessment:f,openAssessment:y,handleSave:async()=>w(),finalizeAssessment:async()=>w({finalize:!0}),deleteAssessment:async g=>{if(!confirm("Möchten Sie diese Bewertung wirklich löschen?"))return;if(!d){alert("Supabase ist nicht konfiguriert. Bitte .env prüfen.");return}const{error:k}=await V.from("assessments").delete().eq("id",g).eq("user_id",e.id);if(k){alert("Fehler beim Löschen: "+k.message);return}i(E=>E.filter(S=>S.id!==g))},updateExerciseValue:(g,k,E,S=null)=>{if(!a||a.isFinalized)return;const j=Yr(a),_=Hf(j.exercises[g],E,S);S==="a"?j.exercises[g].subA[k]=_:S==="b"?j.exercises[g].subB[k]=_:j.exercises[g].values[k]=_;const{durchschnitt:N,points:C}=Wf(j.exercises[g]);j.exercises[g].durchschnitt=N,j.exercises[g].points=C,o(j),c(!0)},calculateTotal:()=>ga((a==null?void 0:a.exercises)||[])}},Hw=t=>{if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}).format(e)};function Vw({assessments:t,loading:e=!1,error:r}){var s,i,a,o,u,c,d,h;const n=T.useMemo(()=>{if(e||!t)return{total:0,average:0,latest:null,best:null};if(!(t!=null&&t.length))return{total:0,average:0,latest:null,best:null};const f=t.map(b=>({...b,totalPoints:Math.round(ga(b.exercises||[]))})),y=f.reduce((b,p)=>b+(p.totalPoints||0),0)/(f.length||1),w=f[0],x=f.reduce((b,p)=>!b||(p.totalPoints||0)>(b.totalPoints||0)?p:b,null);return{total:f.length,average:Math.round(y),latest:w,best:x}},[t]);return l.jsxs("div",{className:"bg-white/90 dark:bg-gray-900/80 border border-gray-100 dark:border-gray-800 rounded-2xl shadow-lg p-6 mb-6",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-emerald-600 dark:text-emerald-300",children:"Live Übersicht"}),l.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:"Aktuelle Statistik"}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Basis: alle Bewertungen, geladen beim Seitenaufruf"})]}),l.jsx("span",{className:"rounded-full border border-emerald-200/70 dark:border-emerald-700 px-3 py-1 text-xs font-semibold text-emerald-700 dark:text-emerald-200 bg-emerald-50 dark:bg-emerald-900/40",children:e?"Lädt…":"Stand: jetzt"})]}),r&&l.jsx("div",{className:"mb-3 rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/30 p-3 text-sm text-red-700 dark:text-red-200",children:r}),e?l.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(f=>l.jsx("div",{className:"h-28 rounded-2xl border border-gray-200/60 dark:border-gray-800 bg-gray-100 dark:bg-gray-800 animate-pulse"},f))}):n.total===0?l.jsx("div",{className:"rounded-xl border border-dashed border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800/60 p-4 text-sm text-gray-600 dark:text-gray-300",children:"Noch keine Bewertungen vorhanden. Lege eine neue Bewertung an, um hier Live-Werte zu sehen."}):l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[l.jsxs("div",{className:"rounded-2xl border border-emerald-200/70 dark:border-emerald-800 bg-gradient-to-br from-emerald-50 via-white to-emerald-50 dark:from-emerald-900/30 dark:via-gray-900 dark:to-emerald-900/20 p-4 shadow-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm font-semibold text-emerald-700 dark:text-emerald-200",children:"Bewertungen"}),l.jsx(Lf,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-300","aria-hidden":"true"})]}),l.jsx("p",{className:"mt-3 text-3xl font-bold text-emerald-800 dark:text-emerald-100",children:n.total}),l.jsx("p",{className:"text-xs text-emerald-700/80 dark:text-emerald-200/70",children:"In der PAT Datenbank hinterlegt"})]}),l.jsxs("div",{className:"rounded-2xl border border-sky-200/70 dark:border-sky-800 bg-gradient-to-br from-sky-50 via-white to-sky-50 dark:from-sky-900/30 dark:via-gray-900 dark:to-sky-900/20 p-4 shadow-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm font-semibold text-sky-700 dark:text-sky-200",children:"Ø Gesamtpunkte"}),l.jsx(Uf,{className:"h-4 w-4 text-sky-600 dark:text-sky-300","aria-hidden":"true"})]}),l.jsx("p",{className:"mt-3 text-3xl font-bold text-sky-800 dark:text-sky-100",children:n.average}),l.jsx("p",{className:"text-xs text-sky-700/80 dark:text-sky-200/70",children:"Durchschnitt aller Assessments"})]}),l.jsxs("div",{className:"rounded-2xl border border-indigo-200/70 dark:border-indigo-800 bg-gradient-to-br from-indigo-50 via-white to-indigo-50 dark:from-indigo-900/30 dark:via-gray-900 dark:to-indigo-900/20 p-4 shadow-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm font-semibold text-indigo-700 dark:text-indigo-200",children:"Letzte Bewertung"}),l.jsx(cy,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300","aria-hidden":"true"})]}),l.jsx("p",{className:"mt-3 text-lg font-semibold text-indigo-900 dark:text-indigo-100",children:((s=n.latest)==null?void 0:s.name)||((i=n.latest)==null?void 0:i.patType)||"Unbenannt"}),l.jsxs("p",{className:"text-xs text-indigo-700/80 dark:text-indigo-200/70",children:[Hw((a=n.latest)==null?void 0:a.datum)," · ",((o=n.latest)==null?void 0:o.patType)||"PAT"]})]}),l.jsxs("div",{className:"rounded-2xl border border-amber-200/70 dark:border-amber-800 bg-gradient-to-br from-amber-50 via-white to-amber-50 dark:from-amber-900/30 dark:via-gray-900 dark:to-amber-900/20 p-4 shadow-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm font-semibold text-amber-700 dark:text-amber-200",children:"Top Ergebnis"}),l.jsx(iy,{className:"h-4 w-4 text-amber-600 dark:text-amber-300","aria-hidden":"true"})]}),l.jsx("p",{className:"mt-3 text-3xl font-bold text-amber-800 dark:text-amber-100",children:((u=n.best)==null?void 0:u.totalPoints)??0}),l.jsxs("p",{className:"text-xs text-amber-700/80 dark:text-amber-200/70",children:[((c=n.best)==null?void 0:c.name)||((d=n.best)==null?void 0:d.patType)||"—"," · ",((h=n.best)==null?void 0:h.patType)||"PAT"]})]})]})]})}const Ww=(t={})=>{const e={name:t.name||"",soll:t.soll??0,faktor:t.faktor??0};t.subA&&t.subB?(e.subA=t.subA,e.subB=t.subB,t.subLabels&&(e.subLabels=t.subLabels)):e.values=t.values||[];const{durchschnitt:r,points:n}=Wf({...e,values:e.values||[]});return{...e,durchschnitt:r,points:n}},Kw=t=>({id:t.id,patType:t.pat_type,datum:t.datum,name:t.name,exercises:(t.exercises||[]).map(Ww)}),xp=t=>Array.isArray(t)?t[0]||null:t||null,qw=t=>{if(typeof window>"u")return`?share=${t}`;const e=new URL(window.location.origin+window.location.pathname);return e.searchParams.set("share",t),e.toString()},bp=t=>((t==null?void 0:t.message)||"").includes("Tests are hidden in the profile")?new Error("Deine Tests sind im Profil aktuell nicht sichtbar."):t,Gw=async t=>{if(!t)throw new Error("Kein Test zum Teilen gefunden.");if(!V)throw new Error("Supabase ist nicht konfiguriert.");const{data:e,error:r}=await V.rpc("create_or_get_assessment_share",{p_assessment_id:t.id});if(r)throw bp(r);const n=xp(e);if(!(n!=null&&n.share_token))throw new Error("Kein Freigabetoken erhalten.");return{token:n.share_token,url:qw(n.share_token)}},Jw=async(t=[])=>{if(!V)throw new Error("Supabase ist nicht konfiguriert.");if(!t.length)return{};const{data:e,error:r}=await V.from("assessment_shares").select("assessment_id, share_token").in("assessment_id",t);if(r)throw r;return(e||[]).reduce((n,s)=>(n[s.assessment_id]=s.share_token,n),{})},Qw=async t=>{if(!V)throw new Error("Supabase ist nicht konfiguriert.");const{error:e}=await V.from("assessment_shares").delete().eq("assessment_id",t);if(e)throw e},Yw=async t=>{if(!V)throw new Error("Supabase ist nicht konfiguriert.");const{data:e,error:r}=await V.rpc("get_shared_assessment",{p_share_token:t});if(r)throw bp(r);const n=xp(e);return n?Kw(n):null},Zw=async t=>{var e;return typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.writeText)?!1:(await navigator.clipboard.writeText(t),!0)},Xw=()=>typeof window<"u"&&["localhost","127.0.0.1"].includes(window.location.hostname);function ex({user:t,activeTab:e="assessments",onEditingStateChange:r,testsVisible:n=!1,isProfileLoading:s=!1}){const i=T.useMemo(()=>Mw||{},[]),a=Object.keys(i),[o,u]=T.useState(!0),[c,d]=T.useState(()=>a[0]||""),[h,f]=T.useState(!1),[y,w]=T.useState({});T.useEffect(()=>{r==null||r(!o)},[r,o]),T.useEffect(()=>{a.length&&(!c||!a.includes(c))&&d(a[0])},[a,c]);const x=T.useCallback(async({savedAssessment:O,assessments:K})=>{var q;if(!(O!=null&&O.patType)||!(K!=null&&K.length))return;const ee=Kf(K,O.patType,{windowSize:5,missingStrategy:"zero"});if(!ee.windowedAssessments.length)return;const Ke=Pu({topWeaknesses:ee.topWeaknesses,topStrengths:ee.topStrengths,durationWeeks:4,sessionsPerWeek:3,sessionMix:"1-main-2-secondary"}),vt=await yp({patType:O.patType,analysisSnapshot:ee,durationWeeks:4,sessionsPerWeek:3,sessions:Ke.sessions});vt.ok||console.warn("Automatische Plan-Neugenerierung fehlgeschlagen:",((q=vt.error)==null?void 0:q.message)||vt.error)},[]),{assessments:b,currentAssessment:p,setCurrentAssessment:m,hasUnsavedChanges:g,setHasUnsavedChanges:k,createNewAssessment:E,openAssessment:S,handleSave:j,finalizeAssessment:_,deleteAssessment:N,updateExerciseValue:C,calculateTotal:A}=Uw(i,t,{onAfterSave:x}),U=b,Y=T.useMemo(()=>U.map(O=>O.id),[U]),G=T.useMemo(()=>b.some(O=>O.id===(p==null?void 0:p.id)),[b,p==null?void 0:p.id]),ye=!!(p!=null&&p.id&&y[p.id]),he=!!(p!=null&&p.isFinalized);T.useEffect(()=>{let O=!1;return(async()=>{if(!(t!=null&&t.id)||!Y.length){w({});return}try{const ee=await Jw(Y);O||w(ee)}catch(ee){console.warn("Freigaben konnten nicht geladen werden:",ee),O||w({})}})(),()=>{O=!0}},[t==null?void 0:t.id,Y]);const Re=()=>{g&&!he?f(!0):u(!0)},R=async()=>{const O=await j();return O!=null&&O.ok&&alert("Erfolgreich gespeichert!"),O},M=T.useCallback(async()=>{const O=await _();O!=null&&O.ok&&alert("Bewertung wurde final abgeschlossen und ist jetzt nur noch lesbar.")},[_]),H=async()=>{if(!(p!=null&&p.name)||!(p!=null&&p.datum)){alert("Bitte Name und Datum ausfüllen bevor Sie speichern");return}const O=await R();O!=null&&O.ok&&(f(!1),u(!0))},X=()=>{f(!1),k(!1),u(!0)},ie=()=>{f(!1)},St=T.useCallback(async O=>{try{const{token:K,url:ee}=await Gw(O),Ke=(O==null?void 0:O.name)||(O==null?void 0:O.patType)||"dieser Test",vt=Xw()?` - -Hinweis: Der Link zeigt aktuell auf localhost und ist nur erreichbar, wenn die App von außen erreichbar ist.`:"";w(q=>({...q,[O.id]:K}));try{if(await Zw(ee)){alert(`Freigabelink für "${Ke}" wurde in die Zwischenablage kopiert.${vt}`);return}}catch(q){console.warn("Kopieren in die Zwischenablage fehlgeschlagen:",q)}window.prompt(`Freigabelink für "${Ke}"${vt}`,ee)}catch(K){alert(`Freigabelink konnte nicht erstellt werden: ${K.message||K}`)}},[]),We=T.useCallback(async O=>{const K=(O==null?void 0:O.name)||(O==null?void 0:O.patType)||"dieser Test";try{await Qw(O.id),w(ee=>{const Ke={...ee};return delete Ke[O.id],Ke}),alert(`Freigabe für "${K}" wurde aufgehoben.`)}catch(ee){alert(`Freigabe konnte nicht aufgehoben werden: ${ee.message||ee}`)}},[]),lr=T.useCallback(()=>{if(p){if(s){alert("Profil wird noch geladen. Bitte versuche es gleich noch einmal.");return}if(!n){alert('Aktiviere im Profil zuerst "Tests sichtbar", bevor du Tests teilst.');return}if(!G){alert("Bitte den Test zuerst speichern, bevor du ihn teilen kannst.");return}if(g){alert("Bitte erst speichern, damit der aktuelle Stand geteilt wird.");return}St(p)}},[p,St,g,G,s,n]),at=T.useCallback(()=>{!p||!ye||We(p)},[p,We,ye]),jt=G?g?"Bitte erst speichern, damit der aktuelle Stand geteilt wird":s?"Profil wird geladen":n?"":'Aktiviere im Profil "Tests sichtbar"':"Bitte zuerst speichern",L=wp(p);return o?e==="analysis"?l.jsx(Dw,{assessments:U,selectedPatType:c,onPatTypeChange:d,patTypes:i,user:t}):l.jsx(jy,{patTypes:i,assessments:U,overview:l.jsx(Vw,{assessments:U}),assessmentShareTokens:y,testsVisible:n,selectedPatType:c,onPatTypeChange:d,onCreate:O=>{E(O),u(!1)},onEdit:O=>{S(O),u(!1)},onDelete:N,getPatTypeColor:al,getAchievement:ol}):l.jsx(Hy,{currentAssessment:p,hasUnsavedChanges:g,onBack:Re,onSave:R,onAssessmentChange:m,onUpdateExercise:C,onMarkDirty:()=>k(!0),showSaveDialog:h,onSaveAndExit:H,onDiscardAndExit:X,onCancelExit:ie,getPatTypeColor:al,getAchievement:ol,calculateTotal:A,isReadOnly:he,canFinalize:!L,finalizeDisabledReason:L,onFinalize:M,isShareActive:ye,testsVisible:n,canShare:n&&!s&&G&&!g,shareDisabledReason:jt,onShare:lr,onRevokeShare:at})}function tx({onAuth:t,themeToggle:e,onBack:r}){const[n,s]=T.useState("login"),[i,a]=T.useState(""),[o,u]=T.useState(""),[c,d]=T.useState(""),[h,f]=T.useState(""),[y,w]=T.useState(!1),x=async b=>{if(b.preventDefault(),!!V){w(!0),f(""),d("");try{if(n==="login"){const{data:p,error:m}=await V.auth.signInWithPassword({email:i,password:o});m?f(m.message):(d("Erfolgreich angemeldet"),t==null||t(p.session))}else{const{data:p,error:m}=await V.auth.signUp({email:i,password:o});m?f(m.message):p.session?t==null||t(p.session):d("Registrierung abgeschlossen. Prüfe dein Postfach zur Bestätigung.")}}catch(p){f(p.message)}finally{w(!1)}}};return l.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-sky-100 via-blue-50 to-emerald-100 dark:from-gray-950 dark:via-gray-900 dark:to-gray-950 flex items-center justify-center p-6 text-gray-900 dark:text-gray-100",children:[l.jsx("div",{className:"absolute top-4 left-4 flex items-center gap-3",children:r&&l.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-2 rounded-full border border-gray-200/70 bg-white/70 px-3 py-2 text-sm font-medium text-gray-800 shadow-sm backdrop-blur transition hover:-translate-y-[1px] hover:shadow-md dark:border-gray-800 dark:bg-gray-900/70 dark:text-gray-100",children:[l.jsx(ny,{className:"h-4 w-4"}),"Zurück"]})}),l.jsx("div",{className:"absolute top-4 right-4",children:e}),l.jsxs("div",{className:"w-full max-w-lg bg-white/90 dark:bg-gray-900/80 backdrop-blur rounded-2xl shadow-xl border border-white/70 dark:border-gray-800",children:[l.jsxs("div",{className:"px-8 py-6 border-b border-gray-100 dark:border-gray-800",children:[l.jsx("p",{className:"text-sm uppercase tracking-wide text-indigo-600 dark:text-indigo-300 font-semibold",children:"PAT Stats"}),l.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-gray-100 mt-1",children:"Anmelden oder registrieren"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-300 mt-2",children:"Melde dich mit deinem PAT-Test Konto an, um deine Bewertungen sicher zu verwalten."})]}),l.jsxs("form",{onSubmit:x,className:"px-8 py-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l.jsx("button",{type:"button",onClick:()=>s("login"),className:`px-4 py-2 rounded-full transition ${n==="login"?"bg-indigo-600 text-white":"text-gray-600 dark:text-gray-300 hover:bg-indigo-50 dark:hover:bg-indigo-900/40"}`,children:"Login"}),l.jsx("button",{type:"button",onClick:()=>s("register"),className:`px-4 py-2 rounded-full transition ${n==="register"?"bg-emerald-600 text-white":"text-gray-600 dark:text-gray-300 hover:bg-emerald-50 dark:hover:bg-emerald-900/40"}`,children:"Registrieren"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"E-Mail"}),l.jsx("input",{type:"email",value:i,onChange:b=>a(b.target.value),required:!0,className:"mt-1 w-full px-4 py-3 rounded-lg border border-gray-200 dark:border-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-white dark:bg-gray-800 dark:text-gray-100",placeholder:"you@example.com"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Passwort"}),l.jsx("input",{type:"password",value:o,onChange:b=>u(b.target.value),required:!0,className:"mt-1 w-full px-4 py-3 rounded-lg border border-gray-200 dark:border-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-white dark:bg-gray-800 dark:text-gray-100",placeholder:"••••••••"})]}),h&&l.jsx("div",{className:"p-3 rounded-lg bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-200 text-sm",children:h}),c&&l.jsx("div",{className:"p-3 rounded-lg bg-emerald-50 dark:bg-emerald-900/30 border border-emerald-200 dark:border-emerald-800 text-emerald-700 dark:text-emerald-200 text-sm",children:c}),l.jsx("button",{type:"submit",disabled:y,className:"w-full py-3 rounded-lg font-semibold text-white bg-gradient-to-r from-indigo-600 to-emerald-600 shadow-md hover:shadow-lg transition disabled:opacity-60 disabled:cursor-not-allowed",children:y?"Wird gesendet...":n==="login"?"Einloggen":"Konto erstellen"})]})]})]})}const rx=[{label:"Datenschutz",path:"/datenschutz"},{label:"Impressum",path:"/impressum"},{label:"Kontakt",path:"/kontakt"}];function kp({children:t,themeToggle:e,onGetStarted:r,onNavigate:n,navLinks:s=[],currentPath:i="/"}){return l.jsxs("div",{className:"public-site",children:[l.jsx("div",{className:"public-site__backdrop"}),l.jsx("div",{className:"public-site__grid"}),l.jsxs("header",{className:"public-site__nav",children:[l.jsxs("button",{type:"button",className:"public-site__brand",onClick:()=>n("/"),children:[l.jsx("span",{className:"public-site__brand-mark",children:l.jsx(Bf,{className:"h-5 w-5","aria-hidden":"true"})}),l.jsxs("span",{className:"public-site__brand-copy",children:[l.jsx("span",{className:"public-site__brand-title",children:"PAT Manager"}),l.jsx("span",{className:"public-site__brand-subtitle",children:"Digitale Leistungsdiagnostik für Billard"})]})]}),l.jsx("nav",{className:"public-site__nav-links","aria-label":"Öffentliche Navigation",children:s.map(a=>l.jsx("button",{type:"button",className:`public-site__nav-link${a.active?" is-active":""}`,onClick:a.onClick,children:a.label},a.label))}),l.jsxs("div",{className:"public-site__nav-actions",children:[e&&l.jsx("div",{className:"public-site__theme-toggle",children:e}),l.jsxs("button",{type:"button",className:"public-site__cta public-site__cta--nav",onClick:r,children:["Anmelden",l.jsx(Bi,{className:"h-4 w-4","aria-hidden":"true"})]})]})]}),l.jsx("main",{className:"public-site__main",children:t}),l.jsx("footer",{className:"public-site__footer",children:l.jsxs("div",{className:"public-site__footer-inner",children:[l.jsxs("div",{className:"public-site__footer-links",children:[l.jsx("button",{type:"button",className:"public-site__footer-link",onClick:r,children:"Anmelden"}),rx.map(a=>l.jsx("button",{type:"button",className:`public-site__footer-link${i===a.path?" is-active":""}`,onClick:()=>n(a.path),children:a.label},a.path))]}),l.jsx("p",{className:"public-site__footer-meta",children:"PAT Manager · Öffentliche Seiten"})]})})]})}const nx=[{title:"Smarte Auswertungen",body:"Automatische Berechnungen für jede PAT-Kategorie mit klaren Kennzahlen, Trends und Fortschrittsbildern.",icon:$f},{title:"Sichere Speicherung",body:"Nutzergebundene Datenhaltung, finale Abschlüsse und kontrollierte Freigaben für Trainer, Verein und Staff.",icon:Ff},{title:"Team-ready",body:"Bewertungen erfassen, öffnen, teilen und wieder sperren, ohne Excel-Chaos oder doppelte Listen.",icon:ky},{title:"Performance-Insights",body:"Schwächen erkennen, Entwicklung verfolgen und Training gezielt auf die kritischen Übungen ausrichten.",icon:Uf},{title:"Mobile Erfassung",body:"Direkte Eingabe am Tisch mit klaren Grenzen pro Übung und sofortiger Berechnung der Punkte.",icon:vy},{title:"Export & Reports",body:"Saubere PDF-Ausgabe, öffentliche Freigabelinks und strukturierte Ergebnisansichten für Athleten und Staff.",icon:Mf}],sx=[{title:"Vorlage wählen",body:"PAT Start, PAT 1, PAT 2 oder PAT 3 auswählen und die Bewertung sofort anlegen."},{title:"Werte erfassen",body:"Einzelwerte direkt eingeben, automatisch begrenzen lassen und live berechnen."},{title:"Abschließen & teilen",body:"Bewertung final abschließen, als PDF exportieren oder per Link freigeben."}],ix=[{value:"100%",label:"Digitaler Ablauf"},{value:"0€",label:"Kostenlos starten"},{value:"SSL",label:"Verschlüsselte Übertragung"},{value:"24/7",label:"Jederzeit verfügbar"}],Xs=t=>{if(typeof document>"u")return;const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth",block:"start"})};function ax({onGetStarted:t,onNavigate:e,themeToggle:r}){return l.jsxs(kp,{themeToggle:r,onGetStarted:t,onNavigate:e,currentPath:"/",navLinks:[{label:"Features",onClick:()=>Xs("features")},{label:"So funktioniert es",onClick:()=>Xs("how-it-works")},{label:"Statistiken",onClick:()=>Xs("stats")}],children:[l.jsxs("section",{className:"public-hero",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"public-hero__badge",children:[l.jsx($f,{className:"h-4 w-4","aria-hidden":"true"}),"Jetzt live verfügbar"]}),l.jsxs("h1",{className:"public-hero__title",children:["Professionelle",l.jsx("span",{className:"public-hero__title-accent",children:" PAT-Test Verwaltung"})]}),l.jsx("p",{className:"public-hero__copy",children:"Erfasse, analysiere und verfolge Pool Ability Tests digital. Von der Eingabe bis zum Report läuft alles in einer klaren Oberfläche für Trainer, Vereine und Spieler."}),l.jsxs("div",{className:"public-hero__actions",children:[l.jsxs("button",{type:"button",className:"public-site__button",onClick:t,children:["Kostenlos testen",l.jsx(Bi,{className:"h-4 w-4","aria-hidden":"true"})]}),l.jsx("button",{type:"button",className:"public-site__button--secondary",onClick:()=>Xs("features"),children:"Mehr erfahren"})]}),l.jsxs("div",{className:"public-hero__meta",children:[l.jsxs("span",{className:"public-chip",children:[l.jsx(sl,{className:"h-4 w-4 text-blue-300","aria-hidden":"true"}),"PAT Start bis PAT 3"]}),l.jsxs("span",{className:"public-chip",children:[l.jsx(sl,{className:"h-4 w-4 text-blue-300","aria-hidden":"true"}),"Teilen, PDF und Finalisierung"]})]})]}),l.jsxs("div",{className:"public-preview__panel",children:[l.jsxs("div",{className:"public-preview__head",children:[l.jsx("strong",{children:"Live Übersicht"}),l.jsx("span",{className:"public-preview__status",children:"Online"})]}),l.jsxs("div",{className:"public-preview__grid",children:[l.jsxs("div",{className:"public-preview__card",children:[l.jsx("div",{className:"public-preview__label",children:"PAT 1 · Übung 1"}),l.jsx("div",{className:"public-preview__value public-preview__value--accent",children:"4 / 4"}),l.jsx("div",{className:"public-progress",children:l.jsx("span",{style:{width:"100%"}})})]}),l.jsxs("div",{className:"public-preview__card",children:[l.jsx("div",{className:"public-preview__label",children:"Gesamtpunktzahl"}),l.jsx("div",{className:"public-preview__value public-preview__value--success",children:"87%"}),l.jsx("div",{className:"public-progress",children:l.jsx("span",{style:{width:"87%"}})})]})]}),l.jsxs("div",{className:"public-preview__meta",children:[l.jsxs("div",{className:"public-preview__meta-card",children:[l.jsx("div",{className:"public-preview__label",children:"Aktive Bewertung"}),l.jsx("strong",{children:"Stefan · PAT 1"})]}),l.jsxs("div",{className:"public-preview__meta-card",children:[l.jsx("div",{className:"public-preview__label",children:"Status"}),l.jsx("strong",{children:"Freigabe aktiv"})]}),l.jsxs("div",{className:"public-preview__meta-card",children:[l.jsx("div",{className:"public-preview__label",children:"Workflow"}),l.jsx("strong",{children:"Erfassen · Finalisieren"})]}),l.jsxs("div",{className:"public-preview__meta-card",children:[l.jsx("div",{className:"public-preview__label",children:"Auswertung"}),l.jsx("strong",{children:"PDF & Analyse"})]})]})]})]}),l.jsxs("section",{className:"public-section",id:"features",children:[l.jsxs("div",{className:"public-section__header",children:[l.jsx("span",{className:"public-section__tag",children:"Funktionen"}),l.jsx("h2",{className:"public-section__title",children:"Alles, was du für PAT-Tests brauchst"}),l.jsx("p",{className:"public-section__copy",children:"Von der digitalen Erfassung bis zur teamweiten Auswertung. Die neue Startseite orientiert sich an deiner Vorlage, sitzt aber sauber im bestehenden Produktstil."})]}),l.jsx("div",{className:"public-features",children:nx.map(({title:n,body:s,icon:i})=>l.jsxs("article",{className:"public-card",children:[l.jsx("span",{className:"public-card__icon",children:l.jsx(i,{className:"h-5 w-5","aria-hidden":"true"})}),l.jsx("h3",{className:"public-card__title",children:n}),l.jsx("p",{className:"public-card__copy",children:s})]},n))})]}),l.jsxs("section",{className:"public-section",id:"how-it-works",children:[l.jsxs("div",{className:"public-section__header",children:[l.jsx("span",{className:"public-section__tag",children:"Prozess"}),l.jsx("h2",{className:"public-section__title",children:"So läuft PAT mit uns"}),l.jsx("p",{className:"public-section__copy",children:"Von der Testvorlage bis zum Report bleibt der Ablauf kurz, klar und sicher."})]}),l.jsx("div",{className:"public-steps",children:sx.map((n,s)=>l.jsxs("article",{className:"public-card public-step",children:[l.jsx("span",{className:"public-step__number",children:s+1}),l.jsx("h3",{className:"public-step__title",children:n.title}),l.jsx("p",{className:"public-step__copy",children:n.body})]},n.title))})]}),l.jsxs("section",{className:"public-section",id:"stats",children:[l.jsxs("div",{className:"public-section__header",children:[l.jsx("span",{className:"public-section__tag",children:"Statistiken"}),l.jsx("h2",{className:"public-section__title",children:"Klare Vorteile für den Alltag am Tisch"}),l.jsx("p",{className:"public-section__copy",children:"Weniger Listenpflege, weniger Medienbrüche und deutlich schneller von der Eingabe zur Auswertung."})]}),l.jsx("div",{className:"public-stats",children:ix.map(n=>l.jsxs("article",{className:"public-stats__card",children:[l.jsx("div",{className:"public-stats__value",children:n.value}),l.jsx("div",{className:"public-stats__label",children:n.label})]},n.label))})]}),l.jsx("section",{className:"public-section",children:l.jsxs("div",{className:"public-cta-panel",children:[l.jsxs("div",{children:[l.jsx("span",{className:"public-section__tag",children:"Bereit?"}),l.jsx("h2",{className:"public-cta-panel__title",children:"Starte deine nächste PAT-Bewertung ohne Tabellenchaos."}),l.jsx("p",{className:"public-cta-panel__copy",children:"Login öffnen, Bewertung anlegen, Werte eintragen und Ergebnisse direkt sauber speichern oder teilen."})]}),l.jsxs("div",{className:"public-cta-panel__actions",children:[l.jsxs("button",{type:"button",className:"public-site__button",onClick:t,children:["Jetzt kostenlos ausprobieren",l.jsx(Bi,{className:"h-4 w-4","aria-hidden":"true"})]}),l.jsx("button",{type:"button",className:"public-site__button--secondary",onClick:()=>e("/kontakt"),children:"Kontakt öffnen"})]})]})})]})}const ox=t=>{if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}).format(e)},lx=t=>t===""||t===null||typeof t>"u"?"—":t,oo=({label:t,values:e=[]})=>l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"min-w-10 text-sm font-semibold text-gray-600 dark:text-gray-300",children:t}),e.map((r,n)=>l.jsx("span",{className:"min-w-12 rounded-md border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 px-3 py-2 text-center text-sm font-medium text-gray-800 dark:text-gray-100",children:lx(r)},`${t}-${n}`))]});function ux({assessment:t}){if(!t)return null;const e=ga(t.exercises||[]),r=ol(t.patType,e);return l.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-950 p-6 text-gray-900 dark:text-gray-100",children:l.jsx("div",{className:"max-w-5xl mx-auto",children:l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 border border-gray-200 dark:border-gray-800",children:[l.jsxs("div",{className:"flex justify-between items-start gap-4 mb-6 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-sky-700 dark:text-sky-300",children:"Geteilter Test"}),l.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-gray-100 mt-2",children:t.name||"PAT Test"}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mt-2",children:"Dieser Link zeigt nur diesen einen Test im Nur-Lesen-Modus."})]}),l.jsx("span",{className:`px-4 py-2 rounded-full text-sm font-semibold ${al(t.patType)}`,children:t.patType})]}),l.jsxs("div",{className:"grid md:grid-cols-3 gap-3 mb-6 bg-gray-50 dark:bg-gray-800 p-4 rounded-lg",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Datum"}),l.jsx("p",{className:"mt-1 text-lg font-semibold",children:ox(t.datum)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Gesamtpunkte"}),l.jsx("p",{className:"mt-1 text-lg font-semibold text-green-600 dark:text-green-300",children:e.toFixed(0)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Bewertung"}),l.jsx("p",{className:"mt-1 text-lg font-semibold",children:r.name})]})]}),(t.exercises||[]).map((n,s)=>{var i,a;return l.jsxs("div",{className:"mb-6 border-b pb-4 border-gray-200 dark:border-gray-800",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-bold text-lg text-gray-700 dark:text-gray-200",children:n.name}),l.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Soll ",n.soll," · Faktor ",n.faktor]})]}),l.jsxs("div",{className:"rounded-lg bg-green-50 dark:bg-green-900/30 px-4 py-2",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-green-700 dark:text-green-300",children:"Points"}),l.jsx("p",{className:"text-xl font-bold text-green-700 dark:text-green-200",children:(n.points||0).toFixed(0)})]})]}),l.jsx("div",{className:"space-y-3",children:n.subA&&n.subB?l.jsxs(l.Fragment,{children:[l.jsx(oo,{label:((i=n.subLabels)==null?void 0:i[0])||"a)",values:n.subA}),l.jsx(oo,{label:((a=n.subLabels)==null?void 0:a[1])||"b)",values:n.subB})]}):l.jsx(oo,{label:"Werte",values:n.values||[]})}),l.jsxs("div",{className:"grid md:grid-cols-3 gap-3 mt-4",children:[l.jsxs("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-900/30 px-4 py-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-blue-700 dark:text-blue-300",children:"Durchschnitt"}),l.jsx("p",{className:"text-lg font-semibold text-blue-700 dark:text-blue-200",children:(n.durchschnitt||0).toFixed(2)})]}),l.jsxs("div",{className:"rounded-lg bg-gray-50 dark:bg-gray-800 px-4 py-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Soll"}),l.jsx("p",{className:"text-lg font-semibold",children:n.soll})]}),l.jsxs("div",{className:"rounded-lg bg-gray-50 dark:bg-gray-800 px-4 py-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Faktor"}),l.jsx("p",{className:"text-lg font-semibold",children:n.faktor})]})]})]},`${n.name}-${s}`)}),l.jsxs("div",{className:"mt-6 bg-gradient-to-r from-green-100 to-blue-100 dark:from-gray-800 dark:to-gray-700 p-6 rounded-lg",children:[l.jsxs("div",{className:"flex justify-between items-center gap-4 flex-wrap mb-4",children:[l.jsx("span",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:"Ergebnis"}),l.jsx("span",{className:"text-4xl font-bold text-green-600 dark:text-green-300",children:e.toFixed(0)})]}),l.jsxs("div",{className:`mt-4 px-6 py-4 rounded-lg ${r.color} ${r.text} text-center`,children:[l.jsx("p",{className:"text-2xl font-bold",children:r.name}),r.subtitle&&l.jsx("p",{className:"text-lg mt-2",children:r.subtitle})]})]})]})})})}function cx({shareToken:t,themeToggle:e}){const[r,n]=T.useState(null),[s,i]=T.useState(!0),[a,o]=T.useState("");return T.useEffect(()=>{let u=!1;return(async()=>{if(!t){o("Freigabelink fehlt."),i(!1);return}i(!0),o("");try{const d=await Yw(t);if(u)return;if(!d){n(null),o("Dieser Freigabelink ist ungültig, deaktiviert oder aktuell nicht öffentlich sichtbar.");return}n(d)}catch(d){if(u)return;n(null),o(d.message||"Geteilter Test konnte nicht geladen werden.")}finally{u||i(!1)}})(),()=>{u=!0}},[t]),l.jsxs("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-950 text-gray-900 dark:text-gray-100",children:[l.jsx("div",{className:"absolute top-4 right-4 z-20",children:e}),s?l.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:l.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 shadow-sm p-6",children:"Geteilter Test wird geladen..."})}):a?l.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:l.jsxs("div",{className:"max-w-xl w-full bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 shadow-sm p-6",children:[l.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-rose-600 dark:text-rose-300",children:"Freigabe"}),l.jsx("h1",{className:"text-2xl font-bold mt-2",children:"Geteilter Test nicht verfügbar"}),l.jsx("p",{className:"text-gray-600 dark:text-gray-300 mt-3",children:a})]})}):l.jsx(ux,{assessment:r})]})}const vd={"/datenschutz":{tag:"Datenschutz",title:"Datenschutzhinweise für PAT Manager",intro:"Diese Seite ist als saubere öffentliche Datenschutzansicht angelegt. Inhaltlich solltest du sie vor dem Livegang noch mit deinen finalen Verantwortlichen, Kontaktdaten und juristisch geprüften Angaben vervollständigen.",cards:[{title:"Verantwortliche Stelle",body:"Trage hier den Vereinsnamen, die verantwortliche Person oder das Unternehmen ein, das PAT Manager betreibt. Ergänze außerdem Anschrift und eine echte Kontaktmöglichkeit."},{title:"Welche Daten verarbeitet werden",body:"Je nach Nutzung können Anmeldedaten, Bewertungsdaten, Freigaben, PDF-Exporte und technische Zugriffsdaten verarbeitet werden. Bei geteilten Bewertungen sehen anonyme Nutzer nur die explizit freigegebene Ansicht."},{title:"Zweck der Verarbeitung",body:"Die Verarbeitung dient der Durchführung von PAT-Bewertungen, der Auswertung von Leistungsdaten, der Teamorganisation sowie dem sicheren Speichern und Teilen einzelner Testergebnisse."},{title:"Speicherung und Dienstleister",body:"Die Anwendung nutzt Supabase als technische Datenbasis. Prüfe vor dem produktiven Einsatz die Auftragsverarbeitung, Speicherregion und die tatsächlich eingesetzten Zusatzdienste."},{title:"Rechte der betroffenen Personen",items:["Auskunft über gespeicherte Daten","Berichtigung unrichtiger Daten","Löschung oder Einschränkung der Verarbeitung","Widerspruch gegen einzelne Verarbeitungen","Beschwerde bei der zuständigen Aufsichtsbehörde"]},{title:"Wichtiger Hinweis",wide:!0,notice:"Diese Datenschutzseite ist eine strukturierte Vorlage. Vor der Veröffentlichung müssen echte Kontaktdaten, Rechtsgrundlagen, Speicherfristen und Dienstleisterangaben ergänzt und geprüft werden."}]},"/impressum":{tag:"Impressum",title:"Impressum für PAT Manager",intro:"Die Seite ist technisch fertig eingebunden, damit deine Footer- und Navigationslinks nicht mehr ins Leere laufen. Die konkreten Pflichtangaben musst du jetzt noch mit deinen echten Daten ergänzen.",cards:[{title:"Angaben gemäß § 5 TMG",body:"Ergänze hier Betreibername, Rechtsform, vertretungsberechtigte Person sowie die vollständige ladungsfähige Anschrift."},{title:"Kontakt",body:"Trage hier eine echte E-Mail-Adresse, optional Telefonnummer und weitere Kommunikationswege ein, unter denen Nutzer dich rechtssicher erreichen können."},{title:"Verantwortlich für den Inhalt",body:"Wenn erforderlich, ergänze die verantwortliche Person nach § 18 Abs. 2 MStV mit Name und Anschrift."},{title:"Haftungs- und Linkhinweise",body:"Wenn du externe Dienste, Inhalte oder Verlinkungen nutzt, prüfe bitte deine endgültigen Texte zu Haftung, Urheberrecht und externen Verweisen."},{title:"Wichtiger Hinweis",wide:!0,notice:"Dieses Impressum enthält absichtlich keine erfundenen Unternehmensdaten. Bitte ersetze die Platzhalter vor Veröffentlichung durch deine echten Pflichtangaben."}]},"/kontakt":{tag:"Kontakt",title:"Kontakt und Rückfragen",intro:"Hier ist eine öffentliche Kontaktseite im Stil der neuen Startseite eingebunden. Wenn du reale Ansprechpartner und Kanäle ergänzt, kannst du sie direkt produktiv nutzen.",cards:[{title:"Produkt & Demo",body:"Nutze diesen Bereich für Anfragen zu PAT Manager, Demos, Vereinsnutzung oder Einführung im Trainingsalltag."},{title:"Technischer Support",body:"Hier kannst du später Support-Zeiten, E-Mail-Adresse, Reaktionszeiten oder einen Helpdesk-Link ergänzen."},{title:"Kooperationen",body:"Platz für Kontakte zu Vereinen, Trainern, Leistungszentren oder Partnern, die das System einsetzen oder testen möchten."},{title:"Empfohlene nächste Ergänzungen",items:["Echte Support-E-Mail oder Kontaktformular verknüpfen","Antwortzeiten und Zuständigkeiten ergänzen","Optional Telefonnummer oder Vereinsanschrift angeben"]},{title:"Schnellzugriff",wide:!0,action:!0,body:"Wenn du direkt in die Anwendung wechseln willst, kannst du von hier aus sofort den Login öffnen und weiterarbeiten."}]}};function dx({path:t,onGetStarted:e,onNavigate:r,themeToggle:n}){const s=vd[t]||vd["/kontakt"];return l.jsx(kp,{themeToggle:n,onGetStarted:e,onNavigate:r,currentPath:t,navLinks:[{label:"Startseite",onClick:()=>r("/")},{label:"Datenschutz",onClick:()=>r("/datenschutz"),active:t==="/datenschutz"},{label:"Impressum",onClick:()=>r("/impressum"),active:t==="/impressum"},{label:"Kontakt",onClick:()=>r("/kontakt"),active:t==="/kontakt"}],children:l.jsxs("section",{className:"public-page",children:[l.jsxs("div",{className:"public-page__hero",children:[l.jsxs("span",{className:"public-section__tag",children:[t==="/kontakt"?l.jsx(fy,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(dy,{className:"h-4 w-4","aria-hidden":"true"}),s.tag]}),l.jsx("h1",{className:"public-page__title",children:s.title}),l.jsx("p",{className:"public-page__copy",children:s.intro})]}),l.jsx("div",{className:"public-page__grid",children:s.cards.map(i=>l.jsxs("article",{className:`public-page__card${i.wide?" public-page__card--wide":""}`,children:[l.jsx("h2",{className:"public-page__card-title",children:i.title}),i.body&&l.jsx("p",{className:"public-page__card-copy",children:i.body}),i.items&&l.jsx("ul",{className:"public-page__list",children:i.items.map(a=>l.jsx("li",{children:a},a))}),i.notice&&l.jsx("div",{className:"public-page__notice",children:i.notice}),i.action&&l.jsxs("div",{className:"public-hero__actions",children:[l.jsxs("button",{type:"button",className:"public-site__button",onClick:e,children:["Login öffnen",l.jsx(Bi,{className:"h-4 w-4","aria-hidden":"true"})]}),l.jsx("button",{type:"button",className:"public-site__button--secondary",onClick:()=>r("/"),children:"Zur Startseite"})]})]},i.title))}),l.jsx("section",{className:"public-section",children:l.jsxs("div",{className:"public-cta-panel",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"public-section__tag",children:[l.jsx(Ff,{className:"h-4 w-4","aria-hidden":"true"}),"Öffentliche Seiten fertig"]}),l.jsx("h2",{className:"public-cta-panel__title",children:"Die verlinkten Info-Seiten sind jetzt Bestandteil der App."}),l.jsx("p",{className:"public-cta-panel__copy",children:"Ergänze jetzt noch deine echten Vereins-, Kontakt- und Rechtstexte. Danach laufen Navigation und Footer sauber ohne Platzhalterlinks."})]}),l.jsxs("div",{className:"public-cta-panel__actions",children:[l.jsx("button",{type:"button",className:"public-site__button",onClick:()=>r("/"),children:"Zur Startseite"}),l.jsx("button",{type:"button",className:"public-site__button--secondary",onClick:e,children:"App öffnen"})]})]})})]})})}const hx=[{code:"AR",name:"Argentinien"},{code:"AU",name:"Australien"},{code:"AT",name:"Österreich"},{code:"BE",name:"Belgien"},{code:"BA",name:"Bosnien und Herzegowina"},{code:"BR",name:"Brasilien"},{code:"BG",name:"Bulgarien"},{code:"CA",name:"Kanada"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CO",name:"Kolumbien"},{code:"CZ",name:"Tschechien"},{code:"DK",name:"Dänemark"},{code:"DE",name:"Deutschland"},{code:"EE",name:"Estland"},{code:"FI",name:"Finnland"},{code:"FR",name:"Frankreich"},{code:"GR",name:"Griechenland"},{code:"GB",name:"Vereinigtes Königreich"},{code:"IE",name:"Irland"},{code:"IS",name:"Island"},{code:"IN",name:"Indien"},{code:"IT",name:"Italien"},{code:"JP",name:"Japan"},{code:"HR",name:"Kroatien"},{code:"LV",name:"Lettland"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Litauen"},{code:"LU",name:"Luxemburg"},{code:"MT",name:"Malta"},{code:"MX",name:"Mexiko"},{code:"NL",name:"Niederlande"},{code:"NZ",name:"Neuseeland"},{code:"NO",name:"Norwegen"},{code:"PL",name:"Polen"},{code:"PT",name:"Portugal"},{code:"RO",name:"Rumänien"},{code:"SE",name:"Schweden"},{code:"CH",name:"Schweiz"},{code:"SK",name:"Slowakei"},{code:"SI",name:"Slowenien"},{code:"ES",name:"Spanien"},{code:"ZA",name:"Südafrika"},{code:"KR",name:"Südkorea"},{code:"TR",name:"Türkei"},{code:"UA",name:"Ukraine"},{code:"HU",name:"Ungarn"},{code:"US",name:"Vereinigte Staaten"}],_p=[...hx].sort((t,e)=>t.name.localeCompare(e.name,"de")),Cu=(t="")=>{const e=String(t||"").trim().toUpperCase();return e&&_p.find(r=>r.code===e)||null},Mn=(t="")=>{const e=Cu(t);return e?e.name:String(t||"").trim()};var fx=["title"],px=["title"],gx=["title"],mx=["title"],yx=["title"],vx=["title"],wx=["title"],xx=["title"],bx=["title"],kx=["title"],_x=["title"],Ex=["title"],Sx=["title"],jx=["title"],Nx=["title"],Tx=["title"],Px=["title"],Cx=["title"],Ax=["title"],Ox=["title"],Rx=["title"],zx=["title"],Ix=["title"],Lx=["title"],Dx=["title"],Mx=["title"],Fx=["title"],$x=["title"],Bx=["title"],Ux=["title"],Hx=["title"],Vx=["title"],Wx=["title"],Kx=["title"],qx=["title"],Gx=["title"],Jx=["title"],Qx=["title"],Yx=["title"],Zx=["title"],Xx=["title"],eb=["title"],tb=["title"],rb=["title"],nb=["title"],sb=["title"],ib=["title"],ab=["title"];function $(){return $=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ob(t,e){if(t==null)return{};var r={},n=Object.keys(t),s,i;for(i=0;i=0)&&(r[s]=t[s]);return r}var lb=function(e){var r=e.title,n=B(e,fx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h512v342H0z"}),v.createElement("path",{fill:"#338AF3",d:"M0 0h512v114H0zm0 228h512v114H0z"}),v.createElement("circle",{fill:"#FFDA44",stroke:"#d6ab00",strokeWidth:5,cx:256.5,cy:171,r:40}))},ub=function(e){var r=e.title,n=B(e,px);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 114h513v114H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 0h513v114H0zm0 228h513v114H0z"}))},cb=function(e){var r=e.title,n=B(e,gx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#00008b",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"m188 212.6 11 22.9 24.7-5.7-11 22.8 19.9 15.8-24.8 5.6.1 25.4-19.9-15.9-19.8 15.9.1-25.4-24.8-5.6 19.9-15.8-11.1-22.8 24.8 5.7zm197.9 28.5 5.2 10.9 11.8-2.7-5.3 10.9 9.5 7.5-11.8 2.6v12.2l-9.4-7.6-9.5 7.6.1-12.2-11.8-2.6 9.5-7.5-5.3-10.9 11.8 2.7zm-48.6-116 5.2 10.9 11.8-2.7-5.3 10.9 9.5 7.5-11.8 2.7v12.1l-9.4-7.6-9.5 7.6.1-12.1-11.9-2.7 9.5-7.5-5.3-10.9L332 136zm48.6-66.2 5.2 10.9 11.8-2.7-5.3 10.9 9.5 7.5-11.8 2.7v12.1l-9.4-7.6-9.5 7.6.1-12.1-11.8-2.7 9.5-7.5-5.3-10.9 11.8 2.7zm42.5 49.7 5.2 10.9 11.8-2.7-5.3 10.9 9.5 7.5-11.8 2.6V150l-9.4-7.6-9.5 7.6v-12.2l-11.8-2.6 9.5-7.5-5.3-10.9 11.8 2.7zM398 166.5l4.1 12.7h13.3l-10.8 7.8 4.2 12.7-10.8-7.9-10.8 7.9 4.1-12.7-10.7-7.8h13.3z",fill:"#FFF"}),v.createElement("path",{fill:"#00008b",d:"M0 0h256.5v171H0z"}),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M256.5 0v30.6l-45.3 25.2h45.3v59.4h-59.2l59.2 32.9V171h-26.7l-73.7-40.9V171h-55.7v-48.7L12.8 171H0v-30.6l45.3-25.2H0V55.8h59.2L0 22.9V0h26.7l73.7 40.9V0h55.7v48.7L243.7 0z"}),v.createElement("path",{d:"M156.1 115.2 256.5 171v-15.8l-72-40zm-55.7-59.4L0 0v15.8l72 40z"})),v.createElement("g",{fill:"red"},v.createElement("path",{d:"M144.3 0h-32.1v69.5H0v32h112.2V171h32.1v-69.5h112.2v-32H144.3z"}),v.createElement("path",{d:"M156.1 115.2 256.5 171v-15.8l-72-40zm-84.1 0-72 40V171l100.4-55.8zm28.4-59.4L0 0v15.8l72 40zm84.1 0 72-40V0L156.1 55.8z"})))},db=function(e){var r=e.title,n=B(e,mx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#10338C",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#F6C500",d:"M99.9 0h342v342"}),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M19.9 21.1 40.3 6.2 60.9 21 54 0H26.7z"}),v.createElement("path",{d:"M92.3 25.5 84.4 1.3l-7.8 24.2H51.3l20.5 14.8-7.8 24 20.4-14.8L105 64.3l-7.9-24 20.5-14.9z"}),v.createElement("path",{d:"m136.3 69.2-7.8-24-7.8 24H95.5l20.4 14.9-7.8 24 20.4-14.8 20.6 14.8-7.8-24 20.4-14.9z"}),v.createElement("path",{d:"m179.4 112.3-7.8-24.1-7.8 24.1h-25.3l20.5 14.9-7.8 24 20.4-14.8 20.6 14.8-7.9-24 20.5-15z"}),v.createElement("path",{d:"m222.5 155.3-7.8-24-7.8 24h-25.4l20.6 15-7.8 24 20.4-14.9 20.4 14.9-7.8-24 20.6-15z"}),v.createElement("path",{d:"m265.6 198.4-7.8-24-7.8 24h-25.4l20.6 14.9-7.8 24.1 20.4-14.9 20.4 14.9-7.8-24.2 20.5-14.8z"}),v.createElement("path",{d:"m308.7 241.5-7.9-24-7.8 24h-25.3l20.5 14.8-7.9 24.2 20.6-14.9 20.4 14.8-7.8-24.1 20.5-14.8z"}),v.createElement("path",{d:"m351.7 284.6-7.8-24.2-7.8 24.2h-25.3l20.4 14.8-7.8 24.1 20.5-14.9 20.5 14.9-7.8-24.1 20.4-14.8z"}),v.createElement("path",{d:"m387 303.5-7.9 24.1-25.3.1 19.8 14.3h26.6l19.9-14.4h-25.3z"})))},hb=function(e){var r=e.title,n=B(e,yx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#fdda25",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"M0 0h171v342H0z"}),v.createElement("path",{fill:"#ef3340",d:"M342 0h171v342H342z"}))},fb=function(e){var r=e.title,n=B(e,vx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#00966e",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#d62612",d:"M0 228h513v114H0z"}))},pb=function(e){var r=e.title,n=B(e,wx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#009b3a",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#fedf00",d:"m256.5 19.3 204.9 151.4L256.5 322 50.6 170.7z"}),v.createElement("circle",{fill:"#FFF",cx:256.5,cy:171,r:80.4}),v.createElement("path",{fill:"#002776",d:"M215.9 165.7c-13.9 0-27.4 2.1-40.1 6 .6 43.9 36.3 79.3 80.3 79.3 27.2 0 51.3-13.6 65.8-34.3-24.9-31-63.2-51-106-51zm119 20.3c.9-5 1.5-10.1 1.5-15.4 0-44.4-36-80.4-80.4-80.4-33.1 0-61.5 20.1-73.9 48.6 10.9-2.2 22.1-3.4 33.6-3.4 46.8.1 89 19.5 119.2 50.6z"}))},gb=function(e){var r=e.title,n=B(e,xx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"M0 0h142v342H0zm371 0h142v342H371zm-64.5 206 50.4-25.2-25.2-12.6V143l-50.4 25.2 25.2-50.4h-25.2L256.1 80l-25.2 37.8h-25.2l25.2 50.4-50.4-25.2v25.2l-25.2 12.6 50.4 25.2-12.6 25.2h50.4V269h25.2v-37.8h50.4z",fill:"red"}))},mb=function(e){var r=e.title,n=B(e,bx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 768 512"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"red",d:"M0 0h768v512H0V0z"}),v.createElement("path",{fill:"#FFF",d:"M336 96h96v112h112v96H432v112h-96V304H224v-96h112V96z"}))},yb=function(e){var r=e.title,n=B(e,kx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M196 0h317v171H196z"}),v.createElement("path",{fill:"#0037A1",d:"M0 0h196v171H0z"}),v.createElement("path",{fill:"#FFF",d:"M98 24.5 113.1 71H162l-39.6 28.7 15.2 46.5L98 117.5l-39.6 28.7 15.2-46.5L34 71h48.9z"}))},vb=function(e){var r=e.title,n=B(e,_x);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"m226.8 239.2-9.7-15.6-17.9 4.4 11.9-14.1-9.7-15.6 17.1 6.9 11.8-14.1-1.3 18.4 17.1 6.9-17.9 4.4zM290.6 82l-10.1 15.4 11.6 14.3-17.7-4.8-10.1 15.5-1-18.4-17.7-4.8 17.2-6.6-1-18.4 11.6 14.3zm-54.4-56.6-2 18.3 16.8 7.6-18 3.8-2 18.3-9.2-16-17.9 3.8 12.3-13.7-9.2-15.9 16.8 7.5zm56.6 136.4-14.9 10.9 5.8 17.5-14.9-10.8-14.9 11 5.6-17.6-14.9-10.7 18.4-.1 5.6-17.6 5.8 17.5zM115 46.3l17.3 53.5h56.2l-45.4 32.9 17.3 53.5-45.4-33-45.5 33 17.4-53.5-45.5-32.9h56.3z",fill:"#FFDA44"}))},wb=function(e){var r=e.title,n=B(e,Ex);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFDA44",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 256.5h513V342H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 171h513v85.5H0z"}))},xb=function(e){var r=e.title,n=B(e,Sx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#11457e",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#d7141a",d:"M513 171v171H0l256.5-171z"}),v.createElement("path",{fill:"#FFF",d:"M513 0v171H256.5L0 0z"}))},bb=function(e){var r=e.title,n=B(e,jx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#FFDA44",d:"M0 228h513v114H0z"}))},kb=function(e){var r=e.title,n=B(e,Nx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#c60c30",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M190 0h-60v140H0v60h130v142h60V200h323v-60H190z"}))},_b=function(e){var r=e.title,n=B(e,Tx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#111",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#368FD8",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#FFF",d:"M0 228h513v114H0z"}))},Eb=function(e){var r=e.title,n=B(e,Px);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22.5 15"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h22.5v15H0V0z"}),v.createElement("path",{fill:"#D03433",d:"M0 0h22.5v4H0V0zm0 11h22.5v4H0v-4z"}),v.createElement("path",{fill:"#FBCA46",d:"M0 4h22.5v7H0V4z"}),v.createElement("path",{fill:"#FFF",d:"M7.8 7h1v.5h-1V7z"}),v.createElement("path",{fill:"#A41517",d:"M7.2 8.5c0 .3.3.5.6.5s.6-.2.6-.5L8.5 7H7.1l.1 1.5zM6.6 7c0-.3.2-.5.4-.5h1.5c.3 0 .5.2.5.4V7l-.1 1.5c-.1.6-.5 1-1.1 1-.6 0-1-.4-1.1-1L6.6 7z"}),v.createElement("path",{fill:"#A41517",d:"M6.8 7.5h2V8h-.5l-.5 1-.5-1h-.5v-.5zM5.3 6h1v3.5h-1V6zm4 0h1v3.5h-1V6zm-2.5-.5c0-.3.2-.5.5-.5h1c.3 0 .5.2.5.5v.2c0 .2-.1.3-.3.3H7c-.1 0-.2-.1-.2-.2v-.3z"}))},Sb=function(e){var r=e.title,n=B(e,Cx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#2E52B2",d:"M513 129.3V212H203.7v130H121V212H0v-82.7h121V0h82.7v129.3z"}))},jb=function(e){var r=e.title,n=B(e,Ax);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#00318A",d:"M0 0h171v342H0z"}),v.createElement("path",{fill:"#D80027",d:"M342 0h171v342H342z"}))},Nb=function(e){var r=e.title,n=B(e,Ox);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M0 0h513v341.3H0V0z"}),v.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zM200.3 111.3 0 0v31.5l143.7 79.8h56.6z"})),v.createElement("path",{d:"M393.8 230 513 295.7V230H393.8zm-82.1 0L513 341.3v-31.5L369.3 230h-57.6zm146.9 111.3-147-81.7v81.7h147zM90.3 230 0 280.2V230h90.3zm110 14.2v97.2H25.5l174.8-97.2zm-82.1-132.9L0 45.6v65.7h118.2zm82.1 0L0 0v31.5l143.7 79.8h56.6zM53.4 0l147 81.7V0h-147zm368.3 111.3L513 61.1v50.2h-91.3zm-110-14.2V0h174.9L311.7 97.1z",fill:"#012169"}),v.createElement("g",{fill:"#c8102e"},v.createElement("path",{d:"M288 0h-64v138.7H0v64h224v138.7h64V202.7h224v-64H288V0z"}),v.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zm-168 0L0 309.9v31.5L200.3 230h-56.6zm56.6-118.7L0 0v31.5l143.7 79.8h56.6zm168 0L513 31.5V0L311.7 111.3h56.6z"})))},Tb=function(e){var r=e.title,n=B(e,Rx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("g",{fill:"#0d5eaf"},v.createElement("path",{d:"M0 0h513v38H0zm0 76h513v38H0zm0 76h513v38H0zm0 76h513v38H0zm0 76h513v38H0z"}),v.createElement("path",{d:"M0 0h190v190H0z"})),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M0 76h190v38H0z"}),v.createElement("path",{d:"M76 0h38v190H76z"})))},Pb=function(e){var r=e.title,n=B(e,zx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 228h513v114H0z"}),v.createElement("path",{d:"M309.3 113.2v-44l17.5-14.4 17.7 14.4v44zm-105.6 0v-44l-17.3-14.4-17.9 14.4v44zm35.2 0v-44l17.6-14.4 17.6 14.4v44z",fill:"#338AF3"}),v.createElement("path",{d:"M309.3 113.2h-35.2v-44l17.5-14.4 17.7 14.4zm-70.4 0h-35.2v-44l17.5-14.4 17.7 14.4z",fill:"#0052B4"}),v.createElement("path",{stroke:"#D80027",fill:"#FFF",d:"M168.5 113.2v101.9c0 24.3 14.4 46.2 35.4 59.4 21.3 13.4 42.1 14.7 52.6 14.7s31.4-1.7 52.6-14.8c21-13 35.4-35.1 35.4-59.3V113.2h-176z"}),v.createElement("path",{d:"M168.5 113.2h35.2v35.2h-35.2zm70.4 0h35.2v35.2h-35.2zm70.4 0h35.2v35.2h-35.2zm-105.6 35.2h35.2v35.2h-35.2zm70.4 0h35.2v35.2h-35.2zm-105.6 35.2h35.2v35.2h-35.2zm35.2 35.2h35.2V254h-35.2zm35.2-35.2h35.2v35.2h-35.2zm70.4 0h35.2v35.2h-35.2zm-35.2 35.2h35.2V254h-35.2zm35.2 55.5c8.6-5.4 16.2-12.3 22-20.3h-22v20.3zM181.7 254c5.8 8 13.3 14.9 22 20.4V254h-22zm57.2 0v33.7c7.2 1.2 13.3 1.5 17.6 1.5 4.3 0 10.4-.3 17.6-1.6V254h-35.2z",fill:"#D80027"}))},Cb=function(e){var r=e.title,n=B(e,Ix);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#6DA544",d:"M0 228h513v114H0z"}))},Ab=function(e){var r=e.title,n=B(e,Lx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#6DA544",d:"M0 0h171v342H0z"}),v.createElement("path",{fill:"#FF9811",d:"M342 0h171v342H342z"}))},Ob=function(e){var r=e.title,n=B(e,Dx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#ff6820",d:"M0 0h513v114H0V0z"}),v.createElement("path",{fill:"#FFF",d:"M0 114h513v114H0V114z"}),v.createElement("path",{fill:"#046a38",d:"M0 228h513v114H0V228z"}),v.createElement("path",{fill:"none",stroke:"#07038d",strokeWidth:4,d:"M256.5 136.8c18.9 0 34.2 15.3 34.2 34.2s-15.3 34.2-34.2 34.2-34.2-15.3-34.2-34.2 15.3-34.2 34.2-34.2z"}),v.createElement("path",{d:"m265.3 138.2-17.6 65.7m17.6-65.7-17.6 65.7m25.8-62.3-34 58.9m41-53.5-48 48m53.4-41L227 188m62.3-25.8-65.7 17.6m66.9-8.8h-68m66.8 8.8-65.7-17.6m62.3 25.8L227 154m53.5 41-48-48m41 53.4-34-58.9m25.8 62.3-17.6-65.7m8.8 66.9v-68m-8.8 66.8 17.6-65.7m-25.8 62.3 34-58.9m-41 53.5 48.1-48.1M227.1 188l58.9-34m-62.3 25.8 65.7-17.6m-66.9 8.8h68m-66.8-8.8 65.7 17.6M227.1 154l58.9 34m-53.5-41 48.1 48.1m-41.1-53.5 34 58.9m-25.8-62.3 17.6 65.7",stroke:"#07038d",strokeWidth:2}))},Rb=function(e){var r=e.title,n=B(e,Mx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#0052B4",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M513 210.6H202.2v130.7h-79.8V210.6H0v-79.8h122.4V0h79.8v130.8H513v18.5l-1 42.7z"}),v.createElement("path",{fill:"#D80027",d:"M513 149.3V192H183.7v149.3H141V192H0v-42.7h141V0h42.7v149.3z"}))},zb=function(e){var r=e.title,n=B(e,Fx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#F4F5F0",d:"M342 0H0v341.3h512V0z"}),v.createElement("path",{fill:"#008C45",d:"M0 0h171v342H0z"}),v.createElement("path",{fill:"#CD212A",d:"M342 0h171v342H342z"}))},Ib=function(e){var r=e.title,n=B(e,$x);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h512v342H0z"}),v.createElement("circle",{fill:"#D80027",cx:256.5,cy:171,r:96}))},Lb=function(e){var r=e.title,n=B(e,Bx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"M84.6 107.8 132 36.6m-29.7 83 47.4-71.1m-29.6 83 47.4-71.1m177.9 221.3 47.4-71.1m-29.6 82.9 47.4-71.1m-29.6 83 47.4-71.1M132 305.4l-47.4-71.1m65.2 59.2-47.4-71.1m65.2 59.3-47.4-71.1m272.6-79.1-47.4-71.1m65.2 59.2-47.4-71.1m65.2 59.3L381 36.6",stroke:"#000",strokeWidth:14.25}),v.createElement("path",{d:"m357.3 238.2 59.3 39.5m-299.4-13.8L135 252m222.3-148.2L378 90m17.8-11.9 17.8-11.9",stroke:"#FFF",strokeWidth:12.5}),v.createElement("circle",{fill:"#CA163A",cx:256.5,cy:171,r:85.5}),v.createElement("path",{fill:"#0E4896",d:"M185.3 123.6c-13.1 19.6-7.8 46.2 11.9 59.3s46.2 7.8 59.3-11.9 39.6-24.9 59.3-11.9c19.6 13.1 24.9 39.6 11.9 59.3-26.2 39.3-79.3 49.9-118.6 23.7s-49.9-79.3-23.8-118.5z"}))},Db=function(e){var r=e.title,n=B(e,Ux);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 0h513v171H0z"}),v.createElement("path",{fill:"#FFDA44",d:"M149.3 98.1c0-14-11.3-25.3-25.3-25.3-6.5 0-12.4 2.4-16.9 6.4V64.4h8.4V47.5h-8.4v-8.4H90.3v8.4h-8.4v16.9h8.4v14.9c-4.5-4-10.4-6.4-16.9-6.4-14 0-25.3 11.3-25.3 25.3 0 7.5 3.3 14.2 8.4 18.8v14.9h84.3V117c5.3-4.7 8.5-11.5 8.5-18.9z"}))},Mb=function(e){var r=e.title,n=B(e,Hx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#6DA544",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFDA44",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 228h513v114H0z"}))},Fb=function(e){var r=e.title,n=B(e,Vx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#338AF3",d:"M0 228h513v114H0z"}))},$b=function(e){var r=e.title,n=B(e,Wx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{className:"prefix__st1",d:"M0 0h513v127.6H0zm0 214.4h513V342H0z",fill:"#A2001D"}))},Bb=function(e){var r=e.title,n=B(e,Kx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#cf142b",d:"M256 0h256.5v342H256z"}),v.createElement("path",{stroke:"#cf142b",strokeWidth:10,d:"M101.2 68.2V33H66v35.2H30.8v35.2H66v35.2h35.2v-35.2h35.2V68.2z"}),v.createElement("path",{fill:"#fff",stroke:"#acacac",strokeWidth:5,d:"M101.2 68.2V33H66v35.2H30.8v35.2H66v35.2h35.2v-35.2h35.2V68.2z"}),v.createElement("circle",{cx:85,cy:85,r:26,fill:"none",stroke:"#acacac",strokeWidth:5}),v.createElement("circle",{cx:85,cy:85,r:18,fill:"#dedede",stroke:"#acacac",strokeWidth:5}))},Ub=function(e){var r=e.title,n=B(e,qx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#dc2339",d:"M342 0H0v341.3h513V0z"}),v.createElement("path",{fill:"#11865d",d:"M0 0h171v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M171 0h171v342H171z"}),v.createElement("path",{fill:"#8C9157",d:"M195.8 171.2c0 21.6 11.5 41.7 30.3 52.5 5.8 3.4 13.2 1.4 16.6-4.4 3.4-5.8 1.4-13.2-4.4-16.6-11.3-6.5-18.2-18.5-18.2-31.5 0-6.7-5.4-12.1-12.1-12.1-6.7 0-12.2 5.4-12.2 12.1zm93.4 51.1c17.5-11.1 28-30.4 28-51.1 0-6.7-5.4-12.1-12.1-12.1s-12.1 5.4-12.1 12.1c0 12.4-6.3 24-16.8 30.7-5.7 3.5-7.5 10.9-4.1 16.7s10.9 7.5 16.7 4.1c0-.2.2-.3.4-.4z"}),v.createElement("ellipse",{fill:"#C59262",cx:256.5,cy:159.1,rx:24.3,ry:36.4}))},Hb=function(e){var r=e.title,n=B(e,Gx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 114h513v114H0z"}),v.createElement("path",{fill:"#cd1f2a",d:"M0 0h513v114H0z"}),v.createElement("path",{fill:"#1d4185",d:"M0 228h513v114H0z"}))},Vb=function(e){var r=e.title,n=B(e,Jx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M513 211H202.6v131h-79.9V211H0v-80h122.7V0h79.9v131H513v61.4z"}),v.createElement("path",{fill:"#1f3f7a",d:"M513 149.6v42.8H184V342h-42.7V192.4H0v-42.8h141.3V0H184v149.6z"}))},Wb=function(e){var r=e.title,n=B(e,Qx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#012169",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"m448.9 107.7 4.2 13.1h13.8l-11.1 8.1L460 142l-11.1-8.1-11.1 8.1 4.2-13.1-11.1-8.1h13.7zm-64.2 145.9 5.1 15.6h16.4l-13.2 9.7 5 15.6-13.3-9.7-13.2 9.7 5-15.6-13.3-9.7h16.5zm.1-210.2 4.7 14.6h15.3l-12.4 8.9 4.7 14.6-12.3-9-12.4 9 4.7-14.6-12.3-8.9H380zm-64.2 86 4.7 14.5h15.3l-12.3 9 4.7 14.5-12.4-8.9-12.3 8.9 4.7-14.5-12.4-9h15.3z",fill:"#D80027",stroke:"#FFF",strokeWidth:2,strokeMiterlimit:10}),v.createElement("path",{fill:"#012169",d:"M0 0h256.5v171H0z"}),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M256.5 0v30.6l-45.3 25.2h45.3v59.4h-59.2l59.2 32.9V171h-26.7l-73.7-40.9V171h-55.7v-48.7L12.8 171H0v-30.6l45.3-25.2H0V55.8h59.2L0 22.9V0h26.7l73.7 40.9V0h55.7v48.7L243.7 0z"}),v.createElement("path",{d:"M156.1 115.2 256.5 171v-15.8l-72-40zm-55.7-59.4L0 0v15.8l72 40z"})),v.createElement("g",{fill:"#D80027"},v.createElement("path",{d:"M144.3 0h-32.1v69.5H0v32h112.2V171h32.1v-69.5h112.2v-32H144.3z"}),v.createElement("path",{d:"M156.1 115.2 256.5 171v-15.8l-72-40zm-84.1 0-72 40V171l100.4-55.8zm28.4-59.4L0 0v15.8l72 40zm84.1 0 72-40V0L156.1 55.8z"})))},Kb=function(e){var r=e.title,n=B(e,Yx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("g",{fill:"#FFF"},v.createElement("path",{d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{d:"M0 85.337h512V256H0z"})),v.createElement("path",{fill:"#D80027",d:"M0 256h512v170.663H0z"}))},qb=function(e){var r=e.title,n=B(e,Zx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#D80027",d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{fill:"#6DA544",d:"M196.641 85.337v341.326H0V85.337z"}),v.createElement("circle",{fill:"#FFDA44",cx:196.641,cy:256,r:64}),v.createElement("path",{fill:"#D80027",d:"M160.638 224v40.001c0 19.882 16.118 36 36 36s36-16.118 36-36V224h-72z"}),v.createElement("path",{fill:"#FFF",d:"M196.638 276c-6.617 0-12-5.383-12-12v-16h24.001v16c-.001 6.616-5.385 12-12.001 12z"}))},Gb=function(e){var r=e.title,n=B(e,Xx);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFDA44",d:"M0 85.331h512v341.326H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 85.331h170.663v341.337H0z"}),v.createElement("path",{fill:"#D80027",d:"M341.337 85.331H512v341.337H341.337z"}))},Jb=function(e){var r=e.title,n=B(e,eb);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#0052B4",d:"M0 85.333h512V426.67H0z"}),v.createElement("path",{fill:"#FFDA44",d:"M192 85.33h-64v138.666H0v64h128v138.666h64V287.996h320v-64H192z"}))},Qb=function(e){var r=e.title,n=B(e,tb);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 199.112h512v113.775H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 312.888h512v113.775H0z"}),v.createElement("path",{fill:"#FFF",d:"M233.606 196.639v14.837c0 34.081-44.522 44.522-44.522 44.522s-44.522-10.44-44.522-44.522v-14.837l-.145-44.188 89.043-.266.146 44.454z"}),v.createElement("path",{fill:"#0052B4",d:"M233.606 196.639v14.837c0 34.081-44.522 44.522-44.522 44.522s-44.522-10.44-44.522-44.522v-14.837l-.145-44.188 89.043-.266.146 44.454z"}),v.createElement("path",{fill:"#FFF",d:"M233.606 196.639v14.837c0 34.081-44.522 44.522-44.522 44.522s-44.522-10.44-44.522-44.522v-14.837l14.848 14.837 29.674-22.261 29.685 22.261 14.837-14.837z"}))},Yb=function(e){var r=e.title,n=B(e,rb);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{fill:"#0052B4",d:"M0 196.641h512v118.717H0z"}),v.createElement("path",{fill:"#D80027",d:"M0 315.359h512v111.304H0z"}),v.createElement("path",{fill:"#FFF",d:"M129.468 181.799v85.136c0 48.429 63.267 63.267 63.267 63.267S256 315.362 256 266.935v-85.136H129.468z"}),v.createElement("path",{fill:"#D80027",d:"M146.126 184.294v81.941c0 5.472 1.215 10.64 3.623 15.485h85.97c2.408-4.844 3.623-10.012 3.623-15.485v-81.941h-93.216z"}),v.createElement("path",{fill:"#FFF",d:"M221.301 241.427h-21.425v-14.283h14.284v-14.283h-14.284v-14.284h-14.283v14.284h-14.282v14.283h14.282v14.283h-21.426v14.284h21.426v14.283h14.283v-14.283h21.425z"}),v.createElement("path",{fill:"#0052B4",d:"M169.232 301.658c9.204 5.783 18.66 9.143 23.502 10.636 4.842-1.494 14.298-4.852 23.502-10.636 9.282-5.833 15.79-12.506 19.484-19.939a24.878 24.878 0 0 0-14.418-4.583c-1.956 0-3.856.232-5.682.657-3.871-8.796-12.658-14.94-22.884-14.94-10.227 0-19.013 6.144-22.884 14.94a25.048 25.048 0 0 0-5.682-.657 24.88 24.88 0 0 0-14.418 4.583c3.691 7.433 10.198 14.106 19.48 19.939z"}))},Zb=function(e){var r=e.title,n=B(e,nb);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#E30A17",d:"M0 0h513v342H0z"}),v.createElement("path",{fill:"#FFF",d:"M259.7 118.6c-13.1-9.5-29-14.6-45.3-14.5-40.8 0-73.8 30.8-73.8 68.9s33.1 68.9 73.8 68.9c17.1 0 32.9-5.4 45.3-14.5-30 38.6-85.7 45.6-124.3 15.5s-45.6-85.7-15.5-124.3 85.7-45.6 124.3-15.5c5.8 4.5 11 9.8 15.5 15.5zm39.9 65.8-18.1 21.9 1.2-28.4-26.4-10.4 27.3-7.6 1.8-28.3 15.6 23.7 27.5-7.1-17.5 22 15.3 23.9-26.7-9.7z"}))},Xb=function(e){var r=e.title,n=B(e,sb);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFDA44",d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{fill:"#338AF3",d:"M0 85.337h512V256H0z"}))},e2=function(e){var r=e.title,n=B(e,ib);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 0h513v342H0z"}),v.createElement("path",{d:"M0 0h513v26.3H0zm0 52.6h513v26.3H0zm0 52.6h513v26.3H0zm0 52.6h513v26.3H0zm0 52.7h513v26.3H0zm0 52.6h513v26.3H0zm0 52.6h513V342H0z",fill:"#D80027"}),v.createElement("path",{fill:"#2E52B2",d:"M0 0h256.5v184.1H0z"}),v.createElement("path",{d:"m47.8 138.9-4-12.8-4.4 12.8H26.2l10.7 7.7-4 12.8 10.9-7.9 10.6 7.9-4.1-12.8 10.9-7.7zm56.3 0-4.1-12.8-4.2 12.8H82.6l10.7 7.7-4 12.8 10.7-7.9 10.8 7.9-4-12.8 10.7-7.7zm56.5 0-4.3-12.8-4 12.8h-13.5l11 7.7-4.2 12.8 10.7-7.9 11 7.9-4.2-12.8 10.7-7.7zm56.2 0-4-12.8-4.2 12.8h-13.3l10.8 7.7-4 12.8 10.7-7.9 10.8 7.9-4.3-12.8 11-7.7zM100 75.3l-4.2 12.8H82.6L93.3 96l-4 12.6 10.7-7.8 10.8 7.8-4-12.6 10.7-7.9h-13.4zm-56.2 0-4.4 12.8H26.2L36.9 96l-4 12.6 10.9-7.8 10.6 7.8L50.3 96l10.9-7.9H47.8zm112.5 0-4 12.8h-13.5l11 7.9-4.2 12.6 10.7-7.8 11 7.8-4.2-12.6 10.7-7.9h-13.2zm56.5 0-4.2 12.8h-13.3l10.8 7.9-4 12.6 10.7-7.8 10.8 7.8-4.3-12.6 11-7.9h-13.5zm-169-50.6-4.4 12.6H26.2l10.7 7.9-4 12.7L43.8 50l10.6 7.9-4.1-12.7 10.9-7.9H47.8zm56.2 0-4.2 12.6H82.6l10.7 7.9-4 12.7L100 50l10.8 7.9-4-12.7 10.7-7.9h-13.4zm56.3 0-4 12.6h-13.5l11 7.9-4.2 12.7 10.7-7.9 11 7.9-4.2-12.7 10.7-7.9h-13.2zm56.5 0-4.2 12.6h-13.3l10.8 7.9-4 12.7 10.7-7.9 10.8 7.9-4.3-12.7 11-7.9h-13.5z",fill:"#FFF"}))},t2=function(e){var r=e.title,n=B(e,ab);return v.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 85.333 512 341.333"},n),r&&v.createElement("title",null,r),v.createElement("path",{fill:"#FFF",d:"M0 85.337h512v341.326H0z"}),v.createElement("path",{d:"M114.024 256.001 0 141.926v228.17z"}),v.createElement("path",{fill:"#ffb915",d:"M161.192 256 0 94.7v47.226l114.024 114.075L0 370.096v47.138z"}),v.createElement("path",{fill:"#007847",d:"M509.833 289.391c.058-.44.804-.878 2.167-1.318v-65.464H222.602L85.33 85.337H0V94.7L161.192 256 0 417.234v9.429h85.33l137.272-137.272h287.231z"}),v.createElement("path",{fill:"#000c8a",d:"M503.181 322.783H236.433l-103.881 103.88H512v-103.88z"}),v.createElement("path",{fill:"#e1392d",d:"M503.181 189.217H512V85.337H132.552l103.881 103.88z"}))};const r2=(t="")=>String(t||"").trim().toUpperCase(),n2={AR:lb,AT:ub,AU:cb,BA:db,BE:hb,BG:fb,BR:pb,CA:gb,CH:mb,CL:yb,CN:vb,CO:wb,CZ:xb,DE:bb,DK:kb,EE:_b,ES:Eb,FI:Sb,FR:jb,GB:Nb,GR:Tb,HR:Pb,HU:Cb,IE:Ab,IN:Ob,IS:Rb,IT:zb,JP:Ib,KR:Lb,LI:Db,LT:Mb,LU:Fb,LV:$b,MT:Bb,MX:Ub,NL:Hb,NO:Vb,NZ:Wb,PL:Kb,PT:qb,RO:Gb,SE:Jb,SI:Qb,SK:Yb,TR:Zb,UA:Xb,US:e2,ZA:t2};function Fn({countryCode:t="",title:e="",className:r="h-4 w-6 rounded-[2px] shadow-sm"}){const n=r2(t),s=n2[n];return s?l.jsx(s,{title:e||n,className:r}):l.jsx("span",{className:"inline-flex h-4 w-6 items-center justify-center rounded-[2px] bg-gray-200 text-[10px] dark:bg-gray-700",title:e||"Kein Land",children:"🌍"})}const lo={message:"",error:""};function s2({session:t,profile:e,loading:r,error:n,onSave:s,onDelete:i,onSessionChange:a}){var _,N;const[o,u]=T.useState(e),[c,d]=T.useState(lo),[h,f]=T.useState(!1),[y,w]=T.useState(!1),[x,b]=T.useState(!1),p=T.useRef(null),m=Cu(o.country),g=!!o.country&&!m;T.useEffect(()=>{u(e)},[e]),T.useEffect(()=>{if(!x)return;const C=U=>{p.current&&!p.current.contains(U.target)&&b(!1)},A=U=>{U.key==="Escape"&&b(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",A),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",A)}},[x]);const k=C=>A=>{const U=C==="testsVisible"?A.target.checked:A.target.value;u(Y=>({...Y,[C]:U}))},E=C=>{u(A=>({...A,country:C})),b(!1)},S=async C=>{var U;C.preventDefault(),f(!0),d(lo);const A=await s(o);A!=null&&A.ok?(A.session&&(a==null||a(A.session)),d({message:A.emailUpdateRequested?"Profil gespeichert. Die neue Mailadresse muss ggf. noch per E-Mail bestätigt werden.":"Profil gespeichert.",error:""})):d({message:"",error:((U=A==null?void 0:A.error)==null?void 0:U.message)||"Profil konnte nicht gespeichert werden."}),f(!1)},j=async()=>{var U;if(!window.confirm(`Profil wirklich löschen? - -Dabei werden alle Tests dieses Benutzers sowie vorhandene Analysepläne dauerhaft entfernt.`))return;w(!0),d(lo);const A=await(i==null?void 0:i());A!=null&&A.ok?d({message:"Profil und alle Tests wurden gelöscht. Das Konto bleibt bestehen und kann neu eingerichtet werden.",error:""}):d({message:"",error:((U=A==null?void 0:A.error)==null?void 0:U.message)||"Profil konnte nicht gelöscht werden."}),w(!1)};return l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-sky-50 to-emerald-100 dark:from-gray-950 dark:via-gray-900 dark:to-gray-950 p-6 text-gray-900 dark:text-gray-100",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:l.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-800 overflow-hidden",children:[l.jsxs("div",{className:"px-6 py-5 border-b border-gray-200 dark:border-gray-800",children:[l.jsx("p",{className:"text-xs uppercase tracking-[0.25em] text-sky-700 dark:text-sky-300",children:"Benutzerprofil"}),l.jsx("h1",{className:"text-3xl font-bold mt-2",children:"Profil verwalten"}),l.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-300",children:"Name, Vorname, Mailadresse, Land und die Sichtbarkeit deiner Testfreigaben werden hier gepflegt."})]}),r?l.jsx("div",{className:"px-6 py-10 text-sm text-gray-600 dark:text-gray-300",children:"Profil wird geladen..."}):l.jsxs("form",{onSubmit:S,className:"px-6 py-6 space-y-6",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-5",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Vorname"}),l.jsx("input",{type:"text",value:o.firstName||"",onChange:k("firstName"),className:"mt-1 w-full px-4 py-3 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-sky-500",placeholder:"Max"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Nachname"}),l.jsx("input",{type:"text",value:o.lastName||"",onChange:k("lastName"),className:"mt-1 w-full px-4 py-3 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-sky-500",placeholder:"Mustermann"})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Mailadresse"}),l.jsx("input",{type:"email",value:o.email||((_=t==null?void 0:t.user)==null?void 0:_.email)||"",onChange:k("email"),required:!0,className:"mt-1 w-full px-4 py-3 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-sky-500",placeholder:"you@example.com"}),l.jsx("span",{className:"mt-2 block text-xs text-gray-500 dark:text-gray-400",children:"Wenn du die Mailadresse änderst, wird dir eine Bestätigung an die neue Adresse gesendet."})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Land"}),l.jsxs("div",{ref:p,className:"relative mt-1",children:[l.jsxs("button",{type:"button",onClick:()=>b(C=>!C),className:"flex w-full items-center justify-between rounded-lg border border-gray-200 bg-white px-4 py-3 text-left text-sm text-gray-800 transition hover:border-sky-400 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",children:[l.jsxs("span",{className:"inline-flex items-center gap-3",children:[l.jsx(Fn,{countryCode:(m==null?void 0:m.code)||o.country,title:(m==null?void 0:m.name)||Mn(o.country)||"Land auswählen",className:"h-5 w-7 rounded-[3px] shadow-sm ring-1 ring-black/10"}),l.jsx("span",{className:"font-medium",children:(m==null?void 0:m.name)||Mn(o.country)||"Land auswählen"})]}),l.jsx(Df,{className:`h-4 w-4 text-gray-500 transition ${x?"rotate-180":""}`,"aria-hidden":"true"})]}),x&&l.jsxs("div",{className:"absolute left-0 right-0 z-20 mt-2 max-h-72 overflow-y-auto rounded-xl border border-gray-200 bg-white p-2 shadow-2xl dark:border-gray-700 dark:bg-gray-900",children:[l.jsxs("button",{type:"button",onClick:()=>E(""),className:`flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition ${o.country?"text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-800":"bg-sky-50 text-sky-700 dark:bg-sky-950/40 dark:text-sky-200"}`,children:[l.jsxs("span",{className:"inline-flex items-center gap-3",children:[l.jsx(Fn,{countryCode:"",title:"Kein Land ausgewählt",className:"h-5 w-7 rounded-[3px] shadow-sm"}),l.jsx("span",{children:"Kein Land ausgewählt"})]}),!o.country&&l.jsx(Ja,{className:"h-4 w-4","aria-hidden":"true"})]}),g&&l.jsxs("button",{type:"button",onClick:()=>E(o.country),className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm text-gray-700 transition hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-800",children:[l.jsxs("span",{className:"inline-flex items-center gap-3",children:[l.jsx(Fn,{countryCode:o.country,title:Mn(o.country),className:"h-5 w-7 rounded-[3px] shadow-sm ring-1 ring-black/10"}),l.jsx("span",{children:Mn(o.country)})]}),l.jsx(Ja,{className:"h-4 w-4","aria-hidden":"true"})]}),_p.map(C=>{const A=C.code===o.country;return l.jsxs("button",{type:"button",onClick:()=>E(C.code),className:`flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition ${A?"bg-sky-50 text-sky-700 dark:bg-sky-950/40 dark:text-sky-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-800"}`,children:[l.jsxs("span",{className:"inline-flex items-center gap-3",children:[l.jsx(Fn,{countryCode:C.code,title:C.name,className:"h-5 w-7 rounded-[3px] shadow-sm ring-1 ring-black/10"}),l.jsx("span",{children:C.name})]}),A&&l.jsx(Ja,{className:"h-4 w-4","aria-hidden":"true"})]},C.code)})]})]}),l.jsx("span",{className:"mt-2 block text-xs text-gray-500 dark:text-gray-400",children:"Die ausgewählte Flagge wird später auch im Kopfbereich neben deiner Mailadresse angezeigt."})]}),l.jsxs("div",{className:"block",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"Ranglistenplatz"}),l.jsxs("div",{className:"mt-1 rounded-lg border border-dashed border-amber-300 bg-amber-50 px-4 py-3 dark:border-amber-900/70 dark:bg-amber-950/30",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Platzhalter"}),l.jsx("span",{className:"rounded-full bg-white px-3 py-1 text-sm font-semibold text-amber-700 shadow-sm dark:bg-gray-900 dark:text-amber-300",children:"# -"})]}),l.jsx("p",{className:"mt-2 text-xs text-amber-700/80 dark:text-amber-200/80",children:"Hier kann spater der Ranglistenplatz des Benutzers angezeigt werden."})]})]})]}),l.jsx("div",{className:"rounded-xl border border-sky-200 dark:border-sky-900/70 bg-sky-50 dark:bg-sky-950/30 p-5",children:l.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Tests sichtbar"}),l.jsx("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-300 max-w-2xl",children:"Ist dieser Schalter aktiv, funktionieren deine Freigabelinks. Wenn du ihn deaktivierst, bleiben vorhandene Links gespeichert, sind aber nicht mehr öffentlich sichtbar."})]}),l.jsxs("label",{className:"inline-flex items-center gap-3 rounded-full border border-sky-300 dark:border-sky-800 px-4 py-2 bg-white dark:bg-gray-900",children:[l.jsx("input",{type:"checkbox",checked:!!o.testsVisible,onChange:k("testsVisible"),className:"h-4 w-4 rounded border-gray-300 text-sky-600 focus:ring-sky-500"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:o.testsVisible?"Sichtbar":"Nicht sichtbar"})]})]})}),(n||c.error)&&l.jsx("div",{className:"rounded-lg border border-rose-200 dark:border-rose-900/70 bg-rose-50 dark:bg-rose-950/30 px-4 py-3 text-sm text-rose-700 dark:text-rose-200",children:c.error||n}),c.message&&l.jsx("div",{className:"rounded-lg border border-emerald-200 dark:border-emerald-900/70 bg-emerald-50 dark:bg-emerald-950/30 px-4 py-3 text-sm text-emerald-700 dark:text-emerald-200",children:c.message}),l.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[l.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Konto-ID: ",l.jsx("span",{className:"font-mono",children:((N=t==null?void 0:t.user)==null?void 0:N.id)||"—"})]}),l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsx("button",{type:"button",onClick:j,disabled:y||h,className:"px-5 py-3 rounded-lg border border-rose-300 bg-white text-rose-700 font-semibold hover:bg-rose-50 transition disabled:opacity-60 disabled:cursor-not-allowed dark:border-rose-800 dark:bg-gray-900 dark:text-rose-300 dark:hover:bg-rose-950/40",children:y?"Löscht...":"Profil löschen"}),l.jsx("button",{type:"submit",disabled:h||y,className:"px-5 py-3 rounded-lg bg-sky-600 text-white font-semibold hover:bg-sky-700 transition disabled:opacity-60 disabled:cursor-not-allowed",children:h?"Speichert...":"Profil speichern"})]})]})]})]})})})}const wd=(t="")=>t.trim().toLowerCase(),An=(t="")=>({firstName:"",lastName:"",country:"",testsVisible:!1,email:t}),xd=(t,e="")=>({firstName:(t==null?void 0:t.first_name)||"",lastName:(t==null?void 0:t.last_name)||"",country:(t==null?void 0:t.country)||"",testsVisible:!!(t!=null&&t.tests_visible),email:e}),i2=(t,e)=>({user_id:e,first_name:t.firstName.trim(),last_name:t.lastName.trim(),country:t.country.trim(),tests_visible:!!t.testsVisible}),a2=t=>{var f,y;const e=((f=t==null?void 0:t.user)==null?void 0:f.id)||"",r=T.useMemo(()=>{var w;return wd(((w=t==null?void 0:t.user)==null?void 0:w.email)||"")},[(y=t==null?void 0:t.user)==null?void 0:y.email]),[n,s]=T.useState(()=>An(r)),[i,a]=T.useState(!!e),[o,u]=T.useState("");T.useEffect(()=>{if(!e){s(An(r)),a(!1);return}s(w=>({...w,email:r})),a(!0)},[r,e]);const c=T.useCallback(async()=>{if(!V||!e){s(An(r)),a(!1),u("");return}a(!0),u("");try{const{data:w,error:x}=await V.from("user_profiles").select("first_name, last_name, country, tests_visible").eq("user_id",e).maybeSingle();if(x)throw x;s(xd(w,r))}catch(w){s(An(r)),u(w.message||"Profil konnte nicht geladen werden.")}finally{a(!1)}},[r,e]);T.useEffect(()=>{c()},[c]);const d=T.useCallback(async w=>{if(!V||!e)return{ok:!1,error:new Error("Supabase ist nicht konfiguriert.")};const x=wd(w.email);if(!x)return{ok:!1,error:new Error("Bitte eine gültige E-Mail-Adresse eintragen.")};try{let b=!1;if(x!==r){const{error:E}=await V.auth.updateUser({email:x});if(E)throw E;b=!0}const{data:p,error:m}=await V.from("user_profiles").upsert(i2(w,e),{onConflict:"user_id"}).select("first_name, last_name, country, tests_visible").single();if(m)throw m;const g=xd(p,b?x:r);s(g),u("");const{data:k}=await V.auth.getSession();return{ok:!0,profile:g,session:k.session,emailUpdateRequested:b}}catch(b){const p=b instanceof Error?b:new Error((b==null?void 0:b.message)||"Profil konnte nicht gespeichert werden.");return u(p.message),{ok:!1,error:p}}},[r,e]),h=T.useCallback(async()=>{if(!V||!e)return{ok:!1,error:new Error("Supabase ist nicht konfiguriert.")};try{const{error:w}=await V.rpc("delete_current_user_profile_data");if(w)throw w;const x=An(r);return s(x),u(""),{ok:!0,profile:x}}catch(w){const x=w instanceof Error?w:new Error((w==null?void 0:w.message)||"Profil konnte nicht gelöscht werden.");return u(x.message),{ok:!1,error:x}}},[r,e]);return{profile:n,loading:i,error:o,saveProfile:d,deleteProfileData:h,refreshProfile:c}},uo=()=>typeof window>"u"?"":new URLSearchParams(window.location.search).get("share")||"",bd=()=>{if(typeof window>"u")return"/";const t=window.location.hash||"";return t.startsWith("#/")?t.slice(1):"/"};function o2(){var Y;const[t,e]=T.useState(null),[r,n]=T.useState(!0),[s,i]=T.useState(!1),[a,o]=T.useState("assessments"),[u,c]=T.useState(!1),[d,h]=T.useState(()=>uo()),[f,y]=T.useState(()=>bd()),[w,x]=T.useState(()=>{if(typeof window>"u")return"light";const G=localStorage.getItem("theme");return G==="light"||G==="dark"?G:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),{profile:b,loading:p,error:m,saveProfile:g,deleteProfileData:k}=a2(t);T.useEffect(()=>{const G=document.documentElement;w==="dark"?G.classList.add("dark"):G.classList.remove("dark"),localStorage.setItem("theme",w)},[w]),T.useEffect(()=>{const G=()=>{h(uo()),y(bd())};return window.addEventListener("popstate",G),window.addEventListener("hashchange",G),()=>{window.removeEventListener("popstate",G),window.removeEventListener("hashchange",G)}},[]),T.useEffect(()=>{if(d){n(!1);return}if(!V){n(!1);return}(async()=>{const{data:he,error:Re}=await V.auth.getSession();Re||e(he.session),n(!1)})();const{data:ye}=V.auth.onAuthStateChange((he,Re)=>{e(Re)});return()=>{ye==null||ye.subscription.unsubscribe()}},[d]),T.useEffect(()=>{u&&a!=="assessments"&&o("assessments")},[a,u]);const E=async()=>{V&&(await V.auth.signOut(),e(null),i(!1),o("assessments"),c(!1),j("/"))},S=()=>x(G=>G==="dark"?"light":"dark"),j=G=>{if(typeof window>"u")return;const ye=G||"/",he=ye==="/"?"":`#${ye}`;if(window.location.hash===he){y(ye),window.scrollTo({top:0,behavior:"smooth"});return}const Re=`${window.location.pathname}${window.location.search}${he}`;window.history.pushState({},"",Re),y(ye),h(uo()),window.scrollTo({top:0,behavior:"smooth"})},_=()=>l.jsxs("button",{onClick:S,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 shadow-sm hover:shadow transition","aria-label":"Darstellung wechseln",type:"button",children:[w==="dark"?l.jsx(wy,{className:"w-4 h-4"}):l.jsx(py,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm font-medium",children:w==="dark"?"Light Mode":"Dark Mode"})]});if(d)return l.jsx(cx,{shareToken:d,themeToggle:_()});if(!V)return l.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-950 text-gray-900 dark:text-gray-100 flex items-center justify-center p-6",children:[l.jsx("div",{className:"absolute top-4 right-4",children:_()}),l.jsxs("div",{className:"max-w-xl w-full bg-white/90 dark:bg-gray-900/80 border border-dashed border-gray-300 dark:border-gray-700 rounded-xl shadow-sm p-6",children:[l.jsx("h2",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-2",children:"Supabase noch nicht konfiguriert"}),l.jsxs("p",{className:"text-gray-600 dark:text-gray-300",children:["Lege eine ",l.jsx("code",{children:".env"})," an (siehe ",l.jsx("code",{children:".env.example"}),") und trage",l.jsx("code",{children:" VITE_SUPABASE_URL "})," sowie ",l.jsx("code",{children:"VITE_SUPABASE_ANON_KEY"})," ein, um Login und Registrierung zu aktivieren."]}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-3",children:"Anschließend Vite neu starten, damit die Variablen geladen werden."})]})]});if(r)return l.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-950 text-gray-600 dark:text-gray-300",children:[l.jsx("div",{className:"absolute top-4 right-4",children:_()}),l.jsx("span",{children:"Auth wird geladen..."})]});if(!t)return s?l.jsx(tx,{onAuth:e,themeToggle:_(),onBack:()=>i(!1)}):f==="/datenschutz"||f==="/impressum"||f==="/kontakt"?l.jsx(dx,{path:f,onGetStarted:()=>i(!0),onNavigate:j,themeToggle:_()}):l.jsx(ax,{onGetStarted:()=>i(!0),onNavigate:j,themeToggle:_()});const N=[b==null?void 0:b.firstName,b==null?void 0:b.lastName].filter(Boolean).join(" "),C=Cu(b==null?void 0:b.country),A=Mn(b==null?void 0:b.country),U=!!N;return l.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-950 text-gray-900 dark:text-gray-100",children:[l.jsx("header",{className:"bg-white/80 dark:bg-gray-900/70 backdrop-blur border-b border-gray-200 dark:border-gray-800",children:l.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-3 flex items-center justify-between gap-3 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Angemeldet"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-sm font-semibold text-gray-800 dark:text-gray-100",children:[A&&l.jsx(Fn,{countryCode:(C==null?void 0:C.code)||(b==null?void 0:b.country),title:A,className:"h-4 w-6 rounded-[2px] shadow-sm ring-1 ring-black/10"}),l.jsx("span",{children:U?N:(Y=t==null?void 0:t.user)==null?void 0:Y.email})]})]}),l.jsxs("nav",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>o("assessments"),className:`px-4 py-2 rounded-lg border text-sm font-semibold transition ${a==="assessments"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 border-gray-900 dark:border-gray-100":"bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:"Bewertungen"}),l.jsx("button",{type:"button",onClick:()=>o("analysis"),disabled:u,className:`px-4 py-2 rounded-lg border text-sm font-semibold transition ${a==="analysis"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 border-gray-900 dark:border-gray-100":"bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800"} ${u?"opacity-50 cursor-not-allowed":""}`,title:u?"Analyse ist während der Bearbeitung deaktiviert":"Analyse öffnen",children:"Analyse"}),l.jsx("button",{type:"button",onClick:()=>o("profile"),disabled:u,className:`px-4 py-2 rounded-lg border text-sm font-semibold transition ${a==="profile"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 border-gray-900 dark:border-gray-100":"bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800"} ${u?"opacity-50 cursor-not-allowed":""}`,title:u?"Profil ist während der Bearbeitung deaktiviert":"Profil öffnen",children:"Profil"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[_(),l.jsx("button",{onClick:E,className:"px-4 py-2 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-200 transition",children:"Abmelden"})]})]})}),a!=="profile"&&l.jsx(ex,{user:t==null?void 0:t.user,activeTab:a,onEditingStateChange:c,testsVisible:!!(b!=null&&b.testsVisible),isProfileLoading:p}),a==="profile"&&l.jsx(s2,{session:t,profile:b,loading:p,error:m,onSave:g,onDelete:k,onSessionChange:e})]})}co.createRoot(document.getElementById("root")).render(l.jsx(v.StrictMode,{children:l.jsx(o2,{})}));export{Hc as _,Ar as c,kd as g}; diff --git a/dist/assets/index.es-DQ6YK4So.js b/dist/assets/index.es-DQ6YK4So.js deleted file mode 100644 index ed4bcf9..0000000 --- a/dist/assets/index.es-DQ6YK4So.js +++ /dev/null @@ -1,18 +0,0 @@ -import{c as Ke,g as Do}from"./index-Cg2UxsRL.js";import{_ as Xa}from"./jspdf.es.min-CLjTnO_I.js";var vt=function(a){return a&&a.Math===Math&&a},_=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),$t={},D=function(a){try{return!!a()}catch{return!0}},Al=D,he=!Al(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Pl=D,xr=!Pl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Rl=xr,Ut=Function.prototype.call,Y=Rl?Ut.bind(Ut):function(){return Ut.apply(Ut,arguments)},Lo={},ko={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,Nl=Bo&&!ko.call({1:2},1);Lo.f=Nl?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:ko;var Si=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},jo=xr,Fo=Function.prototype,Wa=Fo.call,Il=jo&&Fo.bind.bind(Wa,Wa),L=jo?Il:function(a){return function(){return Wa.apply(a,arguments)}},Uo=L,Ml=Uo({}.toString),_l=Uo("".slice),je=function(a){return _l(Ml(a),8,-1)},Vl=L,Dl=D,Ll=je,ea=Object,kl=Vl("".split),Go=Dl(function(){return!ea("z").propertyIsEnumerable(0)})?function(a){return Ll(a)==="String"?kl(a,""):ea(a)}:ea,Tr=function(a){return a==null},Bl=Tr,jl=TypeError,ve=function(a){if(Bl(a))throw new jl("Can't call method on "+a);return a},Fl=Go,Ul=ve,wt=function(a){return Fl(Ul(a))},ta=typeof document=="object"&&document.all,B=typeof ta>"u"&&ta!==void 0?function(a){return typeof a=="function"||a===ta}:function(a){return typeof a=="function"},Gl=B,ae=function(a){return typeof a=="object"?a!==null:Gl(a)},ra=_,zl=B,Hl=function(a){return zl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Hl(ra[a]):ra[a]&&ra[a][e]},Yl=L,Or=Yl({}.isPrototypeOf),Xl=_,yn=Xl.navigator,mn=yn&&yn.userAgent,Ct=mn?String(mn):"",zo=_,aa=Ct,bn=zo.process,xn=zo.Deno,Tn=bn&&bn.versions||xn&&xn.version,On=Tn&&Tn.v8,le,gr;On&&(le=On.split("."),gr=le[0]>0&&le[0]<4?1:+(le[0]+le[1]));!gr&&aa&&(le=aa.match(/Edge\/(\d+)/),(!le||le[1]>=74)&&(le=aa.match(/Chrome\/(\d+)/),le&&(gr=+le[1])));var Ei=gr,Sn=Ei,Wl=D,ql=_,Ql=ql.String,Ho=!!Object.getOwnPropertySymbols&&!Wl(function(){var a=Symbol("symbol detection");return!Ql(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&Sn&&Sn<41}),Kl=Ho,Yo=Kl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Zl=Fe,Jl=B,eh=Or,th=Yo,rh=Object,Xo=th?function(a){return typeof a=="symbol"}:function(a){var e=Zl("Symbol");return Jl(e)&&eh(e.prototype,rh(a))},ah=String,Sr=function(a){try{return ah(a)}catch{return"Object"}},ih=B,nh=Sr,sh=TypeError,Te=function(a){if(ih(a))return a;throw new sh(nh(a)+" is not a function")},oh=Te,uh=Tr,ot=function(a,e){var t=a[e];return uh(t)?void 0:oh(t)},ia=Y,na=B,sa=ae,lh=TypeError,hh=function(a,e){var t,r;if(e==="string"&&na(t=a.toString)&&!sa(r=ia(t,a))||na(t=a.valueOf)&&!sa(r=ia(t,a))||e!=="string"&&na(t=a.toString)&&!sa(r=ia(t,a)))return r;throw new lh("Can't convert object to primitive value")},Wo={exports:{}},En=_,vh=Object.defineProperty,$i=function(a,e){try{vh(En,a,{value:e,configurable:!0,writable:!0})}catch{En[a]=e}return e},fh=_,ch=$i,$n="__core-js_shared__",wn=Wo.exports=fh[$n]||ch($n,{});(wn.versions||(wn.versions=[])).push({version:"3.49.0",mode:"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.49.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wi=Wo.exports,Cn=wi,Ci=function(a,e){return Cn[a]||(Cn[a]=e||{})},gh=ve,dh=Object,Er=function(a){return dh(gh(a))},ph=L,yh=Er,mh=ph({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return mh(yh(e),t)},bh=L,xh=0,Th=Math.random(),Oh=bh(1.1.toString),qo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Oh(++xh+Th,36)},Sh=_,Eh=Ci,An=fe,$h=qo,wh=Ho,Ch=Yo,Ze=Sh.Symbol,oa=Eh("wks"),Ah=Ch?Ze.for||Ze:Ze&&Ze.withoutSetter||$h,z=function(a){return An(oa,a)||(oa[a]=wh&&An(Ze,a)?Ze[a]:Ah("Symbol."+a)),oa[a]},Ph=Y,Pn=ae,Rn=Xo,Rh=ot,Nh=hh,Ih=z,Mh=TypeError,_h=Ih("toPrimitive"),Vh=function(a,e){if(!Pn(a)||Rn(a))return a;var t=Rh(a,_h),r;if(t){if(e===void 0&&(e="default"),r=Ph(t,a,e),!Pn(r)||Rn(r))return r;throw new Mh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Nh(a,e)},Dh=Vh,Lh=Xo,Qo=function(a){var e=Dh(a,"string");return Lh(e)?e:e+""},kh=_,Nn=ae,qa=kh.document,Bh=Nn(qa)&&Nn(qa.createElement),$r=function(a){return Bh?qa.createElement(a):{}},jh=he,Fh=D,Uh=$r,Ko=!jh&&!Fh(function(){return Object.defineProperty(Uh("div"),"a",{get:function(){return 7}}).a!==7}),Gh=he,zh=Y,Hh=Lo,Yh=Si,Xh=wt,Wh=Qo,qh=fe,Qh=Ko,In=Object.getOwnPropertyDescriptor;$t.f=Gh?In:function(e,t){if(e=Xh(e),t=Wh(t),Qh)try{return In(e,t)}catch{}if(qh(e,t))return Yh(!zh(Hh.f,e,t),e[t])};var Oe={},Kh=he,Zh=D,Zo=Kh&&Zh(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Jh=ae,ev=String,tv=TypeError,J=function(a){if(Jh(a))return a;throw new tv(ev(a)+" is not an object")},rv=he,av=Ko,iv=Zo,Gt=J,Mn=Qo,nv=TypeError,ua=Object.defineProperty,sv=Object.getOwnPropertyDescriptor,la="enumerable",ha="configurable",va="writable";Oe.f=rv?iv?function(e,t,r){if(Gt(e),t=Mn(t),Gt(r),typeof e=="function"&&t==="prototype"&&"value"in r&&va in r&&!r[va]){var i=sv(e,t);i&&i[va]&&(e[t]=r.value,r={configurable:ha in r?r[ha]:i[ha],enumerable:la in r?r[la]:i[la],writable:!1})}return ua(e,t,r)}:ua:function(e,t,r){if(Gt(e),t=Mn(t),Gt(r),av)try{return ua(e,t,r)}catch{}if("get"in r||"set"in r)throw new nv("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var ov=he,uv=Oe,lv=Si,At=ov?function(a,e,t){return uv.f(a,e,lv(1,t))}:function(a,e,t){return a[e]=t,a},Jo={exports:{}},Qa=he,hv=fe,eu=Function.prototype,vv=Qa&&Object.getOwnPropertyDescriptor,tu=hv(eu,"name"),fv=tu&&(function(){}).name==="something",cv=tu&&(!Qa||Qa&&vv(eu,"name").configurable),wr={PROPER:fv,CONFIGURABLE:cv},gv=L,dv=B,Ka=wi,pv=gv(Function.toString);dv(Ka.inspectSource)||(Ka.inspectSource=function(a){return pv(a)});var Ai=Ka.inspectSource,yv=_,mv=B,_n=yv.WeakMap,bv=mv(_n)&&/native code/.test(String(_n)),xv=Ci,Tv=qo,Vn=xv("keys"),Pi=function(a){return Vn[a]||(Vn[a]=Tv(a))},Ri={},Ov=bv,ru=_,Sv=ae,Ev=At,fa=fe,ca=wi,$v=Pi,wv=Ri,Dn="Object already initialized",Za=ru.TypeError,Cv=ru.WeakMap,dr,Ot,pr,Av=function(a){return pr(a)?Ot(a):dr(a,{})},Pv=function(a){return function(e){var t;if(!Sv(e)||(t=Ot(e)).type!==a)throw new Za("Incompatible receiver, "+a+" required");return t}};if(Ov||ca.state){var de=ca.state||(ca.state=new Cv);de.get=de.get,de.has=de.has,de.set=de.set,dr=function(a,e){if(de.has(a))throw new Za(Dn);return e.facade=a,de.set(a,e),e},Ot=function(a){return de.get(a)||{}},pr=function(a){return de.has(a)}}else{var Ye=$v("state");wv[Ye]=!0,dr=function(a,e){if(fa(a,Ye))throw new Za(Dn);return e.facade=a,Ev(a,Ye,e),e},Ot=function(a){return fa(a,Ye)?a[Ye]:{}},pr=function(a){return fa(a,Ye)}}var Cr={set:dr,get:Ot,has:pr,enforce:Av,getterFor:Pv},Ni=L,Rv=D,Nv=B,zt=fe,Ja=he,Iv=wr.CONFIGURABLE,Mv=Ai,au=Cr,_v=au.enforce,Vv=au.get,Ln=String,ur=Object.defineProperty,Dv=Ni("".slice),Lv=Ni("".replace),kv=Ni([].join),Bv=Ja&&!Rv(function(){return ur(function(){},"length",{value:8}).length!==8}),jv=String(String).split("String"),Fv=Jo.exports=function(a,e,t){Dv(Ln(e),0,7)==="Symbol("&&(e="["+Lv(Ln(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!zt(a,"name")||Iv&&a.name!==e)&&(Ja?ur(a,"name",{value:e,configurable:!0}):a.name=e),Bv&&t&&zt(t,"arity")&&a.length!==t.arity&&ur(a,"length",{value:t.arity});try{t&&zt(t,"constructor")&&t.constructor?Ja&&ur(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=_v(a);return zt(r,"source")||(r.source=kv(jv,typeof e=="string"?e:"")),a};Function.prototype.toString=Fv(function(){return Nv(this)&&Vv(this).source||Mv(this)},"toString");var iu=Jo.exports,Uv=B,Gv=Oe,zv=iu,Hv=$i,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(Uv(t)&&zv(t,n,r),r.global)i?a[e]=t:Hv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Gv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Yv=Math.ceil,Xv=Math.floor,Wv=Math.trunc||function(e){var t=+e;return(t>0?Xv:Yv)(t)},qv=Wv,Ar=function(a){var e=+a;return e!==e||e===0?0:qv(e)},Qv=Ar,Kv=Math.max,Zv=Math.min,Jv=function(a,e){var t=Qv(a);return t<0?Kv(t+e,0):Zv(t,e)},ef=Ar,tf=Math.min,ut=function(a){var e=ef(a);return e>0?tf(e,9007199254740991):0},rf=ut,Ii=function(a){return rf(a.length)},af=wt,nf=Jv,sf=Ii,of=function(a){return function(e,t,r){var i=af(e),n=sf(i);if(n===0)return!a&&-1;var o=nf(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},su={indexOf:of(!1)},uf=L,ga=fe,lf=wt,hf=su.indexOf,vf=Ri,kn=uf([].push),ou=function(a,e){var t=lf(a),r=0,i=[],n;for(n in t)!ga(vf,n)&&ga(t,n)&&kn(i,n);for(;e.length>r;)ga(t,n=e[r++])&&(~hf(i,n)||kn(i,n));return i},Mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ff=ou,cf=Mi,gf=cf.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return ff(e,gf)};var uu={};uu.f=Object.getOwnPropertySymbols;var df=Fe,pf=L,yf=nu,mf=uu,bf=J,xf=pf([].concat),Tf=df("Reflect","ownKeys")||function(e){var t=yf.f(bf(e)),r=mf.f;return r?xf(t,r(e)):t},Bn=fe,Of=Tf,Sf=$t,Ef=Oe,$f=function(a,e,t){for(var r=Of(e),i=Ef.f,n=Sf.f,o=0;of;f++)if(v=y(a[f]),v&&ms(xs,v))return v;return new vr(!1)}l=$d(a,h)}for(g=n?a.next:l.next;!(d=xd(g,l)).done;){var T=d.value;try{v=y(T)}catch(b){if(l)bs(l,"throw",b);else throw b}if(typeof v=="object"&&v&&ms(xs,v))return v}return new vr(!1)},Ad=z,Uu=Ad("iterator"),Gu=!1;try{var Pd=0,Ts={next:function(){return{done:!!Pd++}},return:function(){Gu=!0}};Ts[Uu]=function(){return this},Array.from(Ts,function(){throw 2})}catch{}var Rd=function(a,e){try{if(!e&&!Gu)return!1}catch{return!1}var t=!1;try{var r={};r[Uu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Nd=Ir,Id=Rd,Md=Rt.CONSTRUCTOR,zu=Md||!Id(function(a){Nd.all(a).then(void 0,function(){})}),_d=ee,Vd=Y,Dd=Te,Ld=lt,kd=ki,Bd=Fu,jd=zu;_d({target:"Promise",stat:!0,forced:jd},{all:function(e){var t=this,r=Ld.f(t),i=r.resolve,n=r.reject,o=kd(function(){var s=Dd(t.resolve),u=[],l=0,h=1;Bd(e,function(f){var c=l++,v=!1;h++,Vd(s,t,f).then(function(g){v||(v=!0,u[c]=g,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Fd=ee,Ud=Rt.CONSTRUCTOR,si=Ir,Gd=Fe,zd=B,Hd=Ue,Os=si&&si.prototype;Fd({target:"Promise",proto:!0,forced:Ud,real:!0},{catch:function(a){return this.then(void 0,a)}});if(zd(si)){var Ss=Gd("Promise").prototype.catch;Os.catch!==Ss&&Hd(Os,"catch",Ss,{unsafe:!0})}var Yd=ee,Xd=Y,Wd=Te,qd=lt,Qd=ki,Kd=Fu,Zd=zu;Yd({target:"Promise",stat:!0,forced:Zd},{race:function(e){var t=this,r=qd.f(t),i=r.reject,n=Qd(function(){var o=Wd(t.resolve);Kd(e,function(s){Xd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var Jd=ee,ep=lt,tp=Rt.CONSTRUCTOR;Jd({target:"Promise",stat:!0,forced:tp},{reject:function(e){var t=ep.f(this),r=t.reject;return r(e),t.promise}});var rp=J,ap=ae,ip=lt,np=function(a,e){if(rp(a),ap(e)&&e.constructor===a)return e;var t=ip.f(a),r=t.resolve;return r(e),t.promise},sp=ee,op=Fe,up=Rt.CONSTRUCTOR,lp=np;op("Promise");sp({target:"Promise",stat:!0,forced:up},{resolve:function(e){return lp(this,e)}});function Es(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){Es(n,r,i,o,s,"next",u)}function s(u){Es(n,r,i,o,s,"throw",u)}o(void 0)})}}var hp=_i,vp=String,pe=function(a){if(hp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return vp(a)},fp=J,Hu=function(){var a=fp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Gi=D,cp=_,zi=cp.RegExp,Hi=Gi(function(){var a=zi("a","y");return a.lastIndex=2,a.exec("abcd")!==null});Hi||Gi(function(){return!zi("a","y").sticky});var gp=Hi||Gi(function(){var a=zi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Yu={BROKEN_CARET:gp,UNSUPPORTED_Y:Hi},Xu={},dp=ou,pp=Mi,yp=Object.keys||function(e){return dp(e,pp)},mp=he,bp=Zo,xp=Oe,Tp=J,Op=wt,Sp=yp;Xu.f=mp&&!bp?Object.defineProperties:function(e,t){Tp(e);for(var r=Op(t),i=Sp(t),n=i.length,o=0,s;n>o;)xp.f(e,s=i[o++],r[s]);return e};var Ep=J,$p=Xu,$s=Mi,wp=Ri,Cp=xu,Ap=$r,Pp=Pi,ws=">",Cs="<",oi="prototype",ui="script",Wu=Pp("IE_PROTO"),wa=function(){},qu=function(a){return Cs+ui+ws+a+Cs+"/"+ui+ws},As=function(a){a.write(qu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Rp=function(){var a=Ap("iframe"),e="java"+ui+":",t;return a.style.display="none",Cp.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(qu("document.F=Object")),t.close(),t.F},Jt,fr=function(){try{Jt=new ActiveXObject("htmlfile")}catch{}fr=typeof document<"u"?document.domain&&Jt?As(Jt):Rp():As(Jt);for(var a=$s.length;a--;)delete fr[oi][$s[a]];return fr()};wp[Wu]=!0;var Yi=Object.create||function(e,t){var r;return e!==null?(wa[oi]=Ep(e),r=new wa,wa[oi]=null,r[Wu]=e):r=fr(),t===void 0?r:$p.f(r,t)},Np=D,Ip=_,Mp=Ip.RegExp,_p=Np(function(){var a=Mp(".","s");return!(a.dotAll&&a.test(` -`)&&a.flags==="s")}),Vp=D,Dp=_,Lp=Dp.RegExp,kp=Vp(function(){var a=Lp("(?b)","g");return a.exec("b").groups.a!=="b"||"b".replace(a,"$c")!=="bc"}),et=Y,_r=L,Bp=pe,jp=Hu,Fp=Yu,Up=Ci,Gp=Yi,zp=Cr.get,Hp=_p,Yp=kp,Xp=Up("native-string-replace",String.prototype.replace),br=RegExp.prototype.exec,li=br,Wp=_r("".charAt),qp=_r("".indexOf),Qp=_r("".replace),Ps=_r("".slice),hi=function(){var a=/a/,e=/b*/g;return et(br,a,"a"),et(br,e,"a"),a.lastIndex!==0||e.lastIndex!==0}(),Qu=Fp.BROKEN_CARET,vi=/()??/.exec("")[1]!==void 0,Kp=hi||vi||Qu||Hp||Yp,Rs=function(a,e){for(var t=a.groups=Gp(null),r=0;r0&&Wp(i,t.lastIndex-1);t.lastIndex>0&&(!t.multiline||t.multiline&&d!==` -`&&d!=="\r"&&d!=="\u2028"&&d!=="\u2029")&&(c="(?: (?:"+c+"))",g=" "+g,v++),s=new RegExp("^(?:"+c+")",f)}vi&&(s=new RegExp("^"+c+"$(?!\\s)",f)),hi&&(u=t.lastIndex);var p=et(br,h?s:t,g);return h?p?(p.input=i,p[0]=Ps(p[0],v),p.index=t.lastIndex,t.lastIndex+=p[0].length):t.lastIndex=0:hi&&p&&(t.lastIndex=t.global?p.index+p[0].length:u),vi&&p&&p.length>1&&et(Xp,p[0],s,function(){for(var y=1;y=n?a?"":void 0:(o=Vs(r,i),o<55296||o>56319||i+1===n||(s=Vs(r,i+1))<56320||s>57343?a?ny(r,i):o:a?sy(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},uy={charAt:oy(!0)},ly=uy.charAt,Qi=function(a,e,t){return e+(t&&ly(a,e).length||1)},hy=_,vy=D,Ds=hy.RegExp,fy=!vy(function(){var a=!0;try{Ds(".","d")}catch{a=!1}var e={},t="",r=a?"dgimsy":"gimsy",i=function(u,l){Object.defineProperty(e,u,{get:function(){return t+=l,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};a&&(n.hasIndices="d");for(var o in n)i(o,n[o]);var s=Object.getOwnPropertyDescriptor(Ds.prototype,"flags").get.call(e);return s!==r||t!==r}),cy={correct:fy},gy=Y,dy=fe,py=Or,Ls=cy,yy=Hu,my=RegExp.prototype,Vr=Ls.correct?function(a){return a.flags}:function(a){return!Ls.correct&&py(my,a)&&!dy(a,"flags")?gy(yy,a):a.flags},ks=Y,by=J,xy=B,Ty=je,Oy=Xi,Sy=TypeError,Ki=function(a,e){var t=a.exec;if(xy(t)){var r=ks(t,a,e);return r!==null&&by(r),r}if(Ty(a)==="RegExp")return ks(Oy,a,e);throw new Sy("RegExp#exec called on incompatible receiver")},Ey=Y,$y=L,wy=Wi,Cy=J,Ay=ae,Py=ut,er=pe,Ry=ve,Ny=ot,Iy=Qi,My=Vr,Bs=Ki,Aa=$y("".indexOf);wy("match",function(a,e,t){return[function(i){var n=Ry(this),o=Ay(i)?Ny(i,a):void 0;return o?Ey(o,i,n):new RegExp(i)[a](er(n))},function(r){var i=Cy(this),n=er(r),o=t(e,i,n);if(o.done)return o.value;var s=er(My(i));if(!~Aa(s,"g"))return Bs(i,n);var u=!!~Aa(s,"u")||!!~Aa(s,"v");i.lastIndex=0;for(var l=[],h=0,f;(f=Bs(i,n))!==null;){var c=er(f[0]);l[h]=c,c===""&&(i.lastIndex=Iy(n,Py(i.lastIndex),u)),h++}return h===0?null:l}]});var Zi=L,_y=Er,Vy=Math.floor,Pa=Zi("".charAt),Dy=Zi("".replace),Ra=Zi("".slice),Ly=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ky=/\$([$&'`]|\d{1,2})/g,By=function(a,e,t,r,i,n){var o=t+a.length,s=r.length,u=ky;return i!==void 0&&(i=_y(i),u=Ly),Dy(n,u,function(l,h){var f;switch(Pa(h,0)){case"$":return"$";case"&":return a;case"`":return Ra(e,0,t);case"'":return Ra(e,o);case"<":f=i[Ra(h,1,-1)];break;default:var c=+h;if(c===0)return l;if(c>s){var v=Vy(c/10);return v===0?l:v<=s?r[v-1]===void 0?Pa(h,1):r[v-1]+Pa(h,1):l}f=r[c-1]}return f===void 0?"":f})},jy=bu,js=Y,Dr=L,Fy=Wi,Uy=D,Gy=J,zy=B,Hy=ae,Yy=Ar,Xy=ut,Me=pe,Wy=ve,qy=Qi,Qy=ot,Ky=By,Zy=Vr,Jy=Ki,em=z,fi=em("replace"),tm=Math.max,rm=Math.min,am=Dr([].concat),Na=Dr([].push),We=Dr("".indexOf),Fs=Dr("".slice),im=function(a){return a===void 0?a:String(a)},nm=function(){return"a".replace(/./,"$0")==="$0"}(),Us=function(){return/./[fi]?/./[fi]("a","$0")==="":!1}(),sm=!Uy(function(){var a=/./;return a.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(a,"$")!=="7"});Fy("replace",function(a,e,t){var r=Us?"$":"$0";return[function(n,o){var s=Wy(this),u=Hy(n)?Qy(n,fi):void 0;return u?js(u,n,s,o):js(e,Me(s),n,o)},function(i,n){var o=Gy(this),s=Me(i),u=zy(n);u||(n=Me(n));var l=Me(Zy(o));if(typeof n=="string"&&!~We(n,r)&&!~We(n,"$<")&&!~We(l,"y")){var h=t(e,o,s,n);if(h.done)return h.value}var f=!!~We(l,"g"),c;f&&(c=!!~We(l,"u")||!!~We(l,"v"),o.lastIndex=0);for(var v=[],g;g=Jy(o,s),!(g===null||(Na(v,g),!f));){var d=Me(g[0]);d===""&&(o.lastIndex=qy(s,Xy(o.lastIndex),c))}for(var p="",y=0,T=0;T=y&&(p+=Fs(s,y,x)+E,y=x+b.length)}return p+Fs(s,y)}]},!sm||!nm||Us);var om=ae,um=je,lm=z,hm=lm("match"),vm=function(a){var e;return om(a)&&((e=a[hm])!==void 0?!!e:um(a)==="RegExp")},fm=vm,cm=TypeError,Ji=function(a){if(fm(a))throw new cm("The method doesn't accept regular expressions");return a},gm=z,dm=gm("match"),en=function(a){var e=/./;try{"/./"[a](e)}catch{try{return e[dm]=!1,"/./"[a](e)}catch{}}return!1},pm=ee,ym=Nr,mm=$t.f,bm=ut,Gs=pe,xm=Ji,Tm=ve,Om=en,Sm=ym("".slice),Em=Math.min,Zu=Om("startsWith"),$m=!Zu&&!!function(){var a=mm(String.prototype,"startsWith");return a&&!a.writable}();pm({target:"String",proto:!0,forced:!$m&&!Zu},{startsWith:function(e){var t=Gs(Tm(this));xm(e);var r=Gs(e),i=bm(Em(arguments.length>1?arguments[1]:void 0,t.length));return Sm(t,i,i+r.length)===r}});var wm=z,Cm=Yi,Am=Oe.f,ci=wm("unscopables"),gi=Array.prototype;gi[ci]===void 0&&Am(gi,ci,{configurable:!0,value:Cm(null)});var Pm=function(a){gi[ci][a]=!0},Rm=D,Nm=!Rm(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}),Im=fe,Mm=B,_m=Er,Vm=Pi,Dm=Nm,zs=Vm("IE_PROTO"),di=Object,Lm=di.prototype,Ju=Dm?di.getPrototypeOf:function(a){var e=_m(a);if(Im(e,zs))return e[zs];var t=e.constructor;return Mm(t)&&e instanceof t?t.prototype:e instanceof di?Lm:null},km=D,Bm=B,jm=ae,Hs=Ju,Fm=Ue,Um=z,pi=Um("iterator"),el=!1,ke,Ia,Ma;[].keys&&(Ma=[].keys(),"next"in Ma?(Ia=Hs(Hs(Ma)),Ia!==Object.prototype&&(ke=Ia)):el=!0);var Gm=!jm(ke)||km(function(){var a={};return ke[pi].call(a)!==a});Gm&&(ke={});Bm(ke[pi])||Fm(ke,pi,function(){return this});var tl={IteratorPrototype:ke,BUGGY_SAFARI_ITERATORS:el},zm=tl.IteratorPrototype,Hm=Yi,Ym=Si,Xm=Rr,Wm=Nt,qm=function(){return this},Qm=function(a,e,t,r){var i=e+" Iterator";return a.prototype=Hm(zm,{next:Ym(+!r,t)}),Xm(a,i,!1),Wm[i]=qm,a},Km=ee,Zm=Y,rl=wr,Jm=B,e0=Qm,Ys=Ju,Xs=vu,t0=Rr,r0=At,_a=Ue,a0=z,i0=Nt,al=tl,n0=rl.PROPER,s0=rl.CONFIGURABLE,Ws=al.IteratorPrototype,tr=al.BUGGY_SAFARI_ITERATORS,gt=a0("iterator"),qs="keys",dt="values",Qs="entries",o0=function(){return this},u0=function(a,e,t,r,i,n,o){e0(t,e,r);var s=function(y){if(y===i&&c)return c;if(!tr&&y&&y in h)return h[y];switch(y){case qs:return function(){return new t(this,y)};case dt:return function(){return new t(this,y)};case Qs:return function(){return new t(this,y)}}return function(){return new t(this)}},u=e+" Iterator",l=!1,h=a.prototype,f=h[gt]||h["@@iterator"]||i&&h[i],c=!tr&&f||s(i),v=e==="Array"&&h.entries||f,g,d,p;if(v&&(g=Ys(v.call(new a)),g!==Object.prototype&&g.next&&(Ys(g)!==Ws&&(Xs?Xs(g,Ws):Jm(g[gt])||_a(g,gt,o0)),t0(g,u,!0))),n0&&i===dt&&f&&f.name!==dt&&(s0?r0(h,"name",dt):(l=!0,c=function(){return Zm(f,this)})),i)if(d={values:s(dt),keys:n?c:s(qs),entries:s(Qs)},o)for(p in d)(tr||l||!(p in h))&&_a(h,p,d[p]);else Km({target:e,proto:!0,forced:tr||l},d);return h[gt]!==c&&_a(h,gt,c,{name:i}),i0[e]=c,d},l0=function(a,e){return{value:a,done:e}},h0=wt,tn=Pm,Ks=Nt,il=Cr,v0=Oe.f,f0=u0,rr=l0,c0=he,nl="Array Iterator",g0=il.set,d0=il.getterFor(nl),p0=f0(Array,"Array",function(a,e){g0(this,{type:nl,target:h0(a),index:0,kind:e})},function(){var a=d0(this),e=a.target,t=a.index++;if(!e||t>=e.length)return a.target=null,rr(void 0,!0);switch(a.kind){case"keys":return rr(t,!1);case"values":return rr(e[t],!1)}return rr([t,e[t]],!1)},"values"),Zs=Ks.Arguments=Ks.Array;tn("keys");tn("values");tn("entries");if(c0&&Zs.name!=="values")try{v0(Zs,"name",{value:"values"})}catch{}var y0={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},m0=$r,Va=m0("span").classList,Js=Va&&Va.constructor&&Va.constructor.prototype,b0=Js===Object.prototype?void 0:Js,eo=_,sl=y0,x0=b0,yt=p0,to=At,T0=Rr,O0=z,Da=O0("iterator"),La=yt.values,ol=function(a,e){if(a){if(a[Da]!==La)try{to(a,Da,La)}catch{a[Da]=La}if(T0(a,e,!0),sl[e]){for(var t in yt)if(a[t]!==yt[t])try{to(a,t,yt[t])}catch{a[t]=yt[t]}}}};for(var ka in sl)ol(eo[ka]&&eo[ka].prototype,ka);ol(x0,"DOMTokenList");function S0(a,e){if(Xa(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function E0(a){var e=S0(a,"string");return Xa(e)=="symbol"?e:e+""}function rn(a,e,t){return(e=E0(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var $0=Te,w0=Er,C0=Go,A0=Ii,ro=TypeError,ao="Reduce of empty array with no initial value",P0=function(a){return function(e,t,r,i){var n=w0(e),o=C0(n),s=A0(n);if($0(t),s===0&&r<2)throw new ro(ao);var u=a?s-1:0,l=a?-1:1;if(r<2)for(;;){if(u in o){i=o[u],u+=l;break}if(u+=l,a?u<0:s<=u)throw new ro(ao)}for(;a?u>=0:s>u;u+=l)u in o&&(i=t(i,o[u],u,n));return i}},R0={left:P0(!1)},N0=D,ul=function(a,e){var t=[][a];return!!t&&N0(function(){t.call(null,e||function(){return 1},1)})},I0=ee,M0=R0.left,_0=ul,io=Ei,V0=Pr,D0=!V0&&io>79&&io<83,L0=D0||!_0("reduce");I0({target:"Array",proto:!0,forced:L0},{reduce:function(e){var t=arguments.length;return M0(this,e,t,t>1?arguments[1]:void 0)}});var k0=ee,B0=Nr,j0=$t.f,F0=ut,no=pe,U0=Ji,G0=ve,z0=en,H0=B0("".slice),Y0=Math.min,ll=z0("endsWith"),X0=!ll&&!!function(){var a=j0(String.prototype,"endsWith");return a&&!a.writable}();k0({target:"String",proto:!0,forced:!X0&&!ll},{endsWith:function(e){var t=no(G0(this));U0(e);var r=no(e),i=arguments.length>1?arguments[1]:void 0,n=t.length,o=i===void 0?n:Y0(F0(i),n);return H0(t,o-r.length,o)===r}});var Ba=Y,an=L,W0=Wi,q0=J,Q0=ae,K0=ve,Z0=yu,J0=Qi,eb=ut,ja=pe,tb=ot,rb=Vr,so=Ki,ab=Yu,ib=D,qe=ab.UNSUPPORTED_Y,nb=4294967295,sb=Math.min,Fa=an([].push),Ua=an("".slice),ar=an("".indexOf),ob=!ib(function(){var a=/(?:)/,e=a.exec;a.exec=function(){return e.apply(this,arguments)};var t="ab".split(a);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),oo="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;W0("split",function(a,e,t){var r="0".split(void 0,0).length?function(i,n){return i===void 0&&n===0?[]:Ba(e,this,i,n)}:e;return[function(n,o){var s=K0(this),u=Q0(n)?tb(n,a):void 0;return u?Ba(u,n,s,o):Ba(r,ja(s),n,o)},function(i,n){var o=q0(this),s=ja(i);if(!oo){var u=t(r,o,s,n,r!==e);if(u.done)return u.value}var l=Z0(o,RegExp),h=ja(rb(o)),f=!!~ar(h,"u")||!!~ar(h,"v");qe?~ar(h,"g")||(h+="g"):~ar(h,"y")||(h+="y");var c=new l(qe?"^(?:"+o.source+")":o,h),v=n===void 0?nb:n>>>0;if(v===0)return[];if(s.length===0)return so(c,s)===null?[s]:[];for(var g=0,d=0,p=[];d"u"?Ke:window,ir=["moz","webkit"],rt="AnimationFrame",st=be["request"+rt],Et=be["cancel"+rt]||be["cancelRequest"+rt];for(var pt=0;!st&&pt3&&(this.alpha=s[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 "+d.toRGB()+" -> "+d.toHex());g.appendChild(p),g.appendChild(y),v.appendChild(g)}catch{}return v}};const mi=Do($b);var wb=ee,Cb=Nr,Ab=su.indexOf,Pb=ul,bi=Cb([].indexOf),vl=!!bi&&1/bi([1],1,-0)<0,Rb=vl||!Pb("indexOf");wb({target:"Array",proto:!0,forced:Rb},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return vl?bi(this,e,t)||0:Ab(this,e,t)}});var Nb=ee,Ib=L,Mb=Ji,_b=ve,fo=pe,Vb=en,Db=Ib("".indexOf);Nb({target:"String",proto:!0,forced:!Vb("includes")},{includes:function(e){return!!~Db(fo(_b(this)),fo(Mb(e)),arguments.length>1?arguments[1]:void 0)}});var Lb=je,kb=Array.isArray||function(e){return Lb(e)==="Array"},Bb=ee,jb=L,Fb=kb,Ub=jb([].reverse),co=[1,2];Bb({target:"Array",proto:!0,forced:String(co)===String(co.reverse())},{reverse:function(){return Fb(this)&&(this.length=this.length),Ub(this)}});/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var fl=function(a,e){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(a,e)};function cl(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=a}fl(a,e),a.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Gb(a){var e="";Array.isArray(a)||(a=[a]);for(var t=0;ta.phi1&&(a.phi2-=2*Ee),a.sweepFlag===1&&a.phi2r)return[];if(r===0)return[[a*t/(a*a+e*e),e*t/(a*a+e*e)]];var i=Math.sqrt(r);return[[(a*t+e*i)/(a*a+e*e),(e*t-a*i)/(a*a+e*e)],[(a*t-e*i)/(a*a+e*e),(e*t+a*i)/(a*a+e*e)]]}var U,ye=Math.PI/180;function po(a,e,t){return(1-t)*a+t*e}function yo(a,e,t,r){return a+Math.cos(r/180*Ee)*e+Math.sin(r/180*Ee)*t}function mo(a,e,t,r){var i=1e-6,n=e-a,o=t-e,s=3*n+3*(r-t)-6*o,u=6*(o-n),l=3*n;return Math.abs(s)O&&(v.sweepFlag=+!v.sweepFlag),v})}function o(){return function(s){var u={};for(var l in s)u[l]=s[l];return u}}a.ROUND=function(s){function u(l){return Math.round(l*s)/s}return s===void 0&&(s=1e13),ue(s),function(l){return l.x1!==void 0&&(l.x1=u(l.x1)),l.y1!==void 0&&(l.y1=u(l.y1)),l.x2!==void 0&&(l.x2=u(l.x2)),l.y2!==void 0&&(l.y2=u(l.y2)),l.x!==void 0&&(l.x=u(l.x)),l.y!==void 0&&(l.y=u(l.y)),l.rX!==void 0&&(l.rX=u(l.rX)),l.rY!==void 0&&(l.rY=u(l.rY)),l}},a.TO_ABS=e,a.TO_REL=function(){return i(function(s,u,l){return s.relative||(s.x1!==void 0&&(s.x1-=u),s.y1!==void 0&&(s.y1-=l),s.x2!==void 0&&(s.x2-=u),s.y2!==void 0&&(s.y2-=l),s.x!==void 0&&(s.x-=u),s.y!==void 0&&(s.y-=l),s.relative=!0),s})},a.NORMALIZE_HVZ=function(s,u,l){return s===void 0&&(s=!0),u===void 0&&(u=!0),l===void 0&&(l=!0),i(function(h,f,c,v,g){if(isNaN(v)&&!(h.type&m.MOVE_TO))throw new Error("path must start with moveto");return u&&h.type&m.HORIZ_LINE_TO&&(h.type=m.LINE_TO,h.y=h.relative?0:c),l&&h.type&m.VERT_LINE_TO&&(h.type=m.LINE_TO,h.x=h.relative?0:f),s&&h.type&m.CLOSE_PATH&&(h.type=m.LINE_TO,h.x=h.relative?v-f:v,h.y=h.relative?g-c:g),h.type&m.ARC&&(h.rX===0||h.rY===0)&&(h.type=m.LINE_TO,delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag),h})},a.NORMALIZE_ST=t,a.QT_TO_C=r,a.INFO=i,a.SANITIZE=function(s){s===void 0&&(s=0),ue(s);var u=NaN,l=NaN,h=NaN,f=NaN;return i(function(c,v,g,d,p){var y=Math.abs,T=!1,b=0,x=0;if(c.type&m.SMOOTH_CURVE_TO&&(b=isNaN(u)?0:v-u,x=isNaN(l)?0:g-l),c.type&(m.CURVE_TO|m.SMOOTH_CURVE_TO)?(u=c.relative?v+c.x2:c.x2,l=c.relative?g+c.y2:c.y2):(u=NaN,l=NaN),c.type&m.SMOOTH_QUAD_TO?(h=isNaN(h)?v:2*v-h,f=isNaN(f)?g:2*g-f):c.type&m.QUAD_TO?(h=c.relative?v+c.x1:c.x1,f=c.relative?g+c.y1:c.y2):(h=NaN,f=NaN),c.type&m.LINE_COMMANDS||c.type&m.ARC&&(c.rX===0||c.rY===0||!c.lArcFlag)||c.type&m.CURVE_TO||c.type&m.SMOOTH_CURVE_TO||c.type&m.QUAD_TO||c.type&m.SMOOTH_QUAD_TO){var $=c.x===void 0?0:c.relative?c.x:c.x-v,E=c.y===void 0?0:c.relative?c.y:c.y-g;b=isNaN(h)?c.x1===void 0?b:c.relative?c.x:c.x1-v:h-v,x=isNaN(f)?c.y1===void 0?x:c.relative?c.y:c.y1-g:f-g;var O=c.x2===void 0?0:c.relative?c.x:c.x2-v,C=c.y2===void 0?0:c.relative?c.y:c.y2-g;y($)<=s&&y(E)<=s&&y(b)<=s&&y(x)<=s&&y(O)<=s&&y(C)<=s&&(T=!0)}return c.type&m.CLOSE_PATH&&y(v-d)<=s&&y(g-p)<=s&&(T=!0),T?[]:c})},a.MATRIX=n,a.ROTATE=function(s,u,l){u===void 0&&(u=0),l===void 0&&(l=0),ue(s,u,l);var h=Math.sin(s),f=Math.cos(s);return n(f,h,-h,f,u-u*f+l*h,l-u*h-l*f)},a.TRANSLATE=function(s,u){return u===void 0&&(u=0),ue(s,u),n(1,0,0,1,s,u)},a.SCALE=function(s,u){return u===void 0&&(u=s),ue(s,u),n(s,0,0,u,0,0)},a.SKEW_X=function(s){return ue(s),n(1,0,Math.atan(s),1,0,0)},a.SKEW_Y=function(s){return ue(s),n(1,Math.atan(s),0,1,0,0)},a.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ue(s),n(-1,0,0,1,s,0)},a.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ue(s),n(1,0,0,-1,0,s)},a.A_TO_C=function(){return i(function(s,u,l){return m.ARC===s.type?function(h,f,c){var v,g,d,p;h.cX||Ha(h,f,c);for(var y=Math.min(h.phi1,h.phi2),T=Math.max(h.phi1,h.phi2)-y,b=Math.ceil(T/90),x=new Array(b),$=f,E=c,O=0;Of.maxX&&(f.maxX=M),Mf.maxY&&(f.maxY=M),MN&&p(bo(v,d.x1,d.x2,d.x,N));for(var x=0,$=mo(g,d.y1,d.y2,d.y);x<$.length;x++)0<(N=$[x])&&1>N&&y(bo(g,d.y1,d.y2,d.y,N))}if(d.type&m.ARC){p(d.x),y(d.y),Ha(d,v,g);for(var E=d.xRot/180*Math.PI,O=Math.cos(E)*d.rX,C=Math.sin(E)*d.rX,P=-Math.sin(E)*d.rY,V=Math.cos(E)*d.rY,j=d.phi1d.phi2?[d.phi2+360,d.phi1+360]:[d.phi2,d.phi1],R=j[0],X=j[1],W=function(M){var K=M[0],se=M[1],ge=180*Math.atan2(se,K)/Math.PI;return geR&&NR&&Nh)throw new SyntaxError('Expected positive number, got "'+h+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(h),this.curArgs.length===Yb[this.curCommandType]&&(m.HORIZ_LINE_TO===this.curCommandType?n({type:m.HORIZ_LINE_TO,relative:this.curCommandRelative,x:h}):m.VERT_LINE_TO===this.curCommandType?n({type:m.VERT_LINE_TO,relative:this.curCommandRelative,y:h}):this.curCommandType===m.MOVE_TO||this.curCommandType===m.LINE_TO||this.curCommandType===m.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),m.MOVE_TO===this.curCommandType&&(this.curCommandType=m.LINE_TO)):this.curCommandType===m.CURVE_TO?n({type:m.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===m.SMOOTH_CURVE_TO?n({type:m.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.QUAD_TO?n({type:m.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.ARC&&n({type:m.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!zb(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(l)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=m.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=m.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=m.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=m.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=m.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=m.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=m.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=m.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=m.ARC,this.curCommandRelative=s==="a"}else r.push({type:m.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var n=0,o=Object.getPrototypeOf(this).parse.call(this,r);n>>$;if(o[b+3]=Gr,Gr!==0){var zr=255/Gr;o[b]=(M*x>>>$)*zr,o[b+1]=(K*x>>>$)*zr,o[b+2]=(se*x>>>$)*zr}else o[b]=o[b+1]=o[b+2]=0;M-=q,K-=H,se-=Q,ge-=N,q-=p.r,H-=p.g,Q-=p.b,N-=p.a;var Ae=Ur+n+1;Ae=T+(Ae>>$,te>0?(te=255/te,o[re]=(Dt*x>>>$)*te,o[re+1]=(Lt*x>>>$)*te,o[re+2]=(kt*x>>>$)*te):o[re]=o[re+1]=o[re+2]=0,Dt-=Hr,Lt-=Yr,kt-=Xr,Bt-=Wr,Hr-=p.r,Yr-=p.g,Xr-=p.b,Wr-=p.a,re=He+((re=Jr+h)0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:a,createCanvas(t,r){return new OffscreenCanvas(t,r)},createImage(t){return xe(function*(){var r=yield fetch(t),i=yield r.blob(),n=yield createImageBitmap(i);return n})()}};return(typeof DOMParser<"u"||typeof a>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function o1(a){var{DOMParser:e,canvas:t,fetch:r}=a;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:t.createCanvas,createImage:t.loadImage}}var x2=Object.freeze({__proto__:null,offscreen:s1,node:o1});function ht(a){return a.replace(/(?!\u3000)\s+/gm," ")}function u1(a){return a.replace(/^[\n \t]+/,"")}function l1(a){return a.replace(/[\n \t]+$/,"")}function ne(a){var e=(a||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var h1=/^[A-Z-]+$/;function v1(a){return h1.test(a)?a.toLowerCase():a}function yl(a){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(a)||[];return e[2]||e[3]||e[4]}function f1(a){if(!a.startsWith("rgb"))return a;var e=3,t=a.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return t}var c1=/(\[[^\]]+\])/g,g1=/(#[^\s+>~.[:]+)/g,d1=/(\.[^\s+>~.[:]+)/g,p1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,y1=/(:[\w-]+\([^)]*\))/gi,m1=/(:[^\s+>~.[:]+)/g,b1=/([^\s+>~.[:]+)/g;function Ve(a,e){var t=e.exec(a);return t?[a.replace(e," "),t.length]:[a,0]}function x1(a){var e=[0,0,0],t=a.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[t,r]=Ve(t,c1),e[1]+=r,[t,r]=Ve(t,g1),e[0]+=r,[t,r]=Ve(t,d1),e[1]+=r,[t,r]=Ve(t,p1),e[2]+=r,[t,r]=Ve(t,y1),e[1]+=r,[t,r]=Ve(t,m1),e[1]+=r,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,r]=Ve(t,b1),e[2]+=r,e.join("")}var at=1e-8;function So(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))}function Ti(a,e){return(a[0]*e[0]+a[1]*e[1])/(So(a)*So(e))}function Eo(a,e){return(a[0]*e[1]0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:r}=this;return ht(this.getString()).trim().split(e).map(i=>new S(t,r,i))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,r=typeof t=="string";return!r||!e?r:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=f1(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(r);default:{var o=this.getNumber();return t&&o<1?o*n.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,t);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?S.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),r=t.length,i=0,n=0;n1&&arguments[1]!==void 0?arguments[1]:0,[r=t,i=t]=ne(e);return new k(r,i)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=t,i=r]=ne(e);return new k(r,i)}static parsePath(e){for(var t=ne(e),r=t.length,i=[],n=0;n0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach((n,o)=>{for(var{run:s}=n,u=r[o];u;)s(u),u=u.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:u}=n;!i[o]&&t.isPointInPath&&t.isPointInPath(s,u)&&(i[o]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:u}=n;!i[o]&&t.isPointInBox(s,u)&&(i[o]=e)})}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,n=new k(e,t),o=i.canvas;o;)n.x-=o.offsetLeft,n.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(n.x+=r.scrollX),r.scrollY&&(n.y+=r.scrollY),n}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var ml=typeof window<"u"?window:null,bl=typeof fetch<"u"?fetch.bind(void 0):null;class kr{constructor(e){var{fetch:t=bl,window:r=ml}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new T1,this.mouse=new O1(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:n,desiredWidth:o,height:s,desiredHeight:u,minX:l=0,minY:h=0,refX:f,refY:c,clip:v=!1,clipX:g=0,clipY:d=0}=e,p=ht(i).replace(/^defer\s/,""),[y,T]=p.split(" "),b=y||"xMidYMid",x=T||"meet",$=n/o,E=s/u,O=Math.min($,E),C=Math.max($,E),P=o,V=u;x==="meet"&&(P*=O,V*=O),x==="slice"&&(P*=C,V*=C);var j=new S(t,"refX",f),R=new S(t,"refY",c),X=j.hasValue()&&R.hasValue();if(X&&r.translate(-O*j.getPixels("x"),-O*R.getPixels("y")),v){var W=O*g,G=O*d;r.beginPath(),r.moveTo(W,G),r.lineTo(n,G),r.lineTo(n,s),r.lineTo(W,s),r.closePath(),r.clip()}if(!X){var q=x==="meet"&&O===E,H=x==="slice"&&C===E,Q=x==="meet"&&O===$,N=x==="slice"&&C===$;b.startsWith("xMid")&&(q||H)&&r.translate(n/2-P/2,0),b.endsWith("YMid")&&(Q||N)&&r.translate(0,s/2-V/2),b.startsWith("xMax")&&(q||H)&&r.translate(n-P,0),b.endsWith("YMax")&&(Q||N)&&r.translate(0,s-V)}switch(!0){case b==="none":r.scale($,E);break;case x==="meet":r.scale(O,O);break;case x==="slice":r.scale(C,C);break}r.translate(-l,-h)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:n=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:u,scaleHeight:l,offsetX:h,offsetY:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:c,mouse:v}=this,g=1e3/c;if(this.frameDuration=g,this.readyPromise=new Promise(b=>{this.resolveReady=b}),this.isReady()&&this.render(e,n,o,u,l,h,f),!!t){var d=Date.now(),p=d,y=0,T=()=>{d=Date.now(),y=d-p,y>=g&&(p=d-y%g,this.shouldUpdate(i,s)&&(this.render(e,n,o,u,l,h,f),v.runEvents())),this.intervalId=za(T)};r||v.start(),this.intervalId=za(T)}}stop(){this.intervalId&&(za.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((n,o)=>o.update(r)||n,!1);if(i)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,n,o,s){var{CLIENT_WIDTH:u,CLIENT_HEIGHT:l,viewPort:h,ctx:f,isFirstRender:c}=this,v=f.canvas;h.clear(),v.width&&v.height?h.setCurrent(v.width,v.height):h.setCurrent(u,l);var g=e.getStyle("width"),d=e.getStyle("height");!t&&(c||typeof i!="number"&&typeof n!="number")&&(g.hasValue()&&(v.width=g.getPixels("x"),v.style&&(v.style.width="".concat(v.width,"px"))),d.hasValue()&&(v.height=d.getPixels("y"),v.style&&(v.style.height="".concat(v.height,"px"))));var p=v.clientWidth||v.width,y=v.clientHeight||v.height;if(t&&g.hasValue()&&d.hasValue()&&(p=g.getPixels("x"),y=d.getPixels("y")),h.setCurrent(p,y),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof n=="number"){var T=ne(e.getAttribute("viewBox").getString()),b=0,x=0;if(typeof i=="number"){var $=e.getStyle("width");$.hasValue()?b=$.getPixels("x")/i:isNaN(T[2])||(b=T[2]/i)}if(typeof n=="number"){var E=e.getStyle("height");E.hasValue()?x=E.getPixels("y")/n:isNaN(T[3])||(x=T[3]/n)}b||(b=x),x||(x=b),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(n);var O=e.getStyle("transform",!0,!0);O.setValue("".concat(O.getString()," scale(").concat(1/b,", ").concat(1/x,")"))}r||f.clearRect(0,0,p,y),e.render(f),c&&(this.isFirstRender=!1)}}kr.defaultWindow=ml;kr.defaultFetch=bl;var{defaultFetch:S1}=kr,E1=typeof DOMParser<"u"?DOMParser:null;class Ya{constructor(){var{fetch:e=S1,DOMParser:t=E1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return xe(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return xe(function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)})()}}class $1{constructor(e,t){this.type="translate",this.point=null,this.point=k.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}}class w1{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=ne(t);this.angle=new S(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:n,angle:o}=this,s=t+i.getPixels("x"),u=r+n.getPixels("y");e.translate(s,u),e.rotate(o.getRadians()),e.translate(-s,-u)}unapply(e){var{cx:t,cy:r,originX:i,originY:n,angle:o}=this,s=t+i.getPixels("x"),u=r+n.getPixels("y");e.translate(s,u),e.rotate(-1*o.getRadians()),e.translate(-s,-u)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,n=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}}class C1{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=k.parseScale(t);(i.x===0||i.y===0)&&(i.x=at,i.y=at),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(t,r||t),e.translate(-o,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(1/t,1/r||t),e.translate(-o,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}}class xl{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=ne(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,n=t.getPixels("x"),o=r.getPixels("y");e.translate(n,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-n,-o)}unapply(e){var{originX:t,originY:r,matrix:i}=this,n=i[0],o=i[2],s=i[4],u=i[1],l=i[3],h=i[5],f=0,c=0,v=1,g=1/(n*(l*v-h*c)-o*(u*v-h*f)+s*(u*c-l*f)),d=t.getPixels("x"),p=r.getPixels("y");e.translate(d,p),e.transform(g*(l*v-h*c),g*(h*f-u*v),g*(s*c-o*v),g*(n*v-s*f),g*(o*h-s*l),g*(s*u-n*h)),e.translate(-d,-p)}applyToPoint(e){e.applyTransform(this.matrix)}}class Tl extends xl{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new S(e,"angle",t)}}class A1 extends Tl{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class P1 extends Tl{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function R1(a){return ht(a).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function N1(a){var[e,t]=a.split("(");return[e.trim(),t.trim().replace(")","")]}class Be{constructor(e,t,r){this.document=e,this.transforms=[];var i=R1(t);i.forEach(n=>{if(n!=="none"){var[o,s]=N1(n),u=Be.transformTypes[o];typeof u<"u"&&this.transforms.push(new u(this.document,s,r))}})}static fromElement(e,t){var r=t.getStyle("transform",!1,!0),[i,n=i]=t.getStyle("transform-origin",!1,!0).split(),o=[i,n];return r.hasValue()?new Be(e,r.getString(),o):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i=0;i--)t[i].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(s=>{var u=v1(s.nodeName);this.attributes[u]=new S(e,u,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(s){var[u,l]=s.split(":").map(h=>h.trim());this.styles[u]=new S(e,u,l)}})}var{definitions:n}=e,o=this.getAttribute("id");o.hasValue()&&(n[o.getString()]||(n[o.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var u=e.createTextNode(s);u.getText().length>0&&this.addChild(u)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&t){var i=new S(this.document,e,"");return this.attributes[e]=i,i}return r||S.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return S.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var n=this.getAttribute(e);if(n!=null&&n.hasValue())return this.styles[e]=n,n;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(t){var u=new S(this.document,e,"");return this.styles[e]=u,u}return i||S.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=Be.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof I?e:this.document.createElement(e);t.parent=this,I.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(t=r.getAttribute)===null||t===void 0?void 0:t.call(r,"class");return!i||i===""?!1:i.split(" ").some(n=>".".concat(n)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],n=t[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),n>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=n)}}}removeStyles(e,t){var r=t.reduce((i,n)=>{var o=e.getStyle(n);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[n,s]]},[]);return r}restoreStyles(e,t){t.forEach(r=>{var[i,n]=r;e.getStyle(i,!0).setValue(n)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}}I.ignoreChildTypes=["title"];class I1 extends I{constructor(e,t,r){super(e,t,r)}}function M1(a){var e=a.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function _1(a){return typeof process>"u"?a:a.trim().split(",").map(M1).join(",")}function V1(a){if(!a)return"";var e=a.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function D1(a){if(!a)return"";var e=a.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class Z{constructor(e,t,r,i,n,o){var s=o?typeof o=="string"?Z.parse(o):o:{};this.fontFamily=n||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r="",i="",n="",o="",s="",u=ht(e).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach(h=>{switch(!0){case(!l.fontStyle&&Z.styles.includes(h)):h!=="inherit"&&(r=h),l.fontStyle=!0;break;case(!l.fontVariant&&Z.variants.includes(h)):h!=="inherit"&&(i=h),l.fontStyle=!0,l.fontVariant=!0;break;case(!l.fontWeight&&Z.weights.includes(h)):h!=="inherit"&&(n=h),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:h!=="inherit"&&([o]=h.split("/")),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:h!=="inherit"&&(s+=h)}}),new Z(r,i,n,o,s,t)}toString(){return[V1(this.fontStyle),this.fontVariant,D1(this.fontWeight),this.fontSize,_1(this.fontFamily)].join(" ").trim()}}Z.styles="normal|italic|oblique|inherit";Z.variants="normal|small-caps|inherit";Z.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class ce{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:r,x2:i,y2:n}=e;this.addPoint(t,r),this.addPoint(i,n)}}sumCubic(e,t,r,i,n){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*n}bezierCurveAdd(e,t,r,i,n){var o=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*n,u=3*r-3*t;if(s===0){if(o===0)return;var l=-u/o;0=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new k(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==m.CURVE_TO&&e!==m.SMOOTH_CURVE_TO&&e!==m.QUAD_TO&&e!==m.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:n}}=this,o=new k(2*t-i,2*r-n);return o}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:n}=this;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var u=r.getColor();u!=="inherit"&&(e.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(i.hasValue()){var l=new S(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=l}if(n.isUrlDefinition()){var h=n.getFillStyleDefinition(this,o);h&&(e.strokeStyle=h)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());var f=n.getString();f!=="inherit"&&(e.strokeStyle=f==="none"?"rgba(0,0,0,0)":f)}if(o.hasValue()){var c=new S(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=c}var v=this.getStyle("stroke-width");if(v.hasValue()){var g=v.getPixels();e.lineWidth=g||at}var d=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),T=this.getStyle("stroke-dasharray"),b=this.getStyle("stroke-dashoffset");if(d.hasValue()&&(e.lineCap=d.getString()),p.hasValue()&&(e.lineJoin=p.getString()),y.hasValue()&&(e.miterLimit=y.getNumber()),T.hasValue()&&T.getString()!=="none"){var x=ne(T.getString());typeof e.setLineDash<"u"?e.setLineDash(x):typeof e.webkitLineDash<"u"?e.webkitLineDash=x:typeof e.mozDash<"u"&&!(x.length===1&&x[0]===0)&&(e.mozDash=x);var $=b.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=$:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=$:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=$)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var E=this.getStyle("font"),O=this.getStyle("font-style"),C=this.getStyle("font-variant"),P=this.getStyle("font-weight"),V=this.getStyle("font-size"),j=this.getStyle("font-family"),R=new Z(O.getString(),C.getString(),P.getString(),V.hasValue()?"".concat(V.getPixels(!0),"px"):"",j.getString(),Z.parse(E.getString(),e.font));O.setValue(R.fontStyle),C.setValue(R.fontVariant),P.setValue(R.fontWeight),V.setValue(R.fontSize),j.setValue(R.fontFamily),e.font=R.toString(),V.isPixels()&&(this.document.emSize=V.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class A extends Ge{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new w(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new ce;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case w.MOVE_TO:this.pathM(e,r);break;case w.LINE_TO:this.pathL(e,r);break;case w.HORIZ_LINE_TO:this.pathH(e,r);break;case w.VERT_LINE_TO:this.pathV(e,r);break;case w.CURVE_TO:this.pathC(e,r);break;case w.SMOOTH_CURVE_TO:this.pathS(e,r);break;case w.QUAD_TO:this.pathQ(e,r);break;case w.SMOOTH_QUAD_TO:this.pathT(e,r);break;case w.ARC:this.pathA(e,r);break;case w.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles(),i=t.map((n,o)=>[n,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var u=n.getDefinition(),[l,h]=r[0];u.render(e,l,h)}if(o.isUrlDefinition())for(var f=o.getDefinition(),c=1;c1&&(i*=Math.sqrt(c),n*=Math.sqrt(c));var v=(s===u?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(i,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2)));isNaN(v)&&(v=0);var g=new k(v*i*f.y/n,v*-n*f.x/i),d=new k((t.x+h.x)/2+Math.cos(l)*g.x-Math.sin(l)*g.y,(t.y+h.y)/2+Math.sin(l)*g.x+Math.cos(l)*g.y),p=Eo([1,0],[(f.x-g.x)/i,(f.y-g.y)/n]),y=[(f.x-g.x)/i,(f.y-g.y)/n],T=[(-f.x-g.x)/i,(-f.y-g.y)/n],b=Eo(y,T);return Ti(y,T)<=-1&&(b=Math.PI),Ti(y,T)>=1&&(b=0),{currentPoint:h,rX:i,rY:n,sweepFlag:u,xAxisRotation:l,centp:d,a1:p,ad:b}}pathA(e,t){var{pathParser:r}=this,{currentPoint:i,rX:n,rY:o,sweepFlag:s,xAxisRotation:u,centp:l,a1:h,ad:f}=A.pathA(r),c=1-s?1:-1,v=h+c*(f/2),g=new k(l.x+n*Math.cos(v),l.y+o*Math.sin(v));if(r.addMarkerAngle(g,v-c*Math.PI/2),r.addMarkerAngle(i,v-c*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(h)&&!isNaN(f)){var d=n>o?n:o,p=n>o?1:n/o,y=n>o?o/n:1;e.translate(l.x,l.y),e.rotate(u),e.scale(p,y),e.arc(0,0,d,h,h+f,!!(1-s)),e.scale(1/p,1/y),e.rotate(-u),e.translate(-l.x,-l.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){A.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class Ol extends A{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Ce extends Ge{constructor(e,t,r){super(e,t,new.target===Ce?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((r,i)=>{var n=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(n):t=n}),t}getFontSize(){var{document:e,parent:t}=this,r=Z.parse(e.ctx.font).fontSize,i=t.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var t=this.getFontSize();return new ce(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],n=null;if(e.isArabic){var o=t.length,s=t[r-1],u=t[r+1],l="isolated";if((r===0||s===" ")&&r0&&s!==" "&&r0&&s!==" "&&(r===o-1||u===" ")&&(l="initial"),typeof e.glyphs[i]<"u"){var h=e.glyphs[i];n=h instanceof Ol?h:h[l]}}else n=e.glyphs[i];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),n=r.length-1,o=ht(t.textContent||"");return i===0&&(o=u1(o)),i===n&&(o=l1(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n){for(var{unitsPerEm:o}=n.fontFace,s=Z.parse(t.ctx.font),u=r.getStyle("font-size").getNumber(s.fontSize),l=r.getStyle("font-style").getString(s.fontStyle),h=u/o,f=n.isRTL?i.split("").reverse().join(""):i,c=ne(r.getAttribute("dx").getString()),v=f.length,g=0;g=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=!1,i=0;t==="start"&&!r||t==="end"&&r?i=e.x-this.minX:t==="end"&&!r||t==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var n=r.children[i];n.children.length>0?n.children.forEach((o,s)=>{t.adjustChildCoordinatesRecursiveCore(e,t,n,s)}):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var n=r.children[i];if(typeof n.measureText!="function")return n;e.save(),n.setContext(e,!0);var o=n.getAttribute("x"),s=n.getAttribute("y"),u=n.getAttribute("dx"),l=n.getAttribute("dy"),h=n.getStyle("font-family").getDefinition(),f=!!h&&h.isRTL;i===0&&(o.hasValue()||o.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),u.hasValue()||u.setValue(n.getInheritedAttribute("dx")),l.hasValue()||l.setValue(n.getInheritedAttribute("dy")));var c=n.measureText(e);return f&&(t.x-=c),o.hasValue()?(t.applyAnchoring(),n.x=o.getPixels("x"),u.hasValue()&&(n.x+=u.getPixels("x"))):(u.hasValue()&&(t.x+=u.getPixels("x")),n.x=t.x),t.x=n.x,f||(t.x+=c),s.hasValue()?(n.y=s.getPixels("y"),l.hasValue()&&(n.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),n.y=t.y),t.y=n.y,t.leafTexts.push(n),t.minX=Math.min(t.minX,n.x,n.x+c),t.maxX=Math.max(t.maxX,n.x,n.x+c),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,t,r,i){var n=r.children[i];if(typeof n.getBoundingBox!="function")return null;var o=n.getBoundingBox(e);return o?(n.children.forEach((s,u)=>{var l=t.getChildBoundingBox(e,t,n,u);o.addBoundingBox(l)}),o):null}renderChild(e,t,r,i){var n=r.children[i];n.render(e),n.children.forEach((o,s)=>{t.renderChild(e,t,n,s)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,s=ne(r.getAttribute("dx").getString()),u=o.length,l=0,h=0;h0?"":this.getTextFromNode()}getText(){return this.text}}class L1 extends Br{constructor(){super(...arguments),this.type="textNode"}}class It extends Ge{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:n}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&n&&typeof n.getComputedStyle<"u"){e.font=n.getComputedStyle(o).getPropertyValue("font");var s=new S(r,"fontSize",Z.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:u,height:l}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var h=this.getAttribute("refX"),f=this.getAttribute("refY"),c=this.getAttribute("viewBox"),v=c.hasValue()?ne(c.getString()):null,g=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",d=0,p=0,y=0,T=0;v&&(d=v[0],p=v[1]),this.root||(u=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=d,T=p,d=0,p=0)),i.viewPort.setCurrent(u,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),v&&(u=v[2],l=v[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:u,height:i.viewPort.height,desiredHeight:l,minX:d,minY:p,refX:h.getValue(),refY:f.getValue(),clip:g,clipX:y,clipY:T}),v&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(u,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),u=i.getNumber(0),l=n.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),n.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(u||e," ").concat(l||t)),s.hasValue()){var f=this.getStyle("width"),c=this.getStyle("height");f.hasValue()&&f.setValue("".concat(e,"px")),c.hasValue()&&c.setValue("".concat(t,"px"))}}}class Sl extends A{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),u=o.getPixels("x"),l=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(l=u),s.hasValue()&&!o.hasValue()&&(u=l),u=Math.min(u,i/2),l=Math.min(l,n/2),e){var h=4*((Math.sqrt(2)-1)/3);e.beginPath(),n>0&&i>0&&(e.moveTo(t+u,r),e.lineTo(t+i-u,r),e.bezierCurveTo(t+i-u+h*u,r,t+i,r+l-h*l,t+i,r+l),e.lineTo(t+i,r+n-l),e.bezierCurveTo(t+i,r+n-l+h*l,t+i-u+h*u,r+n,t+i-u,r+n),e.lineTo(t+u,r+n),e.bezierCurveTo(t+u-h*u,r+n,t,r+n-l+h*l,t,r+n-l),e.lineTo(t,r+l),e.bezierCurveTo(t,r+l-h*l,t+u-h*u,r,t+u,r),e.closePath())}return new ce(t,r,t+i,r+n)}getMarkers(){return null}}class k1 extends A{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,Math.PI*2,!1),e.closePath()),new ce(t-i,r-i,t+i,r+i)}getMarkers(){return null}}class B1 extends A{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(n+r,o),e.bezierCurveTo(n+r,o+t*i,n+t*r,o+i,n,o+i),e.bezierCurveTo(n-t*r,o+i,n-r,o+t*i,n-r,o),e.bezierCurveTo(n-r,o-t*i,n-t*r,o-i,n,o-i),e.bezierCurveTo(n+t*r,o-i,n+r,o-t*i,n+r,o),e.closePath()),new ce(n-r,o-i,n+r,o+i)}getMarkers(){return null}}class j1 extends A{constructor(){super(...arguments),this.type="line"}getPoints(){return[new k(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new k(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,n)),new ce(t,r,i,n)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}}class El extends A{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=k.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,n=new ce(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach(o=>{var{x:s,y:u}=o;n.addPoint(s,u),e&&e.lineTo(s,u)}),n}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach((i,n)=>{n!==t&&r.push([i,i.angleTo(e[n+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class F1 extends El{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}}class U1 extends I{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),o=new It(this.document,null);o.attributes.viewBox=new S(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new S(this.document,"width","".concat(i,"px")),o.attributes.height=new S(this.document,"height","".concat(n,"px")),o.attributes.transform=new S(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,n),u=s.getContext("2d"),l=this.getAttribute("x"),h=this.getAttribute("y");l.hasValue()&&h.hasValue()&&u.translate(l.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var f=-1;f<=1;f++)for(var c=-1;c<=1;c++)u.save(),o.attributes.x=new S(this.document,"x",f*s.width),o.attributes.y=new S(this.document,"y",c*s.height),o.render(u),u.restore();var v=e.createPattern(s,"repeat");return v}}class G1 extends I{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(t){var{x:i,y:n}=t,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,n),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var u=new It(this.document,null);u.type=this.type,u.attributes.viewBox=new S(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.refX=new S(this.document,"refX",this.getAttribute("refX").getValue()),u.attributes.refY=new S(this.document,"refY",this.getAttribute("refY").getValue()),u.attributes.width=new S(this.document,"width",this.getAttribute("markerWidth").getValue()),u.attributes.height=new S(this.document,"height",this.getAttribute("markerHeight").getValue()),u.attributes.overflow=new S(this.document,"overflow",this.getAttribute("overflow").getValue()),u.attributes.fill=new S(this.document,"fill",this.getAttribute("fill").getColor("black")),u.attributes.stroke=new S(this.document,"stroke",this.getAttribute("stroke").getValue("none")),u.children=this.children,u.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-n)}}}class z1 extends I{constructor(){super(...arguments),this.type="defs"}render(){}}class sn extends Ge{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new ce;return this.children.forEach(r=>{t.addBoundingBox(r.getBoundingBox(e))}),t}}class $l extends I{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:n}=this;n.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:n}=i,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(r,n[n.length-1].color);if(n.forEach(p=>{o.addColorStop(p.offset,this.addParentOpacity(r,p.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:u,viewPort:l}=s.screen,[h]=l.viewPorts,f=new Sl(s,null);f.attributes.x=new S(s,"x",-u/3),f.attributes.y=new S(s,"y",-u/3),f.attributes.width=new S(s,"width",u),f.attributes.height=new S(s,"height",u);var c=new sn(s,null);c.attributes.transform=new S(s,"transform",this.getAttribute("gradientTransform").getValue()),c.children=[f];var v=new It(s,null);v.attributes.x=new S(s,"x",0),v.attributes.y=new S(s,"y",0),v.attributes.width=new S(s,"width",h.width),v.attributes.height=new S(s,"height",h.height),v.children=[c];var g=s.createCanvas(h.width,h.height),d=g.getContext("2d");return d.fillStyle=o,v.render(d),d.createPattern(g,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var r=new S(this.document,"color",t);return r.addOpacity(e).getColor()}return t}}class H1 extends $l{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),u=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&o===u?null:e.createLinearGradient(n,o,s,u)}}class Y1 extends $l{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,u=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(u=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var l=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,u,h,n,o,l)}}class X1 extends I{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),n.hasValue()&&(o=o.addOpacity(n)),this.offset=i,this.color=o.getColor()}}class on extends I{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new S(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),n=r.getNumber()+(i.getNumber()-r.getNumber())*t;return e==="%"&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var n=!1;if(this.begin{var l=n[u];return s+(l-s)*e}).join(" ");return o}}class Q1 extends I{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:n}=this;for(var o of n)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var u=o;u.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[u.unicode]>"u"&&(this.glyphs[u.unicode]=Object.create(null)),this.glyphs[u.unicode][u.arabicForm]=u):this.glyphs[u.unicode]=u;break}}}render(){}}class K1 extends I{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class Z1 extends A{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class J1 extends Ce{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class e2 extends Ce{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,n=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:n}=t.screen,o=new S(t,"fontSize",Z.parse(t.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new ce(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new sn(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function Io(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function nr(a){for(var e=1;e{var{type:i,points:n}=r;switch(i){case w.LINE_TO:e&&e.lineTo(n[0],n[1]);break;case w.MOVE_TO:e&&e.moveTo(n[0],n[1]);break;case w.CURVE_TO:e&&e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);break;case w.QUAD_TO:e&&e.quadraticCurveTo(n[0],n[1],n[2],n[3]);break;case w.ARC:{var[o,s,u,l,h,f,c,v]=n,g=u>l?u:l,d=u>l?1:u/l,p=u>l?l/u:1;e&&(e.translate(o,s),e.rotate(c),e.scale(d,p),e.arc(0,0,g,h,h+f,!!(1-v)),e.scale(1/d,1/p),e.rotate(-c),e.translate(-o,-s));break}case w.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,n=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:u,p1:l,rotation:h,text:f}=o;e.save(),e.translate(u.x,u.y),e.rotate(h),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(s===0&&e.moveTo(u.x,u.y+r/8),e.lineTo(l.x,l.y+r/5))}),t==="underline"&&(e.lineWidth=r/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,n,o,s,u,l){var h=o,f=this.measureText(e,u);u===" "&&t==="justify"&&r-1&&(h+=this.getLetterSpacingAt(l));var c=this.textHeight/20,v=this.getEquidistantPointOnPath(h,c,0),g=this.getEquidistantPointOnPath(h+f,c,0),d={p0:v,p1:g},p=v&&g?Math.atan2(g.y-v.y,g.x-v.x):0;if(s){var y=Math.cos(Math.PI/2+p)*s,T=Math.cos(-p)*s;d.p0=nr(nr({},v),{},{x:v.x+y,y:v.y+T}),d.p1=nr(nr({},g),{},{x:g.x+y,y:g.y+T})}return h+=f,{offset:h,segment:d,rotation:p}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(e,i);return r.set(i,n),n}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(x=>x.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),h=0;!u.hasValue()||u.getValue()==="inherit"?h=l.getPixels():u.hasValue()&&u.getValue()!=="initial"&&u.getValue()!=="unset"&&(h=u.getPixels());var f=[],c=t.length;this.letterSpacingCache=f;for(var v=0;vE===0?0:x+$||0,0),d=this.measureText(e),p=Math.max(d+g,0);this.textWidth=d,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),T=this.getStyle("startOffset").getNumber(0)*y,b=0;(s==="middle"||s==="center")&&(b=-p/2),(s==="end"||s==="right")&&(b=-p),b+=T,r.forEach((x,$)=>{var{offset:E,segment:O,rotation:C}=this.findSegmentToFitChar(e,s,p,y,i,b,o,x,$);b=E,!(!O.p0||!O.p1)&&this.glyphInfo.push({text:r[$],p0:O.p0,p1:O.p1,rotation:C})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,n=i?i.x:0,o=i?i.y:0,s=r.next(),u=s.type,l=[];switch(s.type){case w.MOVE_TO:this.pathM(r,l);break;case w.LINE_TO:u=this.pathL(r,l);break;case w.HORIZ_LINE_TO:u=this.pathH(r,l);break;case w.VERT_LINE_TO:u=this.pathV(r,l);break;case w.CURVE_TO:this.pathC(r,l);break;case w.SMOOTH_CURVE_TO:u=this.pathS(r,l);break;case w.QUAD_TO:this.pathQ(r,l);break;case w.SMOOTH_QUAD_TO:u=this.pathT(r,l);break;case w.ARC:l=this.pathA(r);break;case w.CLOSE_PATH:A.pathZ(r);break}s.type!==w.CLOSE_PATH?t.push({type:u,points:l,start:{x:n,y:o},pathLength:this.calcLength(n,o,u,l)}):t.push({type:w.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=A.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=A.pathL(e).point;return t.push(r,i),w.LINE_TO}pathH(e,t){var{x:r,y:i}=A.pathH(e).point;return t.push(r,i),w.LINE_TO}pathV(e,t){var{x:r,y:i}=A.pathV(e).point;return t.push(r,i),w.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:n}=A.pathC(e);t.push(r.x,r.y,i.x,i.y,n.x,n.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:n}=A.pathS(e);return t.push(r.x,r.y,i.x,i.y,n.x,n.y),w.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=A.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=A.pathT(e);return t.push(r.x,r.y,i.x,i.y),w.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:n,centp:o,a1:s,ad:u}=A.pathA(e);return i===0&&u>0&&(u-=2*Math.PI),i===1&&u<0&&(u+=2*Math.PI),[o.x,o.y,t,r,s,u,n,i]}calcLength(e,t,r,i){var n=0,o=null,s=null,u=0;switch(r){case w.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case w.CURVE_TO:for(n=0,o=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),u=.01;u<=1;u+=.01)s=this.getPointOnCubicBezier(u,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case w.QUAD_TO:for(n=0,o=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),u=.01;u<=1;u+=.01)s=this.getPointOnQuadraticBezier(u,e,t,i[0],i[1],i[2],i[3]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case w.ARC:{n=0;var l=i[4],h=i[5],f=i[4]+h,c=Math.PI/180;if(Math.abs(l-f)f;u-=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=l+c;u5&&arguments[5]!==void 0?arguments[5]:t,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,u=(n-r)/(i-t+at),l=Math.sqrt(e*e/(1+u*u));it)return null;var{dataArray:n}=this;for(var o of n){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5=0&&u>f)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],u,o.points[6]);break}case w.CURVE_TO:u=s/o.pathLength,u>1&&(u=1),i=this.getPointOnCubicBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case w.QUAD_TO:u=s/o.pathLength,u>1&&(u=1),i=this.getPointOnQuadraticBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,n,o,s,u,l){var h=u*$o(e)+o*wo(e)+i*Co(e)+t*Ao(e),f=l*$o(e)+s*wo(e)+n*Co(e)+r*Ao(e);return{x:h,y:f}}getPointOnQuadraticBezier(e,t,r,i,n,o,s){var u=o*Po(e)+i*Ro(e)+t*No(e),l=s*Po(e)+n*Ro(e)+r*No(e);return{x:u,y:l}}getPointOnEllipticalArc(e,t,r,i,n,o){var s=Math.cos(o),u=Math.sin(o),l={x:r*Math.cos(n),y:i*Math.sin(n)};return{x:e+(l.x*s-l.y*u),y:t+(l.x*u+l.y*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,n=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var u=this.getPointOnPath(s),l=this.getPointOnPath(s+i);!u||!l||(o+=this.getLineLength(u.x,u.y,l.x,l.y),o>=n&&(this.equidistantCache.points.push({x:u.x,y:u.y,distance:s}),o-=n))}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var r2=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class a2 extends Ge{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var n=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),n?this.loadSvg(i):this.loadImage(i),this.isSvg=n}}loadImage(e){var t=this;return xe(function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}t.loaded=!0})()}loadSvg(e){var t=this;return xe(function*(){var r=r2.exec(e);if(r){var i=r[5];r[4]==="base64"?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var n=yield t.document.fetch(e),o=yield n.text();t.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}t.loaded=!0})()}renderChildren(e){var{document:t,image:r,loaded:i}=this,n=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!u)){if(e.save(),e.translate(n,o),this.isSvg){var l=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});l.document.documentElement.parent=this,l.render()}else{var h=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:u,desiredHeight:h.height}),this.loaded&&(typeof h.complete>"u"||h.complete)&&e.drawImage(h,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new ce(e,t,e+r,t+i)}}class i2 extends Ge{constructor(){super(...arguments),this.type="symbol"}render(e){}}class n2{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return xe(function*(){try{var{document:i}=r,n=yield i.canvg.parser.load(t),o=n.getElementsByTagName("font");Array.from(o).forEach(s=>{var u=i.createElement(s);i.definitions[e]=u})}catch(s){console.error('Error while loading font "'.concat(t,'":'),s)}r.loaded=!0})()}}class wl extends I{constructor(e,t,r){super(e,t,r),this.type="style";var i=ht(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),n=i.split("}");n.forEach(o=>{var s=o.trim();if(s){var u=s.split("{"),l=u[0].split(","),h=u[1].split(";");l.forEach(f=>{var c=f.trim();if(c){var v=e.styles[c]||{};if(h.forEach(p=>{var y=p.indexOf(":"),T=p.substr(0,y).trim(),b=p.substr(y+1,p.length-y).trim();T&&b&&(v[T]=new S(e,T,b))}),e.styles[c]=v,e.stylesSpecificity[c]=x1(c),c==="@font-face"){var g=v["font-family"].getString().replace(/"|'/g,""),d=v.src.getString().split(",");d.forEach(p=>{if(p.indexOf('format("svg")')>0){var y=yl(p);y&&new n2(e).load(g,y)}})}}})}})}}wl.parseExternalUrl=yl;class s2 extends Ge{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new It(t,null),i.attributes.viewBox=new S(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new S(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new S(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new S(t,"opacity",this.calculateOpacity())),i.type==="svg"){var n=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new S(t,"width",n.getString())),o.hasValue()&&(i.attributes.height=new S(t,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return Be.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function sr(a,e,t,r,i,n){return a[t*r*4+e*4+n]}function or(a,e,t,r,i,n,o){a[t*r*4+e*4+n]=o}function F(a,e,t){var r=a[e];return r*t}function me(a,e,t,r){return e+Math.cos(a)*t+Math.sin(a)*r}class Cl extends I{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=ne(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var n=i[0];i=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[me(o,.213,.787,-.213),me(o,.715,-.715,-.715),me(o,.072,-.072,.928),0,0,me(o,.213,-.213,.143),me(o,.715,.285,.14),me(o,.072,-.072,-.283),0,0,me(o,.213,-.213,-.787),me(o,.715,-.715,.715),me(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,n){for(var{includeOpacity:o,matrix:s}=this,u=e.getImageData(0,0,i,n),l=0;l{u.addBoundingBox(g.getBoundingBox(e))}),i=Math.floor(u.x1),n=Math.floor(u.y1),o=Math.floor(u.width),s=Math.floor(u.height)}var l=this.removeStyles(t,jr.ignoreStyles),h=r.createCanvas(i+o,n+s),f=h.getContext("2d");r.screen.setDefaults(f),this.renderChildren(f),new Cl(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(f,0,0,i+o,n+s);var c=r.createCanvas(i+o,n+s),v=c.getContext("2d");r.screen.setDefaults(v),t.render(v),v.globalCompositeOperation="destination-in",v.fillStyle=f.createPattern(h,"no-repeat"),v.fillRect(0,0,i+o,n+s),e.fillStyle=v.createPattern(c,"no-repeat"),e.fillRect(0,0,i+o,n+s),this.restoreStyles(t,l)}render(e){}}jr.ignoreStyles=["mask","transform","clip-path"];var Mo=()=>{};class o2 extends I{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:n}=e;r&&(r.beginPath=Mo,r.closePath=Mo),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=Be.fromElement(t,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=n),s&&s.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=n)}render(e){}}class Fr extends I{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:r,children:i}=this,n=t.getBoundingBox(e);if(n){var o=0,s=0;i.forEach(y=>{var T=y.extraFilterDistance||0;o=Math.max(o,T),s=Math.max(s,T)});var u=Math.floor(n.width),l=Math.floor(n.height),h=u+2*o,f=l+2*s;if(!(h<1||f<1)){var c=Math.floor(n.x),v=Math.floor(n.y),g=this.removeStyles(t,Fr.ignoreStyles),d=r.createCanvas(h,f),p=d.getContext("2d");r.screen.setDefaults(p),p.translate(-c+o,-v+s),t.render(p),i.forEach(y=>{typeof y.apply=="function"&&y.apply(p,0,0,h,f)}),e.drawImage(d,0,0,h,f,c-o,v-s,h,f),this.restoreStyles(t,g)}}}render(e){}}Fr.ignoreStyles=["filter","transform","clip-path"];class u2 extends I{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,n){}}class l2 extends I{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,n){}}class h2 extends I{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,n){}}class v2 extends I{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,n){var{document:o,blurRadius:s}=this,u=o.window?o.window.document.body:null,l=e.canvas;l.id=o.getUniqueId(),u&&(l.style.display="none",u.appendChild(l)),i1(l,t,r,i,n,s),u&&u.removeChild(l)}}class f2 extends I{constructor(){super(...arguments),this.type="title"}}class c2 extends I{constructor(){super(...arguments),this.type="desc"}}var g2={svg:It,rect:Sl,circle:k1,ellipse:B1,line:j1,polyline:El,polygon:F1,path:A,pattern:U1,marker:G1,defs:z1,linearGradient:H1,radialGradient:Y1,stop:X1,animate:on,animateColor:W1,animateTransform:q1,font:Q1,"font-face":K1,"missing-glyph":Z1,glyph:Ol,text:Ce,tspan:Br,tref:J1,a:e2,textPath:t2,image:a2,g:sn,symbol:i2,style:wl,use:s2,mask:jr,clipPath:o2,filter:Fr,feDropShadow:u2,feMorphology:l2,feComposite:h2,feColorMatrix:Cl,feGaussianBlur:v2,title:f2,desc:c2};function _o(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function d2(a){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((r,i)=>{t.onload=()=>{r(t)},t.onerror=(n,o,s,u,l)=>{i(l)},t.src=a})}),Oi.apply(this,arguments)}class $e{constructor(e){var{rootEmSize:t=12,emSize:r=12,createCanvas:i=$e.createCanvas,createImage:n=$e.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(n,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),r=$e.elementTypes[t];return typeof r<"u"?new r(this,e):new I1(this,e)}createTextNode(e){return new L1(this,e)}setViewBox(e){this.screen.setViewBox(d2({document:this},e))}}$e.createCanvas=p2;$e.createImage=y2;$e.elementTypes=g2;function Vo(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function De(a){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Ya(r),this.screen=new kr(e,r),this.options=r;var i=new $e(this,r),n=i.createDocumentElement(t);this.document=i,this.documentElement=n}static from(e,t){var r=arguments;return xe(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},n=new Ya(i),o=yield n.parse(t);return new bt(e,o,i)})()}static fromString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new Ya(r),n=i.parseFromString(t);return new bt(e,n,r)}fork(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bt.from(e,t,De(De({},this.options),r))}forkString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bt.fromString(e,t,De(De({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return xe(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};t.start(De({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,De(De({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,r)}}export{e2 as AElement,W1 as AnimateColorElement,on as AnimateElement,q1 as AnimateTransformElement,ce as BoundingBox,$o as CB1,wo as CB2,Co as CB3,Ao as CB4,bt as Canvg,k1 as CircleElement,o2 as ClipPathElement,z1 as DefsElement,c2 as DescElement,$e as Document,I as Element,B1 as EllipseElement,Cl as FeColorMatrixElement,h2 as FeCompositeElement,u2 as FeDropShadowElement,v2 as FeGaussianBlurElement,l2 as FeMorphologyElement,Fr as FilterElement,Z as Font,Q1 as FontElement,K1 as FontFaceElement,sn as GElement,Ol as GlyphElement,$l as GradientElement,a2 as ImageElement,j1 as LineElement,H1 as LinearGradientElement,G1 as MarkerElement,jr as MaskElement,xl as Matrix,Z1 as MissingGlyphElement,O1 as Mouse,at as PSEUDO_ZERO,Ya as Parser,A as PathElement,w as PathParser,U1 as PatternElement,k as Point,F1 as PolygonElement,El as PolylineElement,S as Property,Po as QB1,Ro as QB2,No as QB3,Y1 as RadialGradientElement,Sl as RectElement,Ge as RenderedElement,w1 as Rotate,It as SVGElement,n2 as SVGFontLoader,C1 as Scale,kr as Screen,Tl as Skew,A1 as SkewX,P1 as SkewY,X1 as StopElement,wl as StyleElement,i2 as SymbolElement,J1 as TRefElement,Br as TSpanElement,Ce as TextElement,t2 as TextPathElement,f2 as TitleElement,Be as Transform,$1 as Translate,I1 as UnknownElement,s2 as UseElement,T1 as ViewPort,ht as compressSpaces,bt as default,x1 as getSelectorSpecificity,v1 as normalizeAttributeName,f1 as normalizeColor,yl as parseExternalUrl,x2 as presets,ne as toNumbers,u1 as trimLeft,l1 as trimRight,So as vectorMagnitude,Eo as vectorsAngle,Ti as vectorsRatio}; diff --git a/dist/assets/jspdf.es.min-CLjTnO_I.js b/dist/assets/jspdf.es.min-CLjTnO_I.js deleted file mode 100644 index 5ad77a9..0000000 --- a/dist/assets/jspdf.es.min-CLjTnO_I.js +++ /dev/null @@ -1,170 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-DQ6YK4So.js","assets/index-Cg2UxsRL.js","assets/index-BaBfIFek.css"])))=>i.map(i=>d[i]); -var Ah=Object.defineProperty;var Nh=(n,e,t)=>e in n?Ah(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xe=(n,e,t)=>Nh(n,typeof e!="symbol"?e+"":e,t);import{_ as vo}from"./index-Cg2UxsRL.js";function _e(n){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(n)}var tr=Uint8Array,Rn=Uint16Array,Xo=Int32Array,$o=new tr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Zo=new tr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ml=new tr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ju=function(n,e){for(var t=new Rn(31),i=0;i<31;++i)t[i]=e+=1<>1|(Oe&21845)<<1;Kr=(Kr&52428)>>2|(Kr&13107)<<2,Kr=(Kr&61680)>>4|(Kr&3855)<<4,qo[Oe]=((Kr&65280)>>8|(Kr&255)<<8)>>1}var Ca=function(n,e,t){for(var i=n.length,s=0,a=new Rn(e);s>h]=d}else for(l=new Rn(i),s=0;s>15-n[s]);return l},Si=new tr(288);for(var Oe=0;Oe<144;++Oe)Si[Oe]=8;for(var Oe=144;Oe<256;++Oe)Si[Oe]=9;for(var Oe=256;Oe<280;++Oe)Si[Oe]=7;for(var Oe=280;Oe<288;++Oe)Si[Oe]=8;var Cs=new tr(32);for(var Oe=0;Oe<32;++Oe)Cs[Oe]=5;var kh=Ca(Si,9,0),Ph=Ca(Cs,5,0),Xu=function(n){return(n+7)/8|0},Ih=function(n,e,t){return(t==null||t>n.length)&&(t=n.length),new tr(n.subarray(e,t))},Fr=function(n,e,t){t<<=e&7;var i=e/8|0;n[i]|=t,n[i+1]|=t>>8},Pa=function(n,e,t){t<<=e&7;var i=e/8|0;n[i]|=t,n[i+1]|=t>>8,n[i+2]|=t>>16},bo=function(n,e){for(var t=[],i=0;ik&&(k=a[i].s);var p=new Rn(k+1),j=Uo(t[m-1],p,0);if(j>e){var i=0,O=0,M=j-e,S=1<e)O+=S-(1<>=M;O>0;){var G=a[i].s;p[G]=0&&O;--i){var q=a[i].s;p[q]==e&&(--p[q],++O)}j=e}return{t:new tr(p),l:j}},Uo=function(n,e,t){return n.s==-1?Math.max(Uo(n.l,e,t+1),Uo(n.r,e,t+1)):e[n.s]=t},Tl=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Rn(++e),i=0,s=n[0],a=1,c=function(h){t[i++]=h},l=1;l<=e;++l)if(n[l]==s&&l!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=n[l]}return{c:t.subarray(0,i),n:e}},Ia=function(n,e){for(var t=0,i=0;i>8,n[s+2]=n[s]^255,n[s+3]=n[s+1]^255;for(var a=0;a4&&!tt[Ml[E-1]];--E);var z=d+5<<3,U=Ia(s,Si)+Ia(a,Cs)+c,rt=Ia(s,k)+Ia(a,O)+c+14+3*E+Ia(dt,tt)+2*dt[16]+3*dt[17]+7*dt[18];if(h>=0&&z<=U&&z<=rt)return $u(e,m,n.subarray(h,h+d));var ot,ft,nt,ct;if(Fr(e,m,1+(rt15&&(Fr(e,m,B[X]>>5&127),m+=B[X]>>12)}}else ot=kh,ft=Si,nt=Ph,ct=Cs;for(var X=0;X255){var T=H>>18&31;Pa(e,m,ot[T+257]),m+=ft[T+257],T>7&&(Fr(e,m,H>>23&31),m+=$o[T]);var J=H&31;Pa(e,m,nt[J]),m+=ct[J],J>3&&(Pa(e,m,H>>5&8191),m+=Zo[J])}else Pa(e,m,ot[H]),m+=ft[H]}return Pa(e,m,ot[256]),m+ft[256]},Ch=new Xo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zu=new tr(0),Fh=function(n,e,t,i,s,a){var c=a.z||n.length,l=new tr(i+c+5*(1+Math.ceil(c/7e3))+s),h=l.subarray(i,l.length-s),d=a.l,m=(a.r||0)&7;if(e){m&&(h[0]=a.r>>3);for(var _=Ch[e-1],k=_>>13,p=_&8191,j=(1<7e3||tt>24576)&&(ot>423||!d)){m=Dl(n,h,0,q,it,vt,X,tt,E,R-E,m),tt=dt=X=0,E=R;for(var ft=0;ft<286;++ft)it[ft]=0;for(var ft=0;ft<30;++ft)vt[ft]=0}var nt=2,ct=0,At=p,wt=U-rt&32767;if(ot>2&&z==G(R-wt))for(var x=Math.min(k,ot)-1,B=Math.min(32767,R),T=Math.min(258,ot);wt<=B&&--At&&U!=rt;){if(n[R+nt]==n[R+nt-wt]){for(var H=0;Hnt){if(nt=H,ct=wt,H>x)break;for(var J=Math.min(wt,H-2),Z=0,ft=0;ftZ&&(Z=gt,rt=at)}}}U=rt,rt=O[U],wt+=U-rt&32767}if(ct){q[tt++]=268435456|Do[nt]<<18|Rl[ct];var _t=Do[nt]&31,kt=Rl[ct]&31;X+=$o[_t]+Zo[kt],++it[257+_t],++vt[kt],N=R+nt,++dt}else q[tt++]=n[R],++it[n[R]]}}for(R=Math.max(R,N);R=c&&(h[m/8|0]=d,St=c),m=$u(h,m+1,n.subarray(R,St))}a.i=c}return Ih(l,0,i+Xu(m)+s)},Qu=function(){var n=1,e=0;return{p:function(t){for(var i=n,s=e,a=t.length|0,c=0;c!=a;){for(var l=Math.min(c+2655,a);c>16),s=(s&65535)+15*(s>>16)}n=i,e=s},d:function(){return n%=65521,e%=65521,(n&255)<<24|(n&65280)<<8|(e&255)<<8|e>>8}}},Eh=function(n,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new tr(a.length+n.length);c.set(a),c.set(n,a.length),n=c,s.w=a.length}return Fh(n,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+e.mem,t,i,s)},tf=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},Oh=function(n,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;if(n[0]=120,n[1]=i<<6|(e.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,e.dictionary){var s=Qu();s.p(e.dictionary),tf(n,2,s.d())}};function zo(n,e){e||(e={});var t=Qu();t.p(n);var i=Eh(n,e,e.dictionary?6:2,4);return Oh(i,e),tf(i,i.length-4,t.d()),i}var jh=typeof TextDecoder<"u"&&new TextDecoder,Bh=0;try{jh.decode(Zu,{stream:!0}),Bh=1}catch{}function Mh(n){if(Array.isArray(n))return n}function Rh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,s,a,c,l=[],h=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(h=(i=a.call(t)).done)&&(l.push(i.value),l.length!==e);h=!0);}catch(m){d=!0,s=m}finally{try{if(!h&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(d)throw s}}return l}}function ql(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t{const n=new Uint8Array(4),e=new Uint32Array(n.buffer);return!((e[0]=1)&n[0])})(),wo={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Qo{constructor(e=zh,t={}){xe(this,"buffer");xe(this,"byteLength");xe(this,"byteOffset");xe(this,"length");xe(this,"offset");xe(this,"lastWrittenByte");xe(this,"littleEndian");xe(this,"_data");xe(this,"_mark");xe(this,"_marks");let i=!1;typeof e=="number"?e=new ArrayBuffer(e):(i=!0,this.lastWrittenByte=e.byteLength);const s=t.offset?t.offset>>>0:0,a=e.byteLength-s;let c=s;(ArrayBuffer.isView(e)||e instanceof Qo)&&(e.byteLength!==e.buffer.byteLength&&(c=e.byteOffset+s),e=e.buffer),i?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=c,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,c,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const i=(this.offset+e)*2,s=new Uint8Array(i);s.set(new Uint8Array(this.buffer)),this.buffer=s.buffer,this.length=i,this.byteLength=i,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const i=wo[t].BYTES_PER_ELEMENT*e,s=this.byteOffset+this.offset,a=this.buffer.slice(s,s+i);if(this.littleEndian===Hh&&t!=="uint8"&&t!=="int8"){const l=new Uint8Array(this.buffer.slice(s,s+i));l.reverse();const h=new wo[t](l.buffer);return this.offset+=i,h.reverse(),h}const c=new wo[t](a);return this.offset+=i,c}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let i=0;ithis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function ia(n){let e=n.length;for(;--e>=0;)n[e]=0}const Wh=3,Vh=258,ef=29,Gh=256,Yh=Gh+1+ef,nf=30,Jh=512,Kh=new Array((Yh+2)*2);ia(Kh);const Xh=new Array(nf*2);ia(Xh);const $h=new Array(Jh);ia($h);const Zh=new Array(Vh-Wh+1);ia(Zh);const Qh=new Array(ef);ia(Qh);const tc=new Array(nf);ia(tc);const ec=(n,e,t,i)=>{let s=n&65535|0,a=n>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do s=s+e[i++]|0,a=a+s|0;while(--c);s%=65521,a%=65521}return s|a<<16|0};var Ho=ec;const nc=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},rc=new Uint32Array(nc()),ic=(n,e,t,i)=>{const s=rc,a=i+t;n^=-1;for(let c=i;c>>8^s[(n^e[c])&255];return n^-1};var dr=ic,Wo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},rf={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const ac=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var sc=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)ac(t,i)&&(n[i]=t[i])}}return n},oc=n=>{let e=0;for(let i=0,s=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Ma[254]=Ma[254]=1;var lc=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,i,s,a,c=n.length,l=0;for(s=0;s>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e};const uc=(n,e)=>{if(e<65534&&n.subarray&&sf)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let i=0;i{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let i,s;const a=new Array(t*2);for(s=0,i=0;i4){a[s++]=65533,i+=l-1;continue}for(c&=l===2?31:l===3?15:7;l>1&&i1){a[s++]=65533;continue}c<65536?a[s++]=c:(c-=65536,a[s++]=55296|c>>10&1023,a[s++]=56320|c&1023)}return uc(a,s)},hc=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Ma[n[t]]>e?t:e},Vo={string2buf:lc,buf2string:fc,utf8border:hc};function cc(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var dc=cc;const ys=16209,pc=16191;var gc=function(e,t){let i,s,a,c,l,h,d,m,_,k,p,j,O,M,S,V,G,q,it,vt,dt,X,R,tt;const N=e.state;i=e.next_in,R=e.input,s=i+(e.avail_in-5),a=e.next_out,tt=e.output,c=a-(t-e.avail_out),l=a+(e.avail_out-257),h=N.dmax,d=N.wsize,m=N.whave,_=N.wnext,k=N.window,p=N.hold,j=N.bits,O=N.lencode,M=N.distcode,S=(1<>>24,p>>>=q,j-=q,q=G>>>16&255,q===0)tt[a++]=G&65535;else if(q&16){it=G&65535,q&=15,q&&(j>>=q,j-=q),j<15&&(p+=R[i++]<>>24,p>>>=q,j-=q,q=G>>>16&255,q&16){if(vt=G&65535,q&=15,jh){e.msg="invalid distance too far back",N.mode=ys;break t}if(p>>>=q,j-=q,q=a-c,vt>q){if(q=vt-q,q>m&&N.sane){e.msg="invalid distance too far back",N.mode=ys;break t}if(dt=0,X=k,_===0){if(dt+=d-q,q2;)tt[a++]=X[dt++],tt[a++]=X[dt++],tt[a++]=X[dt++],it-=3;it&&(tt[a++]=X[dt++],it>1&&(tt[a++]=X[dt++]))}else{dt=a-vt;do tt[a++]=tt[dt++],tt[a++]=tt[dt++],tt[a++]=tt[dt++],it-=3;while(it>2);it&&(tt[a++]=tt[dt++],it>1&&(tt[a++]=tt[dt++]))}}else if(q&64){e.msg="invalid distance code",N.mode=ys;break t}else{G=M[(G&65535)+(p&(1<>3,i-=it,j-=it<<3,p&=(1<{const h=l.bits;let d=0,m=0,_=0,k=0,p=0,j=0,O=0,M=0,S=0,V=0,G,q,it,vt,dt,X=null,R;const tt=new Uint16Array(Qi+1),N=new Uint16Array(Qi+1);let E=null,z,U,rt;for(d=0;d<=Qi;d++)tt[d]=0;for(m=0;m=1&&tt[k]===0;k--);if(p>k&&(p=k),k===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(_=1;_0&&(n===Vl||k!==1))return-1;for(N[1]=0,d=1;dHl||n===Gl&&S>Wl)return 1;for(;;){z=d-O,c[m]+1=R?(U=E[c[m]-R],rt=X[c[m]-R]):(U=96,rt=0),G=1<>O)+q]=z<<24|U<<16|rt|0;while(q!==0);for(G=1<>=1;if(G!==0?(V&=G-1,V+=G):V=0,m++,--tt[d]===0){if(d===k)break;d=e[t+c[m]]}if(d>p&&(V&vt)!==it){for(O===0&&(O=p),dt+=_,j=d-O,M=1<Hl||n===Gl&&S>Wl)return 1;it=V&vt,s[it]=p<<24|j<<16|dt-a|0}}return V!==0&&(s[dt+V]=d-O<<24|64<<16|0),l.bits=p,0};var Fa=yc;const xc=0,of=1,lf=2,{Z_FINISH:Yl,Z_BLOCK:_c,Z_TREES:xs,Z_OK:ki,Z_STREAM_END:Ac,Z_NEED_DICT:Nc,Z_STREAM_ERROR:Vn,Z_DATA_ERROR:uf,Z_MEM_ERROR:ff,Z_BUF_ERROR:Lc,Z_DEFLATED:Jl}=rf,Os=16180,Kl=16181,Xl=16182,$l=16183,Zl=16184,Ql=16185,tu=16186,eu=16187,nu=16188,ru=16189,Fs=16190,Er=16191,xo=16192,iu=16193,_o=16194,au=16195,su=16196,ou=16197,lu=16198,_s=16199,As=16200,uu=16201,fu=16202,hu=16203,cu=16204,du=16205,Ao=16206,pu=16207,gu=16208,Me=16209,hf=16210,cf=16211,Sc=852,kc=592,Pc=15,Ic=Pc,mu=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Cc(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ii=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.modecf?1:0},df=n=>{if(Ii(n))return Vn;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Os,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Sc),e.distcode=e.distdyn=new Int32Array(kc),e.sane=1,e.back=-1,ki},pf=n=>{if(Ii(n))return Vn;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,df(n)},gf=(n,e)=>{let t;if(Ii(n))return Vn;const i=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Vn:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,pf(n))},mf=(n,e)=>{if(!n)return Vn;const t=new Cc;n.state=t,t.strm=n,t.window=null,t.mode=Os;const i=gf(n,e);return i!==ki&&(n.state=null),i},Fc=n=>mf(n,Ic);let vu=!0,No,Lo;const Ec=n=>{if(vu){No=new Int32Array(512),Lo=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Fa(of,n.lens,0,288,No,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Fa(lf,n.lens,0,32,Lo,0,n.work,{bits:5}),vu=!1}n.lencode=No,n.lenbits=9,n.distcode=Lo,n.distbits=5},vf=(n,e,t,i)=>{let s;const a=n.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(e.subarray(t-i,t-i+s),a.wnext),i-=s,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,s,a,c,l,h,d,m,_,k,p,j,O,M=0,S,V,G,q,it,vt,dt,X;const R=new Uint8Array(4);let tt,N;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ii(n)||!n.output||!n.input&&n.avail_in!==0)return Vn;t=n.state,t.mode===Er&&(t.mode=xo),c=n.next_out,s=n.output,h=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,d=t.hold,m=t.bits,_=l,k=h,X=ki;t:for(;;)switch(t.mode){case Os:if(t.wrap===0){t.mode=xo;break}for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=dr(t.check,R,2,0),d=0,m=0,t.mode=Kl;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){n.msg="incorrect header check",t.mode=Me;break}if((d&15)!==Jl){n.msg="unknown compression method",t.mode=Me;break}if(d>>>=4,m-=4,dt=(d&15)+8,t.wbits===0&&(t.wbits=dt),dt>15||dt>t.wbits){n.msg="invalid window size",t.mode=Me;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=dr(t.check,R,2,0)),d=0,m=0,t.mode=Xl;case Xl:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>8&255,R[2]=d>>>16&255,R[3]=d>>>24&255,t.check=dr(t.check,R,4,0)),d=0,m=0,t.mode=$l;case $l:for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>8),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=dr(t.check,R,2,0)),d=0,m=0,t.mode=Zl;case Zl:if(t.flags&1024){for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=dr(t.check,R,2,0)),d=0,m=0}else t.head&&(t.head.extra=null);t.mode=Ql;case Ql:if(t.flags&1024&&(p=t.length,p>l&&(p=l),p&&(t.head&&(dt=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+p),dt)),t.flags&512&&t.wrap&4&&(t.check=dr(t.check,i,p,a)),l-=p,a+=p,t.length-=p),t.length))break t;t.length=0,t.mode=tu;case tu:if(t.flags&2048){if(l===0)break t;p=0;do dt=i[a+p++],t.head&&dt&&t.length<65536&&(t.head.name+=String.fromCharCode(dt));while(dt&&p>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=Er;break;case ru:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>=m&7,m-=m&7,t.mode=Ao;break}for(;m<3;){if(l===0)break t;l--,d+=i[a++]<>>=1,m-=1,d&3){case 0:t.mode=iu;break;case 1:if(Ec(t),t.mode=_s,e===xs){d>>>=2,m-=2;break t}break;case 2:t.mode=su;break;case 3:n.msg="invalid block type",t.mode=Me}d>>>=2,m-=2;break;case iu:for(d>>>=m&7,m-=m&7;m<32;){if(l===0)break t;l--,d+=i[a++]<>>16^65535)){n.msg="invalid stored block lengths",t.mode=Me;break}if(t.length=d&65535,d=0,m=0,t.mode=_o,e===xs)break t;case _o:t.mode=au;case au:if(p=t.length,p){if(p>l&&(p=l),p>h&&(p=h),p===0)break t;s.set(i.subarray(a,a+p),c),l-=p,a+=p,h-=p,c+=p,t.length-=p;break}t.mode=Er;break;case su:for(;m<14;){if(l===0)break t;l--,d+=i[a++]<>>=5,m-=5,t.ndist=(d&31)+1,d>>>=5,m-=5,t.ncode=(d&15)+4,d>>>=4,m-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Me;break}t.have=0,t.mode=ou;case ou:for(;t.have>>=3,m-=3}for(;t.have<19;)t.lens[E[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,tt={bits:t.lenbits},X=Fa(xc,t.lens,0,19,t.lencode,0,t.work,tt),t.lenbits=tt.bits,X){n.msg="invalid code lengths set",t.mode=Me;break}t.have=0,t.mode=lu;case lu:for(;t.have>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=S,m-=S,t.lens[t.have++]=G;else{if(G===16){for(N=S+2;m>>=S,m-=S,t.have===0){n.msg="invalid bit length repeat",t.mode=Me;break}dt=t.lens[t.have-1],p=3+(d&3),d>>>=2,m-=2}else if(G===17){for(N=S+3;m>>=S,m-=S,dt=0,p=3+(d&7),d>>>=3,m-=3}else{for(N=S+7;m>>=S,m-=S,dt=0,p=11+(d&127),d>>>=7,m-=7}if(t.have+p>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Me;break}for(;p--;)t.lens[t.have++]=dt}}if(t.mode===Me)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Me;break}if(t.lenbits=9,tt={bits:t.lenbits},X=Fa(of,t.lens,0,t.nlen,t.lencode,0,t.work,tt),t.lenbits=tt.bits,X){n.msg="invalid literal/lengths set",t.mode=Me;break}if(t.distbits=6,t.distcode=t.distdyn,tt={bits:t.distbits},X=Fa(lf,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,tt),t.distbits=tt.bits,X){n.msg="invalid distances set",t.mode=Me;break}if(t.mode=_s,e===xs)break t;case _s:t.mode=As;case As:if(l>=6&&h>=258){n.next_out=c,n.avail_out=h,n.next_in=a,n.avail_in=l,t.hold=d,t.bits=m,gc(n,k),c=n.next_out,s=n.output,h=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,d=t.hold,m=t.bits,t.mode===Er&&(t.back=-1);break}for(t.back=0;M=t.lencode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>q)],S=M>>>24,V=M>>>16&255,G=M&65535,!(q+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=q,m-=q,t.back+=q}if(d>>>=S,m-=S,t.back+=S,t.length=G,V===0){t.mode=du;break}if(V&32){t.back=-1,t.mode=Er;break}if(V&64){n.msg="invalid literal/length code",t.mode=Me;break}t.extra=V&15,t.mode=uu;case uu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=fu;case fu:for(;M=t.distcode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>q)],S=M>>>24,V=M>>>16&255,G=M&65535,!(q+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=q,m-=q,t.back+=q}if(d>>>=S,m-=S,t.back+=S,V&64){n.msg="invalid distance code",t.mode=Me;break}t.offset=G,t.extra=V&15,t.mode=hu;case hu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Me;break}t.mode=cu;case cu:if(h===0)break t;if(p=k-h,t.offset>p){if(p=t.offset-p,p>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Me;break}p>t.wnext?(p-=t.wnext,j=t.wsize-p):j=t.wnext-p,p>t.length&&(p=t.length),O=t.window}else O=s,j=c-t.offset,p=t.length;p>h&&(p=h),h-=p,t.length-=p;do s[c++]=O[j++];while(--p);t.length===0&&(t.mode=As);break;case du:if(h===0)break t;s[c++]=t.length,h--,t.mode=As;break;case Ao:if(t.wrap){for(;m<32;){if(l===0)break t;l--,d|=i[a++]<{if(Ii(n))return Vn;let e=n.state;return e.window&&(e.window=null),n.state=null,ki},Bc=(n,e)=>{if(Ii(n))return Vn;const t=n.state;return t.wrap&2?(t.head=e,e.done=!1,ki):Vn},Mc=(n,e)=>{const t=e.length;let i,s,a;return Ii(n)||(i=n.state,i.wrap!==0&&i.mode!==Fs)?Vn:i.mode===Fs&&(s=1,s=Ho(s,e,t,0),s!==i.check)?uf:(a=vf(n,e,t,t),a?(i.mode=hf,ff):(i.havedict=1,ki))};var Rc=pf,Tc=gf,Dc=df,qc=Fc,Uc=mf,zc=Oc,Hc=jc,Wc=Bc,Vc=Mc,Gc="pako inflate (from Nodeca project)",Or={inflateReset:Rc,inflateReset2:Tc,inflateResetKeep:Dc,inflateInit:qc,inflateInit2:Uc,inflate:zc,inflateEnd:Hc,inflateGetHeader:Wc,inflateSetDictionary:Vc,inflateInfo:Gc};function Yc(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Jc=Yc;const bf=Object.prototype.toString,{Z_NO_FLUSH:Kc,Z_FINISH:Xc,Z_OK:Ra,Z_STREAM_END:So,Z_NEED_DICT:ko,Z_STREAM_ERROR:$c,Z_DATA_ERROR:bu,Z_MEM_ERROR:Zc}=rf;function Da(n){this.options=af.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dc,this.strm.avail_out=0;let t=Or.inflateInit2(this.strm,e.windowBits);if(t!==Ra)throw new Error(Wo[t]);if(this.header=new Jc,Or.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Vo.string2buf(e.dictionary):bf.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Or.inflateSetDictionary(this.strm,e.dictionary),t!==Ra)))throw new Error(Wo[t])}Da.prototype.push=function(n,e){const t=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,c,l;if(this.ended)return!1;for(e===~~e?c=e:c=e===!0?Xc:Kc,bf.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Or.inflate(t,c),a===ko&&s&&(a=Or.inflateSetDictionary(t,s),a===Ra?a=Or.inflate(t,c):a===bu&&(a=ko));t.avail_in>0&&a===So&&t.state.wrap>0&&n[t.next_in]!==0;)Or.inflateReset(t),a=Or.inflate(t,c);switch(a){case $c:case bu:case ko:case Zc:return this.onEnd(a),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||a===So))if(this.options.to==="string"){let h=Vo.utf8border(t.output,t.next_out),d=t.next_out-h,m=Vo.buf2string(t.output,h);t.next_out=d,t.avail_out=i-d,d&&t.output.set(t.output.subarray(h,h+d),0),this.onData(m)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ra&&l===0)){if(a===So)return a=Or.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Da.prototype.onData=function(n){this.chunks.push(n)};Da.prototype.onEnd=function(n){n===Ra&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=af.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Qc(n,e){const t=new Da(e);if(t.push(n),t.err)throw t.msg||Wo[t.err];return t.result}var t1=Da,e1=Qc,n1={Inflate:t1,inflate:e1};const{Inflate:r1,inflate:i1}=n1;var wu=r1,a1=i1;const wf=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;wf[n]=e}const yu=4294967295;function s1(n,e,t){let i=n;for(let s=0;s>>8;return i}function o1(n,e){return(s1(yu,n,e)^yu)>>>0}function xu(n,e,t){const i=n.readUint32(),s=o1(new Uint8Array(n.buffer,n.byteOffset+n.offset-e-4,e),e);if(s!==i)throw new Error(`CRC mismatch for chunk ${t}. Expected ${i}, found ${s}`)}function yf(n,e,t){for(let i=0;i>1)&255}else{for(;a>1)&255;for(;a>1)&255}}function Nf(n,e,t,i,s){let a=0;if(t.length===0){for(;a=t||vt>=i))for(let dt=0;dt>8&255}const g1=new Uint16Array([255]),m1=new Uint8Array(g1.buffer),v1=m1[0]===255,b1=new Uint8Array(0);function _u(n){const{data:e,width:t,height:i,channels:s,depth:a}=n,c=Math.ceil(a/8)*s,l=Math.ceil(a/8*s*t),h=new Uint8Array(i*l);let d=b1,m=0,_,k;for(let p=0;p>8&255}const Ps=Uint8Array.of(137,80,78,71,13,10,26,10);function Au(n){if(!y1(n.readBytes(Ps.length)))throw new Error("wrong PNG signature")}function y1(n){if(n.length79)throw new Error("keyword length must be between 1 and 79")}const N1=/^[\u0000-\u00FF]*$/;function L1(n){if(!N1.test(n))throw new Error("invalid latin1 text")}function S1(n,e,t){const i=Sf(e);n[i]=k1(e,t-i.length-1)}function Sf(n){for(n.mark();n.readByte()!==_1;);const e=n.offset;n.reset();const t=Lf.decode(n.readBytes(e-n.offset-1));return n.skip(1),A1(t),t}function k1(n,e){return Lf.decode(n.readBytes(e))}const Mn={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Po={UNKNOWN:-1,DEFLATE:0},Nu={UNKNOWN:-1,ADAPTIVE:0},Io={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Ns={NONE:0,BACKGROUND:1,PREVIOUS:2},Co={SOURCE:0,OVER:1};class P1 extends Qo{constructor(t,i={}){super(t);xe(this,"_checkCrc");xe(this,"_inflator");xe(this,"_png");xe(this,"_apng");xe(this,"_end");xe(this,"_hasPalette");xe(this,"_palette");xe(this,"_hasTransparency");xe(this,"_transparency");xe(this,"_compressionMethod");xe(this,"_filterMethod");xe(this,"_interlaceMethod");xe(this,"_colorType");xe(this,"_isAnimated");xe(this,"_numberOfFrames");xe(this,"_numberOfPlays");xe(this,"_frames");xe(this,"_writingDataChunks");const{checkCrc:s=!1}=i;this._checkCrc=s,this._inflator=new wu,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Po.UNKNOWN,this._filterMethod=Nu.UNKNOWN,this._interlaceMethod=Io.UNKNOWN,this._colorType=Mn.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Au(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeChunk(t,i)}return this.decodeImage(),this._png}decodeApng(){for(Au(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeApngChunk(t,i)}return this.decodeApngImage(),this._apng}decodeChunk(t,i){const s=this.offset;switch(i){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case x1:S1(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?xu(this,t+4,i):this.skip(4)}decodeApngChunk(t,i){const s=this.offset;switch(i!=="fdAT"&&i!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),i){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,i),this.offset=s+t;break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?xu(this,t+4,i):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=I1(this.readUint8());const i=this.readUint8();this._colorType=i;let s;switch(i){case Mn.GREYSCALE:s=1;break;case Mn.TRUECOLOUR:s=3;break;case Mn.INDEXED_COLOUR:s=1;break;case Mn.GREYSCALE_ALPHA:s=2;break;case Mn.TRUECOLOUR_ALPHA:s=4;break;case Mn.UNKNOWN:default:throw new Error(`Unknown color type: ${i}`)}if(this._png.channels=s,this._compressionMethod=this.readUint8(),this._compressionMethod!==Po.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const i=t/3;this._hasPalette=!0;const s=[];this._palette=s;for(let a=0;athis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let i=0;ithis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let i=0;for(;i{const h=((c+i.yOffset)*this._png.width+i.xOffset+l)*this._png.channels,d=(c*i.width+l)*this._png.channels;return{index:h,frameIndex:d}};switch(i.blendOp){case Co.SOURCE:for(let c=0;c=200&&e.status<=299}function Ls(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(e)}}var yi=Kt.saveAs||((typeof window>"u"?"undefined":_e(window))!=="object"||window!==Kt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(n,e,t){var i=Kt.URL||Kt.webkitURL,s=document.createElement("a");e=e||n.name||"download",s.download=e,s.rel="noopener",typeof n=="string"?(s.href=n,s.origin!==location.origin?Su(s.href)?Eo(n,e,t):Ls(s,s.target="_blank"):Ls(s)):(s.href=i.createObjectURL(n),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Ls(s)},0))}:"msSaveOrOpenBlob"in navigator?function(n,e,t){if(e=e||n.name||"download",typeof n=="string")if(Su(n))Eo(n,e,t);else{var i=document.createElement("a");i.href=n,i.target="_blank",setTimeout(function(){Ls(i)})}else navigator.msSaveOrOpenBlob(function(s,a){return a===void 0?a={autoBom:!1}:_e(a)!=="object"&&(Se.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}(n,t),e)}:function(n,e,t,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),typeof n=="string")return Eo(n,e,t);var s=n.type==="application/octet-stream",a=/constructor/i.test(Kt.HTMLElement)||Kt.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&a)&&(typeof FileReader>"u"?"undefined":_e(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var m=l.result;m=c?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=m:location=m,i=null},l.readAsDataURL(n)}else{var h=Kt.URL||Kt.webkitURL,d=h.createObjectURL(n);i?i.location=d:location.href=d,i=null,setTimeout(function(){h.revokeObjectURL(d)},4e4)}});/** - * A class to parse color values - * @author Stoyan Stefanov - * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} - * @license Use it if you like it - */function kf(n){var e;n=n||"",this.ok=!1,n.charAt(0)=="#"&&(n=n.substr(1,6)),n={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",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=(n=n.replace(/ /g,"")).toLowerCase()]||n;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],i=0;i255?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.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var l=this.r.toString(16),h=this.g.toString(16),d=this.b.toString(16);return l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),d.length==1&&(d="0"+d),"#"+l+h+d}}var Is=Kt.atob.bind(Kt),ku=Kt.btoa.bind(Kt);/** - * @license - * Joseph Myers does not specify a particular license for his work. - * - * Author: Joseph Myers - * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js - * - * Modified by: Owen Leong - */function Oo(n,e){var t=n[0],i=n[1],s=n[2],a=n[3];t=mn(t,i,s,a,e[0],7,-680876936),a=mn(a,t,i,s,e[1],12,-389564586),s=mn(s,a,t,i,e[2],17,606105819),i=mn(i,s,a,t,e[3],22,-1044525330),t=mn(t,i,s,a,e[4],7,-176418897),a=mn(a,t,i,s,e[5],12,1200080426),s=mn(s,a,t,i,e[6],17,-1473231341),i=mn(i,s,a,t,e[7],22,-45705983),t=mn(t,i,s,a,e[8],7,1770035416),a=mn(a,t,i,s,e[9],12,-1958414417),s=mn(s,a,t,i,e[10],17,-42063),i=mn(i,s,a,t,e[11],22,-1990404162),t=mn(t,i,s,a,e[12],7,1804603682),a=mn(a,t,i,s,e[13],12,-40341101),s=mn(s,a,t,i,e[14],17,-1502002290),t=vn(t,i=mn(i,s,a,t,e[15],22,1236535329),s,a,e[1],5,-165796510),a=vn(a,t,i,s,e[6],9,-1069501632),s=vn(s,a,t,i,e[11],14,643717713),i=vn(i,s,a,t,e[0],20,-373897302),t=vn(t,i,s,a,e[5],5,-701558691),a=vn(a,t,i,s,e[10],9,38016083),s=vn(s,a,t,i,e[15],14,-660478335),i=vn(i,s,a,t,e[4],20,-405537848),t=vn(t,i,s,a,e[9],5,568446438),a=vn(a,t,i,s,e[14],9,-1019803690),s=vn(s,a,t,i,e[3],14,-187363961),i=vn(i,s,a,t,e[8],20,1163531501),t=vn(t,i,s,a,e[13],5,-1444681467),a=vn(a,t,i,s,e[2],9,-51403784),s=vn(s,a,t,i,e[7],14,1735328473),t=bn(t,i=vn(i,s,a,t,e[12],20,-1926607734),s,a,e[5],4,-378558),a=bn(a,t,i,s,e[8],11,-2022574463),s=bn(s,a,t,i,e[11],16,1839030562),i=bn(i,s,a,t,e[14],23,-35309556),t=bn(t,i,s,a,e[1],4,-1530992060),a=bn(a,t,i,s,e[4],11,1272893353),s=bn(s,a,t,i,e[7],16,-155497632),i=bn(i,s,a,t,e[10],23,-1094730640),t=bn(t,i,s,a,e[13],4,681279174),a=bn(a,t,i,s,e[0],11,-358537222),s=bn(s,a,t,i,e[3],16,-722521979),i=bn(i,s,a,t,e[6],23,76029189),t=bn(t,i,s,a,e[9],4,-640364487),a=bn(a,t,i,s,e[12],11,-421815835),s=bn(s,a,t,i,e[15],16,530742520),t=wn(t,i=bn(i,s,a,t,e[2],23,-995338651),s,a,e[0],6,-198630844),a=wn(a,t,i,s,e[7],10,1126891415),s=wn(s,a,t,i,e[14],15,-1416354905),i=wn(i,s,a,t,e[5],21,-57434055),t=wn(t,i,s,a,e[12],6,1700485571),a=wn(a,t,i,s,e[3],10,-1894986606),s=wn(s,a,t,i,e[10],15,-1051523),i=wn(i,s,a,t,e[1],21,-2054922799),t=wn(t,i,s,a,e[8],6,1873313359),a=wn(a,t,i,s,e[15],10,-30611744),s=wn(s,a,t,i,e[6],15,-1560198380),i=wn(i,s,a,t,e[13],21,1309151649),t=wn(t,i,s,a,e[4],6,-145523070),a=wn(a,t,i,s,e[11],10,-1120210379),s=wn(s,a,t,i,e[2],15,718787259),i=wn(i,s,a,t,e[9],21,-343485551),n[0]=Zr(t,n[0]),n[1]=Zr(i,n[1]),n[2]=Zr(s,n[2]),n[3]=Zr(a,n[3])}function js(n,e,t,i,s,a){return e=Zr(Zr(e,n),Zr(i,a)),Zr(e<>>32-s,t)}function mn(n,e,t,i,s,a,c){return js(e&t|~e&i,n,e,s,a,c)}function vn(n,e,t,i,s,a,c){return js(e&i|t&~i,n,e,s,a,c)}function bn(n,e,t,i,s,a,c){return js(e^t^i,n,e,s,a,c)}function wn(n,e,t,i,s,a,c){return js(t^(e|~i),n,e,s,a,c)}function Pf(n){var e,t=n.length,i=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=n.length;e+=64)Oo(i,F1(n.substring(e-64,e)));n=n.substring(e-64);var s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=n.charCodeAt(e)<<(e%4<<3);if(s[e>>2]|=128<<(e%4<<3),e>55)for(Oo(i,s),e=0;e<16;e++)s[e]=0;return s[14]=8*t,Oo(i,s),i}function F1(n){var e,t=[];for(e=0;e<64;e+=4)t[e>>2]=n.charCodeAt(e)+(n.charCodeAt(e+1)<<8)+(n.charCodeAt(e+2)<<16)+(n.charCodeAt(e+3)<<24);return t}var Pu="0123456789abcdef".split("");function E1(n){for(var e="",t=0;t<4;t++)e+=Pu[n>>8*t+4&15]+Pu[n>>8*t&15];return e}function O1(n){return String.fromCharCode(255&n,(65280&n)>>8,(16711680&n)>>16,(4278190080&n)>>24)}function Go(n){return Pf(n).map(O1).join("")}var j1=function(n){for(var e=0;e>16)+(e>>16)+(t>>16)<<16|65535&t}return n+e&4294967295}/** - * @license - * FPDF is released under a permissive license: there is no usage restriction. - * You may embed it freely in your application (commercial or not), with or - * without modifications. - * - * Reference: http://www.fpdf.org/en/script/script37.php - */function Yo(n,e){var t,i,s,a;if(n!==t){for(var c=(s=n,a=1+(256/n.length|0),new Array(a+1).join(s)),l=[],h=0;h<256;h++)l[h]=h;var d=0;for(h=0;h<256;h++){var m=l[h];d=(d+m+c.charCodeAt(h))%256,l[h]=l[d],l[d]=m}t=n,i=l}else l=i;var _=e.length,k=0,p=0,j="";for(h=0;h<_;h++)p=(p+(m=l[k=(k+1)%256]))%256,l[k]=l[p],l[p]=m,c=l[(l[k]+l[p])%256],j+=String.fromCharCode(e.charCodeAt(h)^c);return j}/** - * @license - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - * Author: Owen Leong (@owenl131) - * Date: 15 Oct 2020 - * References: - * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt - * https://github.com/foliojs/pdfkit/blob/master/lib/security.js - * http://www.fpdf.org/en/script/script37.php - */var Iu={print:4,modify:8,copy:16,"annot-forms":32};function na(n,e,t,i){this.v=1,this.r=2;var s=192;n.forEach(function(l){if(Iu.perm!==void 0)throw new Error("Invalid permission: "+l);s+=Iu[l]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var a=(e+this.padding).substr(0,32),c=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,c),this.P=-(1+(255^s)),this.encryptionKey=Go(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(i)).substr(0,5),this.U=Yo(this.encryptionKey,this.padding)}function ra(n){if(/[^\u0000-\u00ff]/.test(n))throw new Error("Invalid PDF Name Object: "+n+", Only accept ASCII characters.");for(var e="",t=n.length,i=0;i126?"#"+("0"+s.toString(16)).slice(-2):n[i]}return e}function Cu(n){if(_e(n)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,i,s){if(s=s||!1,typeof t!="string"||typeof i!="function"||typeof s!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var a=Math.random().toString(35);return e[t][a]=[i,!!s],a},this.unsubscribe=function(t){for(var i in e)if(e[i][t])return delete e[i][t],Object.keys(e[i]).length===0&&delete e[i],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var i=Array.prototype.slice.call(arguments,1),s=[];for(var a in e[t]){var c=e[t][a];try{c[0].apply(n,i)}catch(l){Kt.console&&Se.error("jsPDF PubSub Error",l.message,l)}c[1]&&s.push(a)}s.length&&s.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function Ta(n){if(!(this instanceof Ta))return new Ta(n);var e="opacity,stroke-opacity".split(",");for(var t in n)n.hasOwnProperty(t)&&e.indexOf(t)>=0&&(this[t]=n[t]);this.id="",this.objectNumber=-1}function If(n,e){this.gState=n,this.matrix=e,this.id="",this.objectNumber=-1}function $r(n,e,t,i,s){if(!(this instanceof $r))return new $r(n,e,t,i,s);this.type=n==="axial"?2:3,this.coords=e,this.colors=t,If.call(this,i,s)}function xi(n,e,t,i,s){if(!(this instanceof xi))return new xi(n,e,t,i,s);this.boundingBox=n,this.xStep=e,this.yStep=t,this.stream="",this.cloneIndex=0,If.call(this,i,s)}function Mt(n){var e,t=typeof arguments[0]=="string"?arguments[0]:"p",i=arguments[1],s=arguments[2],a=arguments[3],c=[],l=1,h=16,d="S",m=null;_e(n=n||{})==="object"&&(t=n.orientation,i=n.unit||i,s=n.format||s,a=n.compress||n.compressPdf||a,(m=n.encryption||null)!==null&&(m.userPassword=m.userPassword||"",m.ownerPassword=m.ownerPassword||"",m.userPermissions=m.userPermissions||[]),l=typeof n.userUnit=="number"?Math.abs(n.userUnit):1,n.precision!==void 0&&(e=n.precision),n.floatPrecision!==void 0&&(h=n.floatPrecision),d=n.defaultPathOperation||"S"),c=n.filters||(a===!0?["FlateEncode"]:c),i=i||"mm",t=(""+(t||"P")).toLowerCase();var _=n.putOnlyUsedFonts||!1,k={},p={internal:{},__private__:{}};p.__private__.PubSub=Cu;var j="1.3",O=p.__private__.getPdfVersion=function(){return j};p.__private__.setPdfVersion=function(u){j=u};var M={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};p.__private__.getPageFormats=function(){return M};var S=p.__private__.getPageFormat=function(u){return M[u]};s=s||"a4";var V="compat",G="advanced",q=V;function it(){this.saveGraphicsState(),P(new Gt(ne,0,0,-ne,0,oi()*ne).toString()+" cm"),this.setFontSize(this.getFontSize()/ne),d="n",q=G}function vt(){this.restoreGraphicsState(),d="S",q=V}var dt=p.__private__.combineFontStyleAndFontWeight=function(u,v){if(u=="bold"&&v=="normal"||u=="bold"&&v==400||u=="normal"&&v=="italic"||u=="bold"&&v=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return v&&(u=v==400||v==="normal"?u==="italic"?"italic":"normal":v!=700&&v!=="bold"||u!=="normal"?(v==700?"bold":v)+""+u:"bold"),u};p.advancedAPI=function(u){var v=q===V;return v&&it.call(this),typeof u!="function"||(u(this),v&&vt.call(this)),this},p.compatAPI=function(u){var v=q===G;return v&&vt.call(this),typeof u!="function"||(u(this),v&&it.call(this)),this},p.isAdvancedAPI=function(){return q===G};var X,R=function(u){if(q!==G)throw new Error(u+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},tt=p.roundToPrecision=p.__private__.roundToPrecision=function(u,v){var I=e||v;if(isNaN(u)||isNaN(I))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return u.toFixed(I).replace(/0+$/,"")};X=p.hpf=p.__private__.hpf=typeof h=="number"?function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return tt(u,h)}:h==="smart"?function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return tt(u,u>-1&&u<1?16:5)}:function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return tt(u,16)};var N=p.f2=p.__private__.f2=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.f2");return tt(u,2)},E=p.__private__.f3=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.f3");return tt(u,3)},z=p.scale=p.__private__.scale=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.scale");return q===V?u*ne:q===G?u:void 0},U=function(u){return z(function(v){return q===V?oi()-v:q===G?v:void 0}(u))};p.__private__.setPrecision=p.setPrecision=function(u){typeof parseInt(u,10)=="number"&&(e=parseInt(u,10))};var rt,ot="00000000000000000000000000000000",ft=p.__private__.getFileId=function(){return ot},nt=p.__private__.setFileId=function(u){return ot=u!==void 0&&/^[a-fA-F0-9]{32}$/.test(u)?u.toUpperCase():ot.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),m!==null&&(on=new na(m.userPermissions,m.userPassword,m.ownerPassword,ot)),ot};p.setFileId=function(u){return nt(u),this},p.getFileId=function(){return ft()};var ct=p.__private__.convertDateToPDFDate=function(u){var v=u.getTimezoneOffset(),I=v<0?"+":"-",D=Math.floor(Math.abs(v/60)),K=Math.abs(v%60),lt=[I,T(D),"'",T(K),"'"].join("");return["D:",u.getFullYear(),T(u.getMonth()+1),T(u.getDate()),T(u.getHours()),T(u.getMinutes()),T(u.getSeconds()),lt].join("")},At=p.__private__.convertPDFDateToDate=function(u){var v=parseInt(u.substr(2,4),10),I=parseInt(u.substr(6,2),10)-1,D=parseInt(u.substr(8,2),10),K=parseInt(u.substr(10,2),10),lt=parseInt(u.substr(12,2),10),mt=parseInt(u.substr(14,2),10);return new Date(v,I,D,K,lt,mt,0)},wt=p.__private__.setCreationDate=function(u){var v;if(u===void 0&&(u=new Date),u instanceof Date)v=ct(u);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(u))throw new Error("Invalid argument passed to jsPDF.setCreationDate");v=u}return rt=v},x=p.__private__.getCreationDate=function(u){var v=rt;return u==="jsDate"&&(v=At(rt)),v};p.setCreationDate=function(u){return wt(u),this},p.getCreationDate=function(u){return x(u)};var B,T=p.__private__.padd2=function(u){return("0"+parseInt(u)).slice(-2)},H=p.__private__.padd2Hex=function(u){return("00"+(u=u.toString())).substr(u.length)},J=0,Z=[],at=[],st=0,gt=[],_t=[],kt=!1,St=at;p.__private__.setCustomOutputDestination=function(u){kt=!0,St=u};var Dt=function(u){kt||(St=u)};p.__private__.resetCustomOutputDestination=function(){kt=!1,St=at};var P=p.__private__.out=function(u){return u=u.toString(),st+=u.length+1,St.push(u),St},Lt=p.__private__.write=function(u){return P(arguments.length===1?u.toString():Array.prototype.join.call(arguments," "))},ae=p.__private__.getArrayBuffer=function(u){for(var v=u.length,I=new ArrayBuffer(v),D=new Uint8Array(I);v--;)D[v]=u.charCodeAt(v);return I},Ht=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];p.__private__.getStandardFonts=function(){return Ht};var yt=n.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(u){return yt=q===G?u/ne:u,this};var Wt,Ct=p.__private__.getFontSize=p.getFontSize=function(){return q===V?yt:yt*ne},zt=n.R2L||!1;p.__private__.setR2L=p.setR2L=function(u){return zt=u,this},p.__private__.getR2L=p.getR2L=function(){return zt};var qt,ve=p.__private__.setZoomMode=function(u){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(u))Wt=u;else if(isNaN(u)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(u)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+u+'" is not recognized.');Wt=u}else Wt=parseInt(u,10)};p.__private__.getZoomMode=function(){return Wt};var ue,Zt=p.__private__.setPageMode=function(u){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(u)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+u+'" is not recognized.');qt=u};p.__private__.getPageMode=function(){return qt};var he=p.__private__.setLayoutMode=function(u){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(u)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+u+'" is not recognized.');ue=u};p.__private__.getLayoutMode=function(){return ue},p.__private__.setDisplayMode=p.setDisplayMode=function(u,v,I){return ve(u),he(v),Zt(I),this};var fe={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(u){if(Object.keys(fe).indexOf(u)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return fe[u]},p.__private__.getDocumentProperties=function(){return fe},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(u){for(var v in fe)fe.hasOwnProperty(v)&&u[v]&&(fe[v]=u[v]);return this},p.__private__.setDocumentProperty=function(u,v){if(Object.keys(fe).indexOf(u)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return fe[u]=v};var Bt,ne,Tt,He,ge,se={},oe={},je=[],Ut={},ke={},Yt={},Qt={},Be=null,le=0,Vt=[],be=new Cu(p),ei=n.hotfixes||[],hn={},vr={},rr=[],Gt=function u(v,I,D,K,lt,mt){if(!(this instanceof u))return new u(v,I,D,K,lt,mt);isNaN(v)&&(v=1),isNaN(I)&&(I=0),isNaN(D)&&(D=0),isNaN(K)&&(K=1),isNaN(lt)&&(lt=0),isNaN(mt)&&(mt=0),this._matrix=[v,I,D,K,lt,mt]};Object.defineProperty(Gt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(u){this._matrix[0]=u}}),Object.defineProperty(Gt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(u){this._matrix[1]=u}}),Object.defineProperty(Gt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(u){this._matrix[2]=u}}),Object.defineProperty(Gt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(u){this._matrix[3]=u}}),Object.defineProperty(Gt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(u){this._matrix[4]=u}}),Object.defineProperty(Gt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(u){this._matrix[5]=u}}),Object.defineProperty(Gt.prototype,"a",{get:function(){return this._matrix[0]},set:function(u){this._matrix[0]=u}}),Object.defineProperty(Gt.prototype,"b",{get:function(){return this._matrix[1]},set:function(u){this._matrix[1]=u}}),Object.defineProperty(Gt.prototype,"c",{get:function(){return this._matrix[2]},set:function(u){this._matrix[2]=u}}),Object.defineProperty(Gt.prototype,"d",{get:function(){return this._matrix[3]},set:function(u){this._matrix[3]=u}}),Object.defineProperty(Gt.prototype,"e",{get:function(){return this._matrix[4]},set:function(u){this._matrix[4]=u}}),Object.defineProperty(Gt.prototype,"f",{get:function(){return this._matrix[5]},set:function(u){this._matrix[5]=u}}),Object.defineProperty(Gt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Gt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Gt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Gt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Gt.prototype.join=function(u){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(X).join(u)},Gt.prototype.multiply=function(u){var v=u.sx*this.sx+u.shy*this.shx,I=u.sx*this.shy+u.shy*this.sy,D=u.shx*this.sx+u.sy*this.shx,K=u.shx*this.shy+u.sy*this.sy,lt=u.tx*this.sx+u.ty*this.shx+this.tx,mt=u.tx*this.shy+u.ty*this.sy+this.ty;return new Gt(v,I,D,K,lt,mt)},Gt.prototype.decompose=function(){var u=this.sx,v=this.shy,I=this.shx,D=this.sy,K=this.tx,lt=this.ty,mt=Math.sqrt(u*u+v*v),Et=(u/=mt)*I+(v/=mt)*D;I-=u*Et,D-=v*Et;var Ft=Math.sqrt(I*I+D*D);return Et/=Ft,u*(D/=Ft)>16&255,D=Ft>>8&255,K=255&Ft}if(D===void 0||lt===void 0&&I===D&&D===K)v=typeof I=="string"?I+" "+mt[0]:u.precision===2?N(I/255)+" "+mt[0]:E(I/255)+" "+mt[0];else if(lt===void 0||_e(lt)==="object"){if(lt&&!isNaN(lt.a)&<.a===0)return["1.","1.","1.",mt[1]].join(" ");v=typeof I=="string"?[I,D,K,mt[1]].join(" "):u.precision===2?[N(I/255),N(D/255),N(K/255),mt[1]].join(" "):[E(I/255),E(D/255),E(K/255),mt[1]].join(" ")}else v=typeof I=="string"?[I,D,K,lt,mt[2]].join(" "):u.precision===2?[N(I),N(D),N(K),N(lt),mt[2]].join(" "):[E(I),E(D),E(K),E(lt),mt[2]].join(" ");return v},Jn=p.__private__.getFilters=function(){return c},qn=p.__private__.putStream=function(u){var v=(u=u||{}).data||"",I=u.filters||Jn(),D=u.alreadyAppliedFilters||[],K=u.addLength1||!1,lt=v.length,mt=u.objectId,Et=function(Fe){return Fe};if(m!==null&&mt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");m!==null&&(Et=on.encryptor(mt,0));var Ft={};I===!0&&(I=["FlateEncode"]);var Xt=u.additionalKeyValues||[],te=(Ft=Mt.API.processDataByFilters!==void 0?Mt.API.processDataByFilters(v,I):{data:v,reverseChain:[]}).reverseChain+(Array.isArray(D)?D.join(" "):D.toString());if(Ft.data.length!==0&&(Xt.push({key:"Length",value:Ft.data.length}),K===!0&&Xt.push({key:"Length1",value:lt})),te.length!=0)if(te.split("/").length-1==1)Xt.push({key:"Filter",value:te});else{Xt.push({key:"Filter",value:"["+te+"]"});for(var de=0;de>"),Ft.data.length!==0&&(P("stream"),P(Et(Ft.data)),P("endstream"))},ri=p.__private__.putPage=function(u){var v=u.number,I=u.data,D=u.objId,K=u.contentsObjId;sn(D,!0),P("<>"),P("endobj");var lt=I.join(` -`);return q===G&&(lt+=` -Q`),sn(K,!0),qn({data:lt,filters:Jn(),objectId:K}),P("endobj"),D},ar=p.__private__.putPages=function(){var u,v,I=[];for(u=1;u<=le;u++)Vt[u].objId=an(),Vt[u].contentsObjId=an();for(u=1;u<=le;u++)I.push(ri({number:u,data:_t[u],objId:Vt[u].objId,contentsObjId:Vt[u].contentsObjId,mediaBox:Vt[u].mediaBox,cropBox:Vt[u].cropBox,bleedBox:Vt[u].bleedBox,trimBox:Vt[u].trimBox,artBox:Vt[u].artBox,userUnit:Vt[u].userUnit,rootDictionaryObjId:jr,resourceDictionaryObjId:Gn}));sn(jr,!0),P("<>"),P("endobj"),be.publish("postPutPages")},ii=function(u){be.publish("putFont",{font:u,out:P,newObject:De,putStream:qn}),u.isAlreadyPutted!==!0&&(u.objectNumber=De(),P("<<"),P("/Type /Font"),P("/BaseFont /"+ra(u.postScriptName)),P("/Subtype /Type1"),typeof u.encoding=="string"&&P("/Encoding /"+u.encoding),P("/FirstChar 32"),P("/LastChar 255"),P(">>"),P("endobj"))},Fi=function(u){u.objectNumber=De();var v=[];v.push({key:"Type",value:"/XObject"}),v.push({key:"Subtype",value:"/Form"}),v.push({key:"BBox",value:"["+[X(u.x),X(u.y),X(u.x+u.width),X(u.y+u.height)].join(" ")+"]"}),v.push({key:"Matrix",value:"["+u.matrix.toString()+"]"});var I=u.pages[1].join(` -`);qn({data:I,additionalKeyValues:v,objectId:u.objectNumber}),P("endobj")},Ei=function(u,v){v||(v=21);var I=De(),D=function(mt,Et){var Ft,Xt=[],te=1/(Et-1);for(Ft=0;Ft<1;Ft+=te)Xt.push(Ft);if(Xt.push(1),mt[0].offset!=0){var de={offset:0,color:mt[0].color};mt.unshift(de)}if(mt[mt.length-1].offset!=1){var $e={offset:1,color:mt[mt.length-1].color};mt.push($e)}for(var Ne="",Ae=0,Fe=0;Femt[Ae+1].offset;)Ae++;var Re=mt[Ae].offset,Te=(Ft-Re)/(mt[Ae+1].offset-Re),cn=mt[Ae].color,Lr=mt[Ae+1].color;Ne+=H(Math.round((1-Te)*cn[0]+Te*Lr[0]).toString(16))+H(Math.round((1-Te)*cn[1]+Te*Lr[1]).toString(16))+H(Math.round((1-Te)*cn[2]+Te*Lr[2]).toString(16))}return Ne.trim()}(u.colors,v),K=[];K.push({key:"FunctionType",value:"0"}),K.push({key:"Domain",value:"[0.0 1.0]"}),K.push({key:"Size",value:"["+v+"]"}),K.push({key:"BitsPerSample",value:"8"}),K.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),K.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),qn({data:D,additionalKeyValues:K,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:I}),P("endobj"),u.objectNumber=De(),P("<< /ShadingType "+u.type),P("/ColorSpace /DeviceRGB");var lt="/Coords ["+X(parseFloat(u.coords[0]))+" "+X(parseFloat(u.coords[1]))+" ";u.type===2?lt+=X(parseFloat(u.coords[2]))+" "+X(parseFloat(u.coords[3])):lt+=X(parseFloat(u.coords[2]))+" "+X(parseFloat(u.coords[3]))+" "+X(parseFloat(u.coords[4]))+" "+X(parseFloat(u.coords[5])),P(lt+="]"),u.matrix&&P("/Matrix ["+u.matrix.toString()+"]"),P("/Function "+I+" 0 R"),P("/Extend [true true]"),P(">>"),P("endobj")},Oi=function(u,v){var I=an(),D=De();v.push({resourcesOid:I,objectOid:D}),u.objectNumber=D;var K=[];K.push({key:"Type",value:"/Pattern"}),K.push({key:"PatternType",value:"1"}),K.push({key:"PaintType",value:"1"}),K.push({key:"TilingType",value:"1"}),K.push({key:"BBox",value:"["+u.boundingBox.map(X).join(" ")+"]"}),K.push({key:"XStep",value:X(u.xStep)}),K.push({key:"YStep",value:X(u.yStep)}),K.push({key:"Resources",value:I+" 0 R"}),u.matrix&&K.push({key:"Matrix",value:"["+u.matrix.toString()+"]"}),qn({data:u.stream,additionalKeyValues:K,objectId:u.objectNumber}),P("endobj")},Bs=function(u){for(var v in u.objectNumber=De(),P("<<"),u)switch(v){case"opacity":P("/ca "+N(u[v]));break;case"stroke-opacity":P("/CA "+N(u[v]))}P(">>"),P("endobj")},aa=function(u){sn(u.resourcesOid,!0),P("<<"),P("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var v in P("/Font <<"),se)se.hasOwnProperty(v)&&(_===!1||_===!0&&k.hasOwnProperty(v))&&P("/"+v+" "+se[v].objectNumber+" 0 R");P(">>")}(),function(){if(Object.keys(Ut).length>0){for(var v in P("/Shading <<"),Ut)Ut.hasOwnProperty(v)&&Ut[v]instanceof $r&&Ut[v].objectNumber>=0&&P("/"+v+" "+Ut[v].objectNumber+" 0 R");be.publish("putShadingPatternDict"),P(">>")}}(),function(v){if(Object.keys(Ut).length>0){for(var I in P("/Pattern <<"),Ut)Ut.hasOwnProperty(I)&&Ut[I]instanceof p.TilingPattern&&Ut[I].objectNumber>=0&&Ut[I].objectNumber>")}}(u.objectOid),function(){if(Object.keys(Yt).length>0){var v;for(v in P("/ExtGState <<"),Yt)Yt.hasOwnProperty(v)&&Yt[v].objectNumber>=0&&P("/"+v+" "+Yt[v].objectNumber+" 0 R");be.publish("putGStateDict"),P(">>")}}(),function(){for(var v in P("/XObject <<"),hn)hn.hasOwnProperty(v)&&hn[v].objectNumber>=0&&P("/"+v+" "+hn[v].objectNumber+" 0 R");be.publish("putXobjectDict"),P(">>")}(),P(">>"),P("endobj")},qa=function(u){oe[u.fontName]=oe[u.fontName]||{},oe[u.fontName][u.fontStyle]=u.id},Ua=function(u,v,I,D,K){var lt={id:"F"+(Object.keys(se).length+1).toString(10),postScriptName:u,fontName:v,fontStyle:I,encoding:D,isStandardFont:K||!1,metadata:{}};return be.publish("addFont",{font:lt,instance:this}),se[lt.id]=lt,qa(lt),lt.id},Un=p.__private__.pdfEscape=p.pdfEscape=function(u,v){return function(I,D){var K,lt,mt,Et,Ft,Xt,te,de,$e;if(mt=(D=D||{}).sourceEncoding||"Unicode",Ft=D.outputEncoding,(D.autoencode||Ft)&&se[Bt].metadata&&se[Bt].metadata[mt]&&se[Bt].metadata[mt].encoding&&(Et=se[Bt].metadata[mt].encoding,!Ft&&se[Bt].encoding&&(Ft=se[Bt].encoding),!Ft&&Et.codePages&&(Ft=Et.codePages[0]),typeof Ft=="string"&&(Ft=Et[Ft]),Ft)){for(te=!1,Xt=[],K=0,lt=I.length;K>8&&(te=!0);I=Xt.join("")}for(K=I.length;te===void 0&&K!==0;)I.charCodeAt(K-1)>>8&&(te=!0),K--;if(!te)return I;for(Xt=D.noBOM?[]:[254,255],K=0,lt=I.length;K>8)>>8)throw new Error("Character at position "+K+" of string '"+I+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Xt.push($e),Xt.push(de-($e<<8))}return String.fromCharCode.apply(void 0,Xt)}(u,v).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},sa=p.__private__.beginPage=function(u){_t[++le]=[],Vt[le]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(u[0]),topRightY:Number(u[1])}},Ha(le),Dt(_t[B])},za=function(u,v){var I,D,K;switch(t=v||t,typeof u=="string"&&(I=S(u.toLowerCase()),Array.isArray(I)&&(D=I[0],K=I[1])),Array.isArray(u)&&(D=u[0]*ne,K=u[1]*ne),isNaN(D)&&(D=s[0],K=s[1]),(D>14400||K>14400)&&(Se.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),D=Math.min(14400,D),K=Math.min(14400,K)),s=[D,K],t.substr(0,1)){case"l":K>D&&(s=[K,D]);break;case"p":D>K&&(s=[K,D])}sa(s),Vs(Jt),P(Di),ha!==0&&P(ha+" J"),Rr!==0&&P(Rr+" j"),be.publish("addPage",{pageNumber:le})},oa=function(u){u>0&&u<=le&&(_t.splice(u,1),Vt.splice(u,1),le--,B>le&&(B=le),this.setPage(B))},Ha=function(u){u>0&&u<=le&&(B=u)},Wa=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return _t.length-1},Va=function(u,v,I){var D,K=void 0;return I=I||{},u=u!==void 0?u:se[Bt].fontName,v=v!==void 0?v:se[Bt].fontStyle,D=u.toLowerCase(),oe[D]!==void 0&&oe[D][v]!==void 0?K=oe[D][v]:oe[u]!==void 0&&oe[u][v]!==void 0?K=oe[u][v]:I.disableWarning===!1&&Se.warn("Unable to look up font label for font '"+u+"', '"+v+"'. Refer to getFontList() for available fonts."),K||I.noFallback||(K=oe.times[v])==null&&(K=oe.times.normal),K},sr=p.__private__.putInfo=function(){var u=De(),v=function(D){return D};for(var I in m!==null&&(v=on.encryptor(u,0)),P("<<"),P("/Producer ("+Un(v("jsPDF "+Mt.version))+")"),fe)fe.hasOwnProperty(I)&&fe[I]&&P("/"+I.substr(0,1).toUpperCase()+I.substr(1)+" ("+Un(v(fe[I]))+")");P("/CreationDate ("+Un(v(rt))+")"),P(">>"),P("endobj")},ji=p.__private__.putCatalog=function(u){var v=(u=u||{}).rootDictionaryObjId||jr;switch(De(),P("<<"),P("/Type /Catalog"),P("/Pages "+v+" 0 R"),Wt||(Wt="fullwidth"),Wt){case"fullwidth":P("/OpenAction [3 0 R /FitH null]");break;case"fullheight":P("/OpenAction [3 0 R /FitV null]");break;case"fullpage":P("/OpenAction [3 0 R /Fit]");break;case"original":P("/OpenAction [3 0 R /XYZ null null 1]");break;default:var I=""+Wt;I.substr(I.length-1)==="%"&&(Wt=parseInt(Wt)/100),typeof Wt=="number"&&P("/OpenAction [3 0 R /XYZ null null "+N(Wt)+"]")}switch(ue||(ue="continuous"),ue){case"continuous":P("/PageLayout /OneColumn");break;case"single":P("/PageLayout /SinglePage");break;case"two":case"twoleft":P("/PageLayout /TwoColumnLeft");break;case"tworight":P("/PageLayout /TwoColumnRight")}qt&&P("/PageMode /"+qt),be.publish("putCatalog"),P(">>"),P("endobj")},Ms=p.__private__.putTrailer=function(){P("trailer"),P("<<"),P("/Size "+(J+1)),P("/Root "+J+" 0 R"),P("/Info "+(J-1)+" 0 R"),m!==null&&P("/Encrypt "+on.oid+" 0 R"),P("/ID [ <"+ot+"> <"+ot+"> ]"),P(">>")},Xe=p.__private__.putHeader=function(){P("%PDF-"+j),P("%ºß¬à")},Ga=p.__private__.putXRef=function(){var u="0000000000";P("xref"),P("0 "+(J+1)),P("0000000000 65535 f ");for(var v=1;v<=J;v++)typeof Z[v]=="function"?P((u+Z[v]()).slice(-10)+" 00000 n "):Z[v]!==void 0?P((u+Z[v]).slice(-10)+" 00000 n "):P("0000000000 00000 n ")},or=p.__private__.buildDocument=function(){var u;J=0,st=0,at=[],Z=[],gt=[],jr=an(),Gn=an(),Dt(at),be.publish("buildDocument"),Xe(),ar(),function(){be.publish("putAdditionalObjects");for(var I=0;I"),P("/O <"+on.toHexString(on.O)+">"),P("/P "+on.P),P(">>"),P("endobj")),sr(),ji();var v=st;return Ga(),Ms(),P("startxref"),P(""+v),P("%%EOF"),Dt(_t[B]),at.join(` -`)},Bi=p.__private__.getBlob=function(u){return new Blob([ae(u)],{type:"application/pdf"})},la=function(u){for(;u.firstChild;)u.removeChild(u.firstChild)},In=function(u){var v,I=u.document,D=I.documentElement,K=I.head,lt=I.body;return K||(K=I.createElement("head"),D.appendChild(K)),lt||(lt=I.createElement("body"),D.appendChild(lt)),la(K),la(lt),(v=I.createElement("style")).appendChild(I.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),K.appendChild(v),{document:I,body:lt}},Mi=p.output=p.__private__.output=(Dn=function(u,v){switch(typeof(v=v||{})=="string"?v={filename:v}:v.filename=v.filename||"generated.pdf",u){case void 0:return or();case"save":p.save(v.filename);break;case"arraybuffer":return ae(or());case"blob":return Bi(or());case"bloburi":case"bloburl":if(Kt.URL!==void 0&&typeof Kt.URL.createObjectURL=="function")return Kt.URL&&Kt.URL.createObjectURL(Bi(or()))||void 0;Se.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var I="",D=or();try{I=ku(D)}catch{I=ku(unescape(encodeURIComponent(D)))}return"data:application/pdf;filename="+encodeURIComponent(v.filename)+";base64,"+I;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Kt)==="[object Window]"){var K="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",lt=!v.pdfObjectUrl;lt||(K=v.pdfObjectUrl);var mt=Kt.open();if(mt!==null){var Et=In(mt),Ft=Et.document.createElement("script"),Xt=this;Ft.src=K,lt&&(Ft.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Ft.crossOrigin="anonymous"),Ft.onload=function(){mt.PDFObject.embed(Xt.output("dataurlstring"),v)},Et.body.appendChild(Ft)}return mt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Kt)==="[object Window]"){var te=v.pdfJsUrl||"examples/PDF.js/web/viewer.html",de=Kt.open();if(de!==null){var $e=In(de),Ne=$e.document.createElement("iframe"),Ae=te.indexOf("?")===-1?"?":"&";Xt=this,Ne.id="pdfViewer",Ne.width="500px",Ne.height="400px",Ne.src=te+Ae+"file=&downloadName="+encodeURIComponent(v.filename),Ne.onload=function(){de.document.title=v.filename,Ne.contentWindow.PDFViewerApplication.open(Xt.output("bloburl"))},$e.body.appendChild(Ne)}return de}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Kt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Fe=Kt.open();if(Fe!==null){var Re=In(Fe),Te=Re.document.createElement("iframe");Te.src=this.output("datauristring",v),Re.body.appendChild(Te),Fe.document.title=v.filename}if(Fe||typeof safari>"u")return Fe;break;case"datauri":case"dataurl":return Kt.document.location.href=this.output("datauristring",v);default:return null}},Dn.foo=function(){try{return Dn.apply(this,arguments)}catch(I){var u=I.stack||"";~u.indexOf(" at ")&&(u=u.split(" at ")[1]);var v="Error in function "+u.split(` -`)[0].split("<")[0]+": "+I.message;if(!Kt.console)throw new Error(v);Kt.console.error(v,I),Kt.alert&&alert(v)}},Dn.foo.bar=Dn,Dn.foo),yr=function(u){return Array.isArray(ei)===!0&&ei.indexOf(u)>-1};switch(i){case"pt":ne=1;break;case"mm":ne=72/25.4;break;case"cm":ne=72/2.54;break;case"in":ne=72;break;case"px":ne=yr("px_scaling")==1?.75:96/72;break;case"pc":case"em":ne=12;break;case"ex":ne=6;break;default:if(typeof i!="number")throw new Error("Invalid unit: "+i);ne=i}var on=null;wt(),nt();var Ya=p.__private__.getPageInfo=p.getPageInfo=function(u){if(isNaN(u)||u%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Vt[u].objId,pageNumber:u,pageContext:Vt[u]}},Rs=p.__private__.getPageInfoByObjId=function(u){if(isNaN(u)||u%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var v in Vt)if(Vt[v].objId===u)break;return Ya(v)},Ts=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:Vt[B].objId,pageNumber:B,pageContext:Vt[B]}};p.addPage=function(){return za.apply(this,arguments),this},p.setPage=function(){return Ha.apply(this,arguments),Dt.call(this,_t[B]),this},p.insertPage=function(u){return this.addPage(),this.movePage(B,u),this},p.movePage=function(u,v){var I,D;if(u>v){I=_t[u],D=Vt[u];for(var K=u;K>v;K--)_t[K]=_t[K-1],Vt[K]=Vt[K-1];_t[v]=I,Vt[v]=D,this.setPage(v)}else if(u0&&(typeof u=="string"?u=Ae.splitTextToSize(u,te):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(Pe,Ie){return Pe.concat(Ae.splitTextToSize(Ie,te))},[]))),lt={text:u,x:v,y:I,options:D,mutex:{pdfEscape:Un,activeFontKey:Bt,fonts:se,activeFontSize:yt}},be.publish("preProcessText",lt),u=lt.text,Et=(D=lt.options).angle,Ne instanceof Gt==0&&Et&&typeof Et=="number"){Et*=Math.PI/180,D.rotationDirection===0&&(Et=-Et),q===G&&(Et=-Et);var ma=Math.cos(Et),fr=Math.sin(Et);Ne=new Gt(ma,fr,-fr,ma,0,0)}else Et&&Et instanceof Gt&&(Ne=Et);q!==G||Ne||(Ne=wr),(Xt=D.charSpace||qi)!==void 0&&(Te+=X(z(Xt))+` Tc -`,this.setCharSpace(this.getCharSpace()||0)),($e=D.horizontalScale)!==void 0&&(Te+=X(100*$e)+` Tz -`),D.lang;var yn=-1,es=D.renderingMode!==void 0?D.renderingMode:D.stroke,Vi=Ae.internal.getCurrentPageInfo().pageContext;switch(es){case 0:case!1:case"fill":yn=0;break;case 1:case!0:case"stroke":yn=1;break;case 2:case"fillThenStroke":yn=2;break;case 3:case"invisible":yn=3;break;case 4:case"fillAndAddForClipping":yn=4;break;case 5:case"strokeAndAddPathForClipping":yn=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":yn=6;break;case 7:case"addToPathForClipping":yn=7}var ns=Vi.usedRenderingMode!==void 0?Vi.usedRenderingMode:-1;yn!==-1?Te+=yn+` Tr -`:ns!==-1&&(Te+=`0 Tr -`),yn!==-1&&(Vi.usedRenderingMode=yn),Ft=D.align||"left";var zn,di=yt*cn,va=Ae.internal.pageSize.getWidth(),Gi=se[Bt];Xt=D.charSpace||qi,te=D.maxWidth||0,de=Object.assign({autoencode:!0,noBOM:!0},D.flags);var pi=[],ba=function(Pe){return Ae.getStringUnitWidth(Pe,{font:Gi,charSpace:Xt,fontSize:yt,doKerning:!1})*yt/Lr};if(Object.prototype.toString.call(u)==="[object Array]"){var xn;mt=li(u),Ft!=="left"&&(zn=mt.map(ba));var Ln,Yi=0;if(Ft==="right"){v-=zn[0],u=[],dn=mt.length;for(var Dr=0;Dr0?(te-zn[Ze])/wa:0;Ze":")"),vi=parseFloat(mt[pn][1]),bi=parseFloat(mt[pn][2]);break;case 0:Ur=(Re?"<":"(")+mt[pn]+(Re?">":")"),vi=xr(v),bi=_r(I)}pi!==void 0&&pi[pn]!==void 0&&(zr=pi[pn]+` Tw -`),pn===0?u.push(zr+Xi(vi,bi,Ne)+Ur):Sr===0?u.push(zr+Ur):Sr===1&&u.push(zr+Xi(vi,bi,Ne)+Ur)}u=Sr===0?u.join(` Tj -T* `):u.join(` Tj -`),u+=` Tj -`;var cr=`BT -/`;return cr+=Bt+" "+yt+` Tf -`,cr+=X(yt*cn)+` TL -`,cr+=ur+` -`,cr+=Te,cr+=u,P(cr+="ET"),k[Bt]=!0,Ae};var Ds=p.__private__.clip=p.clip=function(u){return P(u==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Ds("evenodd")},p.__private__.discardPath=p.discardPath=function(){return P("n"),this};var lr=p.__private__.isValidStyle=function(u){var v=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(u)!==-1&&(v=!0),v};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(u){return lr(u)&&(d=u),this};var Ja=p.__private__.getStyle=p.getStyle=function(u){var v=d;switch(u){case"D":case"S":v="S";break;case"F":v="f";break;case"FD":case"DF":v="B";break;case"f":case"f*":case"B":case"B*":v=u}return v},Ri=p.close=function(){return P("h"),this};p.stroke=function(){return P("S"),this},p.fill=function(u){return Ti("f",u),this},p.fillEvenOdd=function(u){return Ti("f*",u),this},p.fillStroke=function(u){return Ti("B",u),this},p.fillStrokeEvenOdd=function(u){return Ti("B*",u),this};var Ti=function(u,v){_e(v)==="object"?Us(v,u):P(u)},ua=function(u){u===null||q===G&&u===void 0||(u=Ja(u),P(u))};function qs(u,v,I,D,K){var lt=new xi(v||this.boundingBox,I||this.xStep,D||this.yStep,this.gState,K||this.matrix);lt.stream=this.stream;var mt=u+"$$"+this.cloneIndex+++"$$";return Tn(mt,lt),lt}var Us=function(u,v){var I=ke[u.key],D=Ut[I];if(D instanceof $r)P("q"),P(zs(v)),D.gState&&p.setGState(D.gState),P(u.matrix.toString()+" cm"),P("/"+I+" sh"),P("Q");else if(D instanceof xi){var K=new Gt(1,0,0,-1,0,oi());u.matrix&&(K=K.multiply(u.matrix||wr),I=qs.call(D,u.key,u.boundingBox,u.xStep,u.yStep,K).id),P("q"),P("/Pattern cs"),P("/"+I+" scn"),D.gState&&p.setGState(D.gState),P(v),P("Q")}},zs=function(u){switch(u){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Br=p.moveTo=function(u,v){return P(X(z(u))+" "+X(U(v))+" m"),this},Ka=p.lineTo=function(u,v){return P(X(z(u))+" "+X(U(v))+" l"),this},Mr=p.curveTo=function(u,v,I,D,K,lt){return P([X(z(u)),X(U(v)),X(z(I)),X(U(D)),X(z(K)),X(U(lt)),"c"].join(" ")),this};p.__private__.line=p.line=function(u,v,I,D,K){if(isNaN(u)||isNaN(v)||isNaN(I)||isNaN(D)||!lr(K))throw new Error("Invalid arguments passed to jsPDF.line");return q===V?this.lines([[I-u,D-v]],u,v,[1,1],K||"S"):this.lines([[I-u,D-v]],u,v,[1,1]).stroke()},p.__private__.lines=p.lines=function(u,v,I,D,K,lt){var mt,Et,Ft,Xt,te,de,$e,Ne,Ae,Fe,Re,Te;if(typeof u=="number"&&(Te=I,I=v,v=u,u=Te),D=D||[1,1],lt=lt||!1,isNaN(v)||isNaN(I)||!Array.isArray(u)||!Array.isArray(D)||!lr(K)||typeof lt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Br(v,I),mt=D[0],Et=D[1],Xt=u.length,Fe=v,Re=I,Ft=0;Ft>8&255,n>>16&255,n>>24&255)},na.prototype.toHexString=function(n){return n.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},na.prototype.hexToBytes=function(n){for(var e=[],t=0;t>8&255,n>>16&255,255&e,e>>8&255)).substr(0,10);return function(i){return Yo(t,i)}},Ta.prototype.equals=function(n){var e,t="id,objectNumber,equals";if(!n||_e(n)!==_e(this))return!1;var i=0;for(e in this)if(!(t.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!n.hasOwnProperty(e)||this[e]!==n[e])return!1;i++}for(e in n)n.hasOwnProperty(e)&&t.indexOf(e)<0&&i--;return i===0},Mt.API={events:[]},Mt.version="4.2.1";var ze=Mt.API,tl=1,Ci=function(n){return n.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ta=function(n){return n.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Pi=function(n){return n.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return"#"+(t.length===1?"0"+t:t)})},$t=function(n){return n.toFixed(2)},Xr=function(n){return n.toFixed(5)};ze.__acroform__={};var Pn=function(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n},Fu=function(n){return n*tl},pr=function(n){var e=new Ff,t=It.internal.getHeight(n)||0,i=It.internal.getWidth(n)||0;return e.BBox=[0,0,Number($t(i)),Number($t(t))],e},B1=ze.__acroform__.setBit=function(n,e){if(n=n||0,e=e||0,isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return n|1<0;){e="",a--;var d,m,_=Ss("3",n,a).height,k=n.multiline?c-a:(c-_)/2,p=k+=2,j=0,O=0,M=0;if(a<=0){e=`(...) Tj -`,e+="% Width of Text: "+Ss(e,n,a=12).width+", FieldWidth:"+l+` -`;break}for(var S="",V=0,G=0;Gc)continue t;S+=s[G][M],q=!0,O=G,G--}else{S=(S+=s[G][M]+" ").substr(S.length-1)==" "?S.substr(0,S.length-1):S;var it=parseInt(G),vt=h(it,S,a),dt=G>=s.length-1;if(vt&&!dt){S+=" ",M=0;continue}if(vt||dt){if(dt)O=it;else if(n.multiline&&(_+2)*(V+2)+2>c)continue t}else{if(!n.multiline||(_+2)*(V+2)+2>c)continue t;O=it}}for(var X="",R=j;R<=O;R++){var tt=s[R];if(n.multiline){if(R===O){X+=tt[M]+" ",M=(M+1)%tt.length;continue}if(R===j){X+=tt[tt.length-1]+" ";continue}}X+=tt[0]+" "}switch(X=X.substr(X.length-1)==" "?X.substr(0,X.length-1):X,m=Ss(X,n,a).width,n.textAlign){case"right":d=l-m-2;break;case"center":d=(l-m)/2;break;default:d=2}e+=$t(d)+" "+$t(p)+` Td -`,e+="("+Ci(X)+`) Tj -`,e+=-$t(d)+` 0 Td -`,p=-(a+2),m=0,j=q?O:O+1,V++,S=""}break}return i.text=e,i.fontSize=a,i},Ss=function(n,e,t){var i=e.scope.internal.getFont(e.fontName,e.fontStyle),s=e.scope.getStringUnitWidth(n,{font:i,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:e.scope.getStringUnitWidth("3",{font:i,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:s}},q1={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},U1=function(n,e){var t={type:"reference",object:n};e.internal.getPageInfo(n.page).pageContext.annotations.find(function(i){return i.type===t.type&&i.object===t.object})===void 0&&e.internal.getPageInfo(n.page).pageContext.annotations.push(t)},z1=function(n,e){if(e.scope=n,n.internal!==void 0&&(n.internal.acroformPlugin===void 0||n.internal.acroformPlugin.isInitialized===!1)){if(er.FieldNum=0,n.internal.acroformPlugin=JSON.parse(JSON.stringify(q1)),n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");tl=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new Ef,n.internal.acroformPlugin.acroFormDictionaryRoot.scope=n,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(n)}),n.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var i=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];a.objId=void 0,a.hasAnnotation&&U1(a,t)}})(n)}),n.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(n)}),n.internal.events.subscribe("postPutPages",function(t){(function(i,s){var a=!i;for(var c in i||(s.internal.newObjectDeferredBegin(s.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),s.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),i=i||s.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(i.hasOwnProperty(c)){var l=i[c],h=[],d=l.Rect;if(l.Rect&&(l.Rect=T1(l.Rect,s)),s.internal.newObjectDeferredBegin(l.objId,!0),l.DA=It.createDefaultAppearanceStream(l),_e(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(h=l.getKeyValueListForStream()),l.Rect=d,l.hasAppearanceStream&&!l.appearanceStreamContent){var m=D1(l);h.push({key:"AP",value:"<>"}),s.internal.acroformPlugin.xForms.push(m)}if(l.appearanceStreamContent){var _="";for(var k in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(k)){var p=l.appearanceStreamContent[k];if(_+="/"+k+" ",_+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var c in p)if(p.hasOwnProperty(c)){var j=p[c];typeof j=="function"&&(j=j.call(s,l)),_+="/"+c+" "+j+" ",s.internal.acroformPlugin.xForms.indexOf(j)>=0||s.internal.acroformPlugin.xForms.push(j)}}else typeof(j=p)=="function"&&(j=j.call(s,l)),_+="/"+c+" "+j,s.internal.acroformPlugin.xForms.indexOf(j)>=0||s.internal.acroformPlugin.xForms.push(j);_+=">>"}h.push({key:"AP",value:`<< -`+_+">>"})}s.internal.putStream({additionalKeyValues:h,objectId:l.objId}),s.internal.out("endobj")}a&&function(O,M){for(var S in O)if(O.hasOwnProperty(S)){var V=S,G=O[S];M.internal.newObjectDeferredBegin(G.objId,!0),_e(G)==="object"&&typeof G.putStream=="function"&&G.putStream(),delete O[V]}}(s.internal.acroformPlugin.xForms,s)})(t,n)}),n.internal.acroformPlugin.isInitialized=!0}},Cf=ze.__acroform__.arrayToPdfArray=function(n,e,t){var i=function(c){return c};if(Array.isArray(n)){for(var s="[",a=0;a0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(n){var t=function(i){return i};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Ci(t(n))+")"}},set:function(t){n=t}})};Pn(Ef,gr);var er=function n(){gr.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(S){if(isNaN(S))throw new Error('Invalid value "'+S+'" for attribute F supplied.');e=S}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ye(e,3)},set:function(S){S?this.F=Je(e,3):this.F=Ke(e,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(S){if(isNaN(S))throw new Error('Invalid value "'+S+'" for attribute Ff supplied.');t=S}});var i=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(i.length!==0)return i},set:function(S){i=S!==void 0?S:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[0])?0:i[0]},set:function(S){i[0]=S}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[1])?0:i[1]},set:function(S){i[1]=S}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[2])?0:i[2]},set:function(S){i[2]=S}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[3])?0:i[3]},set:function(S){i[3]=S}});var s="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return s},set:function(S){switch(S){case"/Btn":case"/Tx":case"/Ch":case"/Sig":s=S;break;default:throw new Error('Invalid value "'+S+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof Es)return;a="FieldObject"+n.FieldNum++}var S=function(V){return V};return this.scope&&(S=this.scope.internal.getEncryptor(this.objId)),"("+Ci(S(a))+")"},set:function(S){a=S.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(S){a=S}});var c="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return c},set:function(S){c=S}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(S){l=S}});var h=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return h},set:function(S){h=S}});var d=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return d===void 0?50/tl:d},set:function(S){d=S}});var m="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return m},set:function(S){m=S}});var _="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!_||this instanceof Es||this instanceof Qr))return jo(_,this.objId,this.scope)},set:function(S){S=S.toString(),_=S}});var k=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(k)return this instanceof rn==0?jo(k,this.objId,this.scope):k},set:function(S){S=S.toString(),k=this instanceof rn==0?S.substr(0,1)==="("?ta(S.substr(1,S.length-2)):ta(S):S}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof rn==1?ta(k.substr(1,k.length-1)):k},set:function(S){S=S.toString(),k=this instanceof rn==1?"/"+Pi(S):S}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(S){this.V=S}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof rn==0?jo(p,this.objId,this.scope):p},set:function(S){S=S.toString(),p=this instanceof rn==0?S.substr(0,1)==="("?ta(S.substr(1,S.length-2)):ta(S):S}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof rn==1?ta(p.substr(1,p.length-1)):p},set:function(S){S=S.toString(),p=this instanceof rn==1?"/"+Pi(S):S}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var j,O=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return O},set:function(S){S=!!S,O=S}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(j)return j},set:function(S){j=S}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,1)},set:function(S){S?this.Ff=Je(this.Ff,1):this.Ff=Ke(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,2)},set:function(S){S?this.Ff=Je(this.Ff,2):this.Ff=Ke(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,3)},set:function(S){S?this.Ff=Je(this.Ff,3):this.Ff=Ke(this.Ff,3)}});var M=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(M!==null)return M},set:function(S){if([0,1,2].indexOf(S)===-1)throw new Error('Invalid value "'+S+'" for attribute Q supplied.');M=S}}),Object.defineProperty(this,"textAlign",{get:function(){var S;switch(M){case 0:default:S="left";break;case 1:S="center";break;case 2:S="right"}return S},configurable:!0,enumerable:!0,set:function(S){switch(S){case"right":case 2:M=2;break;case"center":case 1:M=1;break;default:M=0}}})};Pn(er,gr);var _i=function(){er.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var n=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return n},set:function(t){n=t}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Cf(e,this.objId,this.scope)},set:function(t){var i,s;s=[],typeof(i=t)=="string"&&(s=function(a,c,l){l||(l=1);for(var h,d=[];h=c.exec(a);)d.push(h[l]);return d}(i,/\((.*?)\)/g)),e=s}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||"").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,i){for(i=i||!1,t=(t=t||"").toString();e.indexOf(t)!==-1&&(e.splice(e.indexOf(t),1),i!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,18)},set:function(t){t?this.Ff=Je(this.Ff,18):this.Ff=Ke(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=Je(this.Ff,19):this.Ff=Ke(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,20)},set:function(t){t?(this.Ff=Je(this.Ff,20),e.sort()):this.Ff=Ke(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,22)},set:function(t){t?this.Ff=Je(this.Ff,22):this.Ff=Ke(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,23)},set:function(t){t?this.Ff=Je(this.Ff,23):this.Ff=Ke(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,27)},set:function(t){t?this.Ff=Je(this.Ff,27):this.Ff=Ke(this.Ff,27)}}),this.hasAppearanceStream=!1};Pn(_i,er);var Ai=function(){_i.call(this),this.fontName="helvetica",this.combo=!1};Pn(Ai,_i);var Ni=function(){Ai.call(this),this.combo=!0};Pn(Ni,Ai);var Ea=function(){Ni.call(this),this.edit=!0};Pn(Ea,Ni);var rn=function(){er.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,15)},set:function(t){t?this.Ff=Je(this.Ff,15):this.Ff=Ke(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,16)},set:function(t){t?this.Ff=Je(this.Ff,16):this.Ff=Ke(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,17)},set:function(t){t?this.Ff=Je(this.Ff,17):this.Ff=Ke(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,26)},set:function(t){t?this.Ff=Je(this.Ff,26):this.Ff=Ke(this.Ff,26)}});var n,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(a){return a};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var i,s=[];for(i in s.push("<<"),e)s.push("/"+i+" ("+Ci(t(e[i]))+")");return s.push(">>"),s.join(` -`)}},set:function(t){_e(t)==="object"&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){typeof t=="string"&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){var i=t==null?"":t.toString();i.substr(0,1)==="/"&&(i=i.substr(1)),n="/"+Pi(i)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+Pi(t)}})};Pn(rn,er);var Oa=function(){rn.call(this),this.pushButton=!0};Pn(Oa,rn);var Li=function(){rn.call(this),this.radio=!0,this.pushButton=!1;var n=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e!==void 0?e:[]}})};Pn(Li,rn);var Es=function(){var n,e;er.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return n},set:function(s){n=s}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(s){e=s}});var t,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var s=function(l){return l};this.scope&&(s=this.scope.internal.getEncryptor(this.objId));var a,c=[];for(a in c.push("<<"),i)c.push("/"+a+" ("+Ci(s(i[a]))+")");return c.push(">>"),c.join(` -`)},set:function(s){_e(s)==="object"&&(i=s)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(s){typeof s=="string"&&(i.CA=s)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(s){var a=s==null?"":s.toString();a.substr(0,1)==="/"&&(a=a.substr(1)),t="/"+Pi(a)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(s){var a=s==null?"":s.toString();a.substr(0,1)==="/"&&(a=a.substr(1)),t="/"+Pi(a)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=It.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Pn(Es,er),Li.prototype.setAppearance=function(n){if(!("createAppearanceStream"in n)||!("getCA"in n))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var t=this.Kids[e];t.appearanceStreamContent=n.createAppearanceStream(t.optionName),t.caption=n.getCA()}},Li.prototype.createOption=function(n){var e=new Es;return e.Parent=this,e.optionName=n,this.Kids.push(e),H1.call(this.scope,e),e};var ja=function(){rn.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=It.CheckBox.createAppearanceStream()};Pn(ja,rn);var Qr=function(){er.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,13)},set:function(e){e?this.Ff=Je(this.Ff,13):this.Ff=Ke(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,21)},set:function(e){e?this.Ff=Je(this.Ff,21):this.Ff=Ke(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,23)},set:function(e){e?this.Ff=Je(this.Ff,23):this.Ff=Ke(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,24)},set:function(e){e?this.Ff=Je(this.Ff,24):this.Ff=Ke(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,25)},set:function(e){e?this.Ff=Je(this.Ff,25):this.Ff=Ke(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,26)},set:function(e){e?this.Ff=Je(this.Ff,26):this.Ff=Ke(this.Ff,26)}});var n=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return n},set:function(e){Number.isInteger(e)&&(n=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Pn(Qr,er);var Ba=function(){Qr.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ye(this.Ff,14)},set:function(n){n?this.Ff=Je(this.Ff,14):this.Ff=Ke(this.Ff,14)}}),this.password=!0};Pn(Ba,Qr);var It={CheckBox:{createAppearanceStream:function(){return{N:{On:It.CheckBox.YesNormal},D:{On:It.CheckBox.YesPushDown,Off:It.CheckBox.OffPushDown}}},YesPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=[],i=n.scope.internal.getFont(n.fontName,n.fontStyle).id,s=n.scope.__private__.encodeColorString(n.color),a=Jo(n,n.caption);return t.push("0.749023 g"),t.push("0 0 "+$t(It.internal.getWidth(n))+" "+$t(It.internal.getHeight(n))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+i+" "+$t(a.fontSize)+" Tf "+s),t.push("BT"),t.push(a.text),t.push("ET"),t.push("Q"),t.push("EMC"),e.stream=t.join(` -`),e},YesNormal:function(n){var e=pr(n);e.scope=n.scope;var t=n.scope.internal.getFont(n.fontName,n.fontStyle).id,i=n.scope.__private__.encodeColorString(n.color),s=[],a=It.internal.getHeight(n),c=It.internal.getWidth(n),l=Jo(n,n.caption);return s.push("1 g"),s.push("0 0 "+$t(c)+" "+$t(a)+" re"),s.push("f"),s.push("q"),s.push("0 0 1 rg"),s.push("0 0 "+$t(c-1)+" "+$t(a-1)+" re"),s.push("W"),s.push("n"),s.push("0 g"),s.push("BT"),s.push("/"+t+" "+$t(l.fontSize)+" Tf "+i),s.push(l.text),s.push("ET"),s.push("Q"),e.stream=s.join(` -`),e},OffPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+$t(It.internal.getWidth(n))+" "+$t(It.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(` -`),e}},RadioButton:{Circle:{createAppearanceStream:function(n){var e={D:{Off:It.RadioButton.Circle.OffPushDown},N:{}};return e.N[n]=It.RadioButton.Circle.YesNormal,e.D[n]=It.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(n){var e=pr(n);e.scope=n.scope;var t=[],i=It.internal.getWidth(n)<=It.internal.getHeight(n)?It.internal.getWidth(n)/4:It.internal.getHeight(n)/4;i=Number((.9*i).toFixed(5));var s=It.internal.Bezier_C,a=Number((i*s).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+Xr(It.internal.getWidth(n)/2)+" "+Xr(It.internal.getHeight(n)/2)+" cm"),t.push(i+" 0 m"),t.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),t.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),t.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),t.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` -`),e},YesPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=[],i=It.internal.getWidth(n)<=It.internal.getHeight(n)?It.internal.getWidth(n)/4:It.internal.getHeight(n)/4;i=Number((.9*i).toFixed(5));var s=Number((2*i).toFixed(5)),a=Number((s*It.internal.Bezier_C).toFixed(5)),c=Number((i*It.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+Xr(It.internal.getWidth(n)/2)+" "+Xr(It.internal.getHeight(n)/2)+" cm"),t.push(s+" 0 m"),t.push(s+" "+a+" "+a+" "+s+" 0 "+s+" c"),t.push("-"+a+" "+s+" -"+s+" "+a+" -"+s+" 0 c"),t.push("-"+s+" -"+a+" -"+a+" -"+s+" 0 -"+s+" c"),t.push(a+" -"+s+" "+s+" -"+a+" "+s+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+Xr(It.internal.getWidth(n)/2)+" "+Xr(It.internal.getHeight(n)/2)+" cm"),t.push(i+" 0 m"),t.push(i+" "+c+" "+c+" "+i+" 0 "+i+" c"),t.push("-"+c+" "+i+" -"+i+" "+c+" -"+i+" 0 c"),t.push("-"+i+" -"+c+" -"+c+" -"+i+" 0 -"+i+" c"),t.push(c+" -"+i+" "+i+" -"+c+" "+i+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` -`),e},OffPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=[],i=It.internal.getWidth(n)<=It.internal.getHeight(n)?It.internal.getWidth(n)/4:It.internal.getHeight(n)/4;i=Number((.9*i).toFixed(5));var s=Number((2*i).toFixed(5)),a=Number((s*It.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+Xr(It.internal.getWidth(n)/2)+" "+Xr(It.internal.getHeight(n)/2)+" cm"),t.push(s+" 0 m"),t.push(s+" "+a+" "+a+" "+s+" 0 "+s+" c"),t.push("-"+a+" "+s+" -"+s+" "+a+" -"+s+" 0 c"),t.push("-"+s+" -"+a+" -"+a+" -"+s+" 0 -"+s+" c"),t.push(a+" -"+s+" "+s+" -"+a+" "+s+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` -`),e}},Cross:{createAppearanceStream:function(n){var e={D:{Off:It.RadioButton.Cross.OffPushDown},N:{}};return e.N[n]=It.RadioButton.Cross.YesNormal,e.D[n]=It.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(n){var e=pr(n);e.scope=n.scope;var t=[],i=It.internal.calculateCross(n);return t.push("q"),t.push("1 1 "+$t(It.internal.getWidth(n)-2)+" "+$t(It.internal.getHeight(n)-2)+" re"),t.push("W"),t.push("n"),t.push($t(i.x1.x)+" "+$t(i.x1.y)+" m"),t.push($t(i.x2.x)+" "+$t(i.x2.y)+" l"),t.push($t(i.x4.x)+" "+$t(i.x4.y)+" m"),t.push($t(i.x3.x)+" "+$t(i.x3.y)+" l"),t.push("s"),t.push("Q"),e.stream=t.join(` -`),e},YesPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=It.internal.calculateCross(n),i=[];return i.push("0.749023 g"),i.push("0 0 "+$t(It.internal.getWidth(n))+" "+$t(It.internal.getHeight(n))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+$t(It.internal.getWidth(n)-2)+" "+$t(It.internal.getHeight(n)-2)+" re"),i.push("W"),i.push("n"),i.push($t(t.x1.x)+" "+$t(t.x1.y)+" m"),i.push($t(t.x2.x)+" "+$t(t.x2.y)+" l"),i.push($t(t.x4.x)+" "+$t(t.x4.y)+" m"),i.push($t(t.x3.x)+" "+$t(t.x3.y)+" l"),i.push("s"),i.push("Q"),e.stream=i.join(` -`),e},OffPushDown:function(n){var e=pr(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+$t(It.internal.getWidth(n))+" "+$t(It.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(` -`),e}}},createDefaultAppearanceStream:function(n){var e=n.scope.internal.getFont(n.fontName,n.fontStyle).id,t=n.scope.__private__.encodeColorString(n.color);return"/"+e+" "+n.fontSize+" Tf "+t}};It.internal={Bezier_C:.551915024494,calculateCross:function(n){var e=It.internal.getWidth(n),t=It.internal.getHeight(n),i=Math.min(e,t);return{x1:{x:(e-i)/2,y:(t-i)/2+i},x2:{x:(e-i)/2+i,y:(t-i)/2},x3:{x:(e-i)/2,y:(t-i)/2},x4:{x:(e-i)/2+i,y:(t-i)/2+i}}}},It.internal.getWidth=function(n){var e=0;return _e(n)==="object"&&(e=Fu(n.Rect[2])),e},It.internal.getHeight=function(n){var e=0;return _e(n)==="object"&&(e=Fu(n.Rect[3])),e};var H1=ze.addField=function(n){if(z1(this,n),!(n instanceof er))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=n).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),n.page=n.scope.internal.getCurrentPageInfo().pageNumber,this};ze.AcroFormChoiceField=_i,ze.AcroFormListBox=Ai,ze.AcroFormComboBox=Ni,ze.AcroFormEditBox=Ea,ze.AcroFormButton=rn,ze.AcroFormPushButton=Oa,ze.AcroFormRadioButton=Li,ze.AcroFormCheckBox=ja,ze.AcroFormTextField=Qr,ze.AcroFormPasswordField=Ba,ze.AcroFormAppearance=It,ze.AcroForm={ChoiceField:_i,ListBox:Ai,ComboBox:Ni,EditBox:Ea,Button:rn,PushButton:Oa,RadioButton:Li,CheckBox:ja,TextField:Qr,PasswordField:Ba,Appearance:It},Mt.AcroForm={ChoiceField:_i,ListBox:Ai,ComboBox:Ni,EditBox:Ea,Button:rn,PushButton:Oa,RadioButton:Li,CheckBox:ja,TextField:Qr,PasswordField:Ba,Appearance:It};var W1=Mt.AcroForm;function Of(n){return n.reduce(function(e,t,i){return e[t]=i,e},{})}(function(n){var e="addImage_";n.__addimage__={};var t="UNKNOWN",i={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},s=n.__addimage__.getImageFileTypeByImageData=function(N,E){var z,U,rt,ot,ft,nt=t;if((E=E||t)==="RGBA"||N.data!==void 0&&N.data instanceof Uint8ClampedArray&&"height"in N&&"width"in N)return"RGBA";if(vt(N))for(ft in i)for(rt=i[ft],z=0;z>"}),"transparency"in E&&Array.isArray(E.transparency)&&E.transparency.length>0){for(var ft="",nt=0,ct=E.transparency.length;nt>",O.content=a;var G=O.objId+" 0 R";a="<>";else if(i.options.pageNumber)switch(a="<=0};n.__arabicParser__.arabicLetterHasIsolatedForm=function(O){return c(O)&&a(O)&&e[O.charCodeAt(0)].length>=1};var d=n.__arabicParser__.arabicLetterHasFinalForm=function(O){return c(O)&&a(O)&&e[O.charCodeAt(0)].length>=2};n.__arabicParser__.arabicLetterHasInitialForm=function(O){return c(O)&&a(O)&&e[O.charCodeAt(0)].length>=3};var m=n.__arabicParser__.arabicLetterHasMedialForm=function(O){return c(O)&&a(O)&&e[O.charCodeAt(0)].length==4},_=n.__arabicParser__.resolveLigatures=function(O){var M=0,S=t,V="",G=0;for(M=0;M>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},function(n){var e=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(l){t=l}});var i=150;Object.defineProperty(this,"width",{get:function(){return i},set:function(l){i=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=i+1)}});var s=300;Object.defineProperty(this,"height",{get:function(){return s},set:function(l){s=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=s+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(l){a=l}});var c={};Object.defineProperty(this,"style",{get:function(){return c},set:function(l){c=l}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(t,i){var s;if((t=t||"2d")!=="2d")return null;for(s in i)this.pdf.context2d.hasOwnProperty(s)&&(this.pdf.context2d[s]=i[s]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},n.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(Mt.API),function(n){var e={left:0,top:0,bottom:0,right:0},t=!1,i=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),s.call(this))},s=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var h=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return h},set:function(O){h=O}});var d=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return d},set:function(O){d=O}});var m=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return m},set:function(O){m=O}});var _=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return _},set:function(O){_=O}});var k=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return k},set:function(O){k=O}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(O){p=O}});var j=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return j},set:function(O){j=O}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},n.setHeaderFunction=function(h){return i.call(this),this.internal.__cell__.headerFunction=typeof h=="function"?h:void 0,this},n.getTextDimensions=function(h,d){i.call(this);var m=(d=d||{}).fontSize||this.getFontSize(),_=d.font||this.getFont(),k=d.scaleFactor||this.internal.scaleFactor,p=0,j=0,O=0,M=this;if(!Array.isArray(h)&&typeof h!="string"){if(typeof h!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");h=String(h)}var S=d.maxWidth;S>0?typeof h=="string"?h=this.splitTextToSize(h,S):Object.prototype.toString.call(h)==="[object Array]"&&(h=h.reduce(function(G,q){return G.concat(M.splitTextToSize(q,S))},[])):h=Array.isArray(h)?h:[h];for(var V=0;Vthis.getPageHeight()?(this.cellAddPage(),h.y=_.top,p&&k&&(this.printHeaderRow(h.lineNumber,!0),h.y+=k[0].height)):h.y=d.y+d.height||h.y),h.text[0]!==void 0&&(this.rect(h.x,h.y,h.width,h.height,t===!0?"FD":void 0),h.align==="right"?this.text(h.text,h.x+h.width-m,h.y+m,{align:"right",baseline:"top"}):h.align==="center"?this.text(h.text,h.x+h.width/2,h.y+m,{align:"center",baseline:"top",maxWidth:h.width-m-m}):this.text(h.text,h.x+m,h.y+m,{align:"left",baseline:"top",maxWidth:h.width-m-m})),this.internal.__cell__.lastCell=h,this};n.table=function(h,d,m,_,k){if(i.call(this),!m)throw new Error("No data for PDF table.");var p,j,O,M,S=[],V=[],G=[],q={},it={},vt=[],dt=[],X=(k=k||{}).autoSize||!1,R=k.printHeaders!==!1,tt=k.css&&k.css["font-size"]!==void 0?16*k.css["font-size"]:k.fontSize||12,N=k.margins||Object.assign({width:this.getPageWidth()},e),E=typeof k.padding=="number"?k.padding:3,z=k.headerBackgroundColor||"#c8c8c8",U=k.headerTextColor||"#000";if(s.call(this),this.internal.__cell__.printHeaders=R,this.internal.__cell__.margins=N,this.internal.__cell__.table_font_size=tt,this.internal.__cell__.padding=E,this.internal.__cell__.headerBackgroundColor=z,this.internal.__cell__.headerTextColor=U,this.setFontSize(tt),_==null)V=S=Object.keys(m[0]),G=S.map(function(){return"left"});else if(Array.isArray(_)&&_e(_[0])==="object")for(S=_.map(function(At){return At.name}),V=_.map(function(At){return At.prompt||At.name||""}),G=_.map(function(At){return At.align||"left"}),p=0;p<_.length;p+=1)it[_[p].name]=.7499990551181103*_[p].width;else Array.isArray(_)&&typeof _[0]=="string"&&(V=S=_,G=S.map(function(){return"left"}));if(X||Array.isArray(_)&&typeof _[0]=="string")for(p=0;p0&&this.setTableHeaderRow(k),this.setFont(void 0,"normal"),t=!1}}(Mt.API);var jf={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Bf=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Ko=Of(Bf),Mf=[100,200,300,400,500,600,700,800,900],V1=Of(Mf);function Bo(n){var e=n.family.replace(/"|'/g,"").toLowerCase(),t=function(a){return jf[a=a||"normal"]?a:"normal"}(n.style),i=function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400}(n.weight),s=function(a){return typeof Ko[a=a||"normal"]=="number"?a:"normal"}(n.stretch);return{family:e,style:t,weight:i,stretch:s,src:n.src||[],ref:n.ref||{name:e,style:[s,t,i].join(" ")}}}function Eu(n,e,t,i){var s;for(s=t;s>=0&&s=0&&s>>1)&255}return s}function Hu(n,e,t){var i=n.length,s=[];s[0]=4;for(var a=0;a>a&c}function Wu(n,e,t,i){var s=t*i,a=Math.floor(s/8),c=16-(s-8*a+i),l=(1<>8&255;d.setUint8(m,k)}})(n,a,Rf(n,a)&~(l<>7,c=1<<1+(7&s);n[e++],n[e++];var l=null,h=null;a&&(l=e,h=c,e+=3*c);var d=!0,m=[],_=0,k=null,p=0,j=null;for(this.width=t,this.height=i;d&&e=0))throw Error("Invalid block size");if(N===0)break;e+=N}break;case 249:if(n[e++]!==4||n[e+4]!==0)throw new Error("Invalid graphics extension block.");var O=n[e++];_=n[e++]|n[e++]<<8,k=n[e++],1&O||(k=null),p=O>>2&7,e++;break;case 254:for(;;){if(!((N=n[e++])>=0))throw Error("Invalid block size");if(N===0)break;e+=N}break;default:throw new Error("Unknown graphic control label: 0x"+n[e-1].toString(16))}break;case 44:var M=n[e++]|n[e++]<<8,S=n[e++]|n[e++]<<8,V=n[e++]|n[e++]<<8,G=n[e++]|n[e++]<<8,q=n[e++],it=q>>6&1,vt=1<<1+(7&q),dt=l,X=h,R=!1;q>>7&&(R=!0,dt=e,X=vt,e+=3*vt);var tt=e;for(e++;;){var N;if(!((N=n[e++])>=0))throw Error("Invalid block size");if(N===0)break;e+=N}m.push({x:M,y:S,width:V,height:G,has_local_palette:R,palette_offset:dt,palette_size:X,data_offset:tt,data_length:e-tt,transparent_index:k,interlaced:!!it,delay:_,disposal:p});break;case 59:d=!1;break;default:throw new Error("Unknown gif block: 0x"+n[e-1].toString(16))}this.numFrames=function(){return m.length},this.loopCount=function(){return j},this.frameInfo=function(E){if(E<0||E>=m.length)throw new Error("Frame index out of range.");return m[E]},this.decodeAndBlitFrameBGRA=function(E,z){var U=this.frameInfo(E),rt=U.width*U.height;if(rt>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var ot=new Uint8Array(rt);Vu(n,U.data_offset,ot,rt);var ft=U.palette_offset,nt=U.transparent_index;nt===null&&(nt=256);var ct=U.width,At=t-ct,wt=ct,x=4*(U.y*t+U.x),B=4*((U.y+U.height)*t+U.x),T=x,H=4*At;U.interlaced===!0&&(H+=4*t*7);for(var J=8,Z=0,at=ot.length;Z=B&&(H=4*At+4*t*(J-1),T=x+(ct+At)*(J<<1),J>>=1)),st===nt)T+=4;else{var gt=n[ft+3*st],_t=n[ft+3*st+1],kt=n[ft+3*st+2];z[T++]=kt,z[T++]=_t,z[T++]=gt,z[T++]=255}--wt}},this.decodeAndBlitFrameRGBA=function(E,z){var U=this.frameInfo(E),rt=U.width*U.height;if(rt>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var ot=new Uint8Array(rt);Vu(n,U.data_offset,ot,rt);var ft=U.palette_offset,nt=U.transparent_index;nt===null&&(nt=256);var ct=U.width,At=t-ct,wt=ct,x=4*(U.y*t+U.x),B=4*((U.y+U.height)*t+U.x),T=x,H=4*At;U.interlaced===!0&&(H+=4*t*7);for(var J=8,Z=0,at=ot.length;Z=B&&(H=4*At+4*t*(J-1),T=x+(ct+At)*(J<<1),J>>=1)),st===nt)T+=4;else{var gt=n[ft+3*st],_t=n[ft+3*st+1],kt=n[ft+3*st+2];z[T++]=gt,z[T++]=_t,z[T++]=kt,z[T++]=255}--wt}}}function Vu(n,e,t,i){for(var s=n[e++],a=1<>=h,m-=h,M!==a){if(M===c)break;for(var S=Ma;)G=j[G]>>8,++V;var q=G;if(k+V+(S!==M?1:0)>i)return void Se.log("Warning, gif stream longer than expected.");t[k++]=q;var it=k+=V;for(S!==M&&(t[k++]=q),G=S;V--;)G=j[G],t[--it]=255&G,G>>=8;O!==null&&l<4096&&(j[l++]=O<<8|q,l>=d+1&&h<12&&(++h,d=d<<1|1)),O=M}else l=c+1,d=(1<<(h=s+1))-1,O=null}return k!==i&&Se.log("Warning, gif stream shorter than expected."),t}/** - * @license - Copyright (c) 2008, Adobe Systems Incorporated - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Adobe Systems Incorporated nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/function To(n){var e,t,i,s,a,c=Math.floor,l=new Array(64),h=new Array(64),d=new Array(64),m=new Array(64),_=new Array(65535),k=new Array(65535),p=new Array(64),j=new Array(64),O=[],M=0,S=7,V=new Array(64),G=new Array(64),q=new Array(64),it=new Array(256),vt=new Array(2048),dt=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],X=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],tt=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],E=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],rt=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function ot(x,B){for(var T=0,H=0,J=new Array,Z=1;Z<=16;Z++){for(var at=1;at<=x[Z];at++)J[B[H]]=[],J[B[H]][0]=T,J[B[H]][1]=Z,H++,T++;T*=2}return J}function ft(x){for(var B=x[0],T=x[1]-1;T>=0;)B&1<>8&255),nt(255&x)}function At(x,B,T,H,J){for(var Z,at=J[0],st=J[240],gt=function(yt,Wt){var Ct,zt,qt,ve,ue,Zt,he,fe,Bt,ne,Tt=0;for(Bt=0;Bt<8;++Bt){Ct=yt[Tt],zt=yt[Tt+1],qt=yt[Tt+2],ve=yt[Tt+3],ue=yt[Tt+4],Zt=yt[Tt+5],he=yt[Tt+6];var He=Ct+(fe=yt[Tt+7]),ge=Ct-fe,se=zt+he,oe=zt-he,je=qt+Zt,Ut=qt-Zt,ke=ve+ue,Yt=ve-ue,Qt=He+ke,Be=He-ke,le=se+je,Vt=se-je;yt[Tt]=Qt+le,yt[Tt+4]=Qt-le;var be=.707106781*(Vt+Be);yt[Tt+2]=Be+be,yt[Tt+6]=Be-be;var ei=.382683433*((Qt=Yt+Ut)-(Vt=oe+ge)),hn=.5411961*Qt+ei,vr=1.306562965*Vt+ei,rr=.707106781*(le=Ut+oe),Gt=ge+rr,br=ge-rr;yt[Tt+5]=br+hn,yt[Tt+3]=br-hn,yt[Tt+1]=Gt+vr,yt[Tt+7]=Gt-vr,Tt+=8}for(Tt=0,Bt=0;Bt<8;++Bt){Ct=yt[Tt],zt=yt[Tt+8],qt=yt[Tt+16],ve=yt[Tt+24],ue=yt[Tt+32],Zt=yt[Tt+40],he=yt[Tt+48];var wr=Ct+(fe=yt[Tt+56]),Tn=Ct-fe,Dn=zt+he,De=zt-he,an=qt+Zt,sn=qt-Zt,ni=ve+ue,jr=ve-ue,Gn=wr+ni,ir=wr-ni,Yn=Dn+an,Jn=Dn-an;yt[Tt]=Gn+Yn,yt[Tt+32]=Gn-Yn;var qn=.707106781*(Jn+ir);yt[Tt+16]=ir+qn,yt[Tt+48]=ir-qn;var ri=.382683433*((Gn=jr+sn)-(Jn=De+Tn)),ar=.5411961*Gn+ri,ii=1.306562965*Jn+ri,Fi=.707106781*(Yn=sn+De),Ei=Tn+Fi,Oi=Tn-Fi;yt[Tt+40]=Oi+ar,yt[Tt+24]=Oi-ar,yt[Tt+8]=Ei+ii,yt[Tt+56]=Ei-ii,Tt++}for(Bt=0;Bt<64;++Bt)ne=yt[Bt]*Wt[Bt],p[Bt]=ne>0?ne+.5|0:ne-.5|0;return p}(x,B),_t=0;_t<64;++_t)j[dt[_t]]=gt[_t];var kt=j[0]-T;T=j[0],kt==0?ft(H[0]):(ft(H[k[Z=32767+kt]]),ft(_[Z]));for(var St=63;St>0&&j[St]==0;)St--;if(St==0)return ft(at),T;for(var Dt,P=1;P<=St;){for(var Lt=P;j[P]==0&&P<=St;)++P;var ae=P-Lt;if(ae>=16){Dt=ae>>4;for(var Ht=1;Ht<=Dt;++Ht)ft(st);ae&=15}Z=32767+j[P],ft(J[(ae<<4)+k[Z]]),ft(_[Z]),P++}return St!=63&&ft(at),T}function wt(x){x=Math.min(Math.max(x,1),100),a!=x&&(function(B){for(var T=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],H=0;H<64;H++){var J=c((T[H]*B+50)/100);J=Math.min(Math.max(J,1),255),l[dt[H]]=J}for(var Z=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],at=0;at<64;at++){var st=c((Z[at]*B+50)/100);st=Math.min(Math.max(st,1),255),h[dt[at]]=st}for(var gt=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],_t=0,kt=0;kt<8;kt++)for(var St=0;St<8;St++)d[_t]=1/(l[dt[_t]]*gt[kt]*gt[St]*8),m[_t]=1/(h[dt[_t]]*gt[kt]*gt[St]*8),_t++}(x<50?Math.floor(5e3/x):Math.floor(200-2*x)),a=x)}this.encode=function(x,B){B&&wt(B),O=new Array,M=0,S=7,ct(65496),ct(65504),ct(16),nt(74),nt(70),nt(73),nt(70),nt(0),nt(1),nt(1),nt(0),ct(1),ct(1),nt(0),nt(0),function(){ct(65499),ct(132),nt(0);for(var zt=0;zt<64;zt++)nt(l[zt]);nt(1);for(var qt=0;qt<64;qt++)nt(h[qt])}(),function(zt,qt){ct(65472),ct(17),nt(8),ct(qt),ct(zt),nt(3),nt(1),nt(17),nt(0),nt(2),nt(17),nt(1),nt(3),nt(17),nt(1)}(x.width,x.height),function(){ct(65476),ct(418),nt(0);for(var zt=0;zt<16;zt++)nt(X[zt+1]);for(var qt=0;qt<=11;qt++)nt(R[qt]);nt(16);for(var ve=0;ve<16;ve++)nt(tt[ve+1]);for(var ue=0;ue<=161;ue++)nt(N[ue]);nt(1);for(var Zt=0;Zt<16;Zt++)nt(E[Zt+1]);for(var he=0;he<=11;he++)nt(z[he]);nt(17);for(var fe=0;fe<16;fe++)nt(U[fe+1]);for(var Bt=0;Bt<=161;Bt++)nt(rt[Bt])}(),ct(65498),ct(12),nt(3),nt(1),nt(0),nt(2),nt(17),nt(3),nt(17),nt(0),nt(63),nt(0);var T=0,H=0,J=0;M=0,S=7,this.encode.displayName="_encode_";for(var Z,at,st,gt,_t,kt,St,Dt,P,Lt=x.data,ae=x.width,Ht=x.height,yt=4*ae,Wt=0;Wt>3)*yt+(St=4*(7&P)),Wt+Dt>=Ht&&(kt-=yt*(Wt+1+Dt-Ht)),Z+St>=yt&&(kt-=Z+St-yt+4),at=Lt[kt++],st=Lt[kt++],gt=Lt[kt++],V[P]=(vt[at]+vt[st+256|0]+vt[gt+512|0]>>16)-128,G[P]=(vt[at+768|0]+vt[st+1024|0]+vt[gt+1280|0]>>16)-128,q[P]=(vt[at+1280|0]+vt[st+1536|0]+vt[gt+1792|0]>>16)-128;T=At(V,d,T,e,i),H=At(G,m,H,t,s),J=At(q,m,J,t,s),Z+=32}Wt+=8}if(S>=0){var Ct=[];Ct[1]=S+1,Ct[0]=(1<E;E++)if(R[tt+E]!=N.charCodeAt(E))return!0;return!1}function i(R,tt,N,E,z){for(var U=0;UU+1?[]:new tt),!(rt.length>>0;r&f;)f>>>=1;return f?(r&f-1)+f:r}function N(r,o,f,g,b){e(!(g%f));do r[o+(g-=f)]=b;while(0=b),512>=b)var w=a(512);else if((w=a(b))==null)return 0;return function(y,A,L,C,W,et){var F,Y,$=A,ut=1<F;++F){if(Q[F]>1<(re-=Q[F]))return 0;for(;0=F;++F,W<<=1){if(Pt+=re<<=1,0>(re-=Q[F]))return 0;for(;0xt&&!(0>=(pt-=Q[xt]));)++xt,pt<<=1;ut+=Ot=1<<(pt=xt-L),y[A+(xt=Rt&bt)].g=pt+L,y[A+xt].value=$-A-xt}C.g=F-L,C.value=et[Y++],N(y,$+(Rt>>L),W,Ot,C),Rt=tt(Rt,F)}}return Pt!=2*ht[15]-1?0:ut}(r,o,f,g,b,w)}function z(){this.value=this.g=0}function U(){this.value=this.g=0}function rt(){this.G=c(5,z),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=c(Gi,U)}function ot(r,o,f,g){e(r!=null),e(o!=null),e(2147483648>g),r.Ca=254,r.I=0,r.b=-8,r.Ka=0,r.oa=o,r.pa=f,r.Jd=o,r.Yc=f+g,r.Zc=4<=g?f+g-4+1:f,at(r)}function ft(r,o){for(var f=0;0g),r.Sb=g,r.Ra=0,r.u=0,r.h=0,4>>=8,r.Ra+=r.oa[r.pa+r.bb]<>>0,++r.bb,r.u-=8;H(r)&&(r.h=1,r.u=0)}function wt(r,o){if(e(0<=o),!r.h&&o<=ba){var f=T(r)&pi[o];return r.u+=o,At(r),f}return r.h=1,r.u=0}function x(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function B(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function T(r){return r.Ra>>>(r.u&xn-1)>>>0}function H(r){return e(r.bb<=r.Sb),r.h||r.bb==r.Sb&&r.u>xn}function J(r,o){r.u=o,r.h=H(r)}function Z(r){r.u>=Ln&&(e(r.u>=Ln),At(r))}function at(r){e(r!=null&&r.oa!=null),r.pa>>0,r.b+=8):(e(r!=null&&r.oa!=null),r.par.b&&at(r);var g=r.b,b=f*o>>>8,w=(r.I>>>g>b)+0;for(w?(f-=b,r.I-=b+1<>>0):f=b+1,g=f,b=0;256<=g;)b+=8,g>>=8;return g=7^b+Yi[g],r.b-=g,r.Ca=(f<>24&255,r[o+1]=f>>16&255,r[o+2]=f>>8&255,r[o+3]=255&f}function kt(r,o){return r[o+0]|r[o+1]<<8}function St(r,o){return kt(r,o)|r[o+2]<<16}function Dt(r,o){return kt(r,o)|kt(r,o+2)<<16}function P(r,o){var f=1<=b||0>=w?0:(f[0]=b,g[0]=w,1)}function yt(r,o){return r+(1<>>o}function Wt(r,o){return((4278255360&r)+(4278255360&o)>>>0&4278255360)+((16711935&r)+(16711935&o)>>>0&16711935)>>>0}function Ct(r,o){R[o]=function(f,g,b,w,y,A,L){var C;for(C=0;C>>1)+(r&o)>>>0}function ve(r){return 0<=r&&256>r?r:0>r?0:255>1))}function Zt(r,o,f){return Math.abs(o-f)-Math.abs(r-f)}function he(r,o,f,g,b,w,y){for(g=w[y-1],f=0;f>8&255,L=16711935&(L=(L=16711935&y)+((A<<16)+A));g[b+w]=(4278255360&y)+L>>>0}}function Bt(r,o){o.jd=255&r,o.hd=r>>8&255,o.ud=r>>16&255}function ne(r,o,f,g,b,w){var y;for(y=0;y>>8,C=A,W=255&(W=(W=A>>>16)+((r.jd<<24>>24)*(L<<24>>24)>>>5));C=255&(C=(C+=(r.hd<<24>>24)*(L<<24>>24)>>>5)+((r.ud<<24>>24)*(W<<24>>24)>>>5)),b[w+y]=(4278255360&A)+(W<<16)+C}}function Tt(r,o,f,g,b){R[o]=function(w,y,A,L,C,W,et,F,Y){for(L=et;L>w.b,Y=w.Ea,$=w.K[0],ut=w.w;if(8>F)for(w=(1<>=F}else R["VP8LMapColor"+f](L,C,$,ut,W,et,y,A,Y)}}function He(r,o,f,g,b){for(f=o+f;o>16&255,g[b++]=w>>8&255,g[b++]=255&w}}function ge(r,o,f,g,b){for(f=o+f;o>16&255,g[b++]=w>>8&255,g[b++]=255&w,g[b++]=w>>24&255}}function se(r,o,f,g,b){for(f=o+f;o>16&240|y>>12&15,y=240&y|y>>28&15;g[b++]=w,g[b++]=y}}function oe(r,o,f,g,b){for(f=o+f;o>16&248|y>>13&7,y=y>>5&224|y>>3&31;g[b++]=w,g[b++]=y}}function je(r,o,f,g,b){for(f=o+f;o>8&255,g[b++]=w>>16&255}}function Ut(r,o,f,g,b,w){if(w==0)for(f=o+f;o>24|w[1]>>8&65280|w[2]<<8&16711680|w[3]<<24)>>>0),b+=32;else i(g,b,r,o,f)}function ke(r,o){R[o][0]=R[r+"0"],R[o][1]=R[r+"1"],R[o][2]=R[r+"2"],R[o][3]=R[r+"3"],R[o][4]=R[r+"4"],R[o][5]=R[r+"5"],R[o][6]=R[r+"6"],R[o][7]=R[r+"7"],R[o][8]=R[r+"8"],R[o][9]=R[r+"9"],R[o][10]=R[r+"10"],R[o][11]=R[r+"11"],R[o][12]=R[r+"12"],R[o][13]=R[r+"13"],R[o][14]=R[r+"0"],R[o][15]=R[r+"0"]}function Yt(r){return r==no||r==ro||r==us||r==io}function Qt(){this.eb=[],this.size=this.A=this.fb=0}function Be(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function le(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Qt,this.f.kb=new Be,this.sd=null}function Vt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function be(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ei(r){return alert("todo:WebPSamplerProcessPlane"),r.T}function hn(r,o){var f=r.T,g=o.ba.f.RGBA,b=g.eb,w=g.fb+r.ka*g.A,y=Wn[o.ba.S],A=r.y,L=r.O,C=r.f,W=r.N,et=r.ea,F=r.W,Y=o.cc,$=o.dc,ut=o.Mc,Q=o.Nc,ht=r.ka,pt=r.ka+r.T,xt=r.U,bt=xt+1>>1;for(ht==0?y(A,L,null,null,C,W,et,F,C,W,et,F,b,w,null,null,xt):(y(o.ec,o.fc,A,L,Y,$,ut,Q,C,W,et,F,b,w-g.A,b,w,xt),++f);ht+2f,b=f==ss||f==os||f==ls||f==eo||f==12||Yt(f);if(o.memory=null,o.Ib=null,o.Jb=null,o.Nd=null,!zn(o.Oa,r,b?11:12))return 0;if(b&&Yt(f)&&Lr(),r.da)alert("todo:use_scaling");else{if(g){if(o.Ib=ei,r.Kb){if(f=r.U+1>>1,o.memory=a(r.U+2*f),o.memory==null)return 0;o.ec=o.memory,o.fc=0,o.cc=o.ec,o.dc=o.fc+r.U,o.Mc=o.cc,o.Nc=o.dc+f,o.Ib=hn,Lr()}}else alert("todo:EmitYUV");b&&(o.Jb=vr,g&&Te())}if(g&&!_l){for(r=0;256>r;++r)ih[r]=89858*(r-128)+hs>>fs,oh[r]=-22014*(r-128)+hs,sh[r]=-45773*(r-128),ah[r]=113618*(r-128)+hs>>fs;for(r=Na;r>fs,lh[r-Na]=sr(o,255),uh[r-Na]=sr(o+8>>4,15);_l=1}return 1}function Gt(r){var o=r.ma,f=r.U,g=r.T;return e(!(1&r.ka)),0>=f||0>=g?0:(f=o.Ib(r,o),o.Jb!=null&&o.Jb(r,o,f),o.Dc+=f,1)}function br(r){r.ma.memory=null}function wr(r,o,f,g){return wt(r,8)!=47?0:(o[0]=wt(r,14)+1,f[0]=wt(r,14)+1,g[0]=wt(r,1),wt(r,3)!=0?0:!r.h)}function Tn(r,o){if(4>r)return r+1;var f=r-2>>1;return(2+(1&r)<>4)*r+(8-(15&f)))?f:1;var f}function De(r,o,f){var g=T(f),b=r[o+=255&g].g-8;return 0>>0,e(8>=f.g),r.g}function sn(r,o,f){var g=r.xc;return e((o=g==0?0:r.vc[r.md*(f>>g)+(o>>g)])>Ot.b)*Pt;utxt&&(jt=xt),(0,Kn[ce[tn++]>>8&15])(F,Y+ +ie,ht,pt+ie-xt,jt-ie,ht,pt+ie),ie=jt}Y+=xt,pt+=xt,++ut&Rt||(Ot+=Pt)}et!=C.nc&&i(L,A-$,L,A+(et-W-1)*$,$);break;case 1:for($=F,Q=Y,xt=(F=C.Ea)-(pt=F&~(ht=(Y=1<>C.b)*ut;W=b),0w.o&&(g=w.o),f=g?f=0:(b[0]+=4*w.v,w.ka=f-w.j,w.U=w.va-w.v,w.T=g-f,f=1),f){if(A=A[0],11>(f=r.ca).S){var W=f.f.RGBA,et=(g=f.S,b=w.U,w=w.T,C=W.eb,W.A),F=w;for(W=W.fb+r.Ma*W.A;0g){var b=r.l.width,w=f.ca,y=f.tb+b*g,A=r.V,L=r.Ba+r.c*g,C=r.gc;e(r.ab==1),e(C[0].hc==3),Qs(C[0],g,o,A,L,w,y),ir(f,g,o,w,y,b)}r.C=r.Ma=o}function Jn(r,o,f,g,b,w,y){var A=r.$/g,L=r.$%g,C=r.m,W=r.s,et=f+r.$,F=et;b=f+g*b;var Y=f+g*w,$=280+W.ua,ut=r.Pb?A:16777216,Q=0=ut){var Rt=et-f;e((ut=r).Pb),ut.wd=ut.m,ut.xd=Rt,0re.g?(J(bt,bt.u+re.g),Rt[Pt]=re.value,bt=0):(J(bt,bt.u+re.g-256),e(256<=re.value),bt=re.value),bt==0&&(xt=!0)}else bt=De(pt.G[0],pt.H[0],C);if(C.h)break;if(xt||256>bt){if(!xt)if(pt.nd)o[et]=(pt.qb|bt<<8)>>>0;else{if(Z(C),xt=De(pt.G[1],pt.H[1],C),Z(C),Rt=De(pt.G[2],pt.H[2],C),Pt=De(pt.G[3],pt.H[3],C),C.h)break;o[et]=(Pt<<24|xt<<16|bt<<8|Rt)>>>0}if(xt=!1,++et,++L>=g&&(L=0,++A,y!=null&&A<=w&&!(A%16)&&y(r,A),Q!=null))for(;F>>Q.Mb]=bt}else if(280>bt){if(bt=Tn(bt-256,C),Rt=De(pt.G[4],pt.H[4],C),Z(C),Rt=Dn(g,Rt=Tn(Rt,C)),C.h)break;if(et-f=g;)L-=g,++A,y!=null&&A<=w&&!(A%16)&&y(r,A);if(e(et<=b),L&ht&&(pt=sn(W,L,A)),Q!=null)for(;F>>Q.Mb]=bt}else{if(!(bt<$))break t;for(xt=bt-280,e(Q!=null);F>>Q.Mb]=bt;bt=et,e(!(xt>>>(Rt=Q).Xa)),o[bt]=Rt.X[xt],xt=!0}xt||e(C.h==H(C))}if(r.Pb&&C.h&&etw?w:A),r.a=0,r.$=et-f}return 1}return r.a=3,0}function qn(r){e(r!=null),r.vc=null,r.yc=null,r.Ya=null;var o=r.Wa;o!=null&&(o.X=null),r.vb=null,e(r!=null)}function ri(){var r=new Et;return r==null?null:(r.a=0,r.xb=vl,ke("Predictor","VP8LPredictors"),ke("Predictor","VP8LPredictors_C"),ke("PredictorAdd","VP8LPredictorsAdd"),ke("PredictorAdd","VP8LPredictorsAdd_C"),Ji=fe,mi=ne,wa=He,ya=ge,Ki=se,vi=oe,bi=je,R.VP8LMapColor32b=Ze,R.VP8LMapColor8b=hr,r)}function ar(r,o,f,g,b){var w=1,y=[r],A=[o],L=g.m,C=g.s,W=null,et=0;t:for(;;){if(f)for(;w&&wt(L,1);){var F=y,Y=A,$=g,ut=1,Q=$.m,ht=$.gc[$.ab],pt=wt(Q,2);if($.Oc&1<=$.ab),pt){case 0:case 1:ht.b=wt(Q,3)+2,ut=ar(yt(ht.Ea,ht.b),yt(ht.nc,ht.b),0,$,ht.K),ht.K=ht.K[0];break;case 3:var xt,bt=wt(Q,8)+1,Rt=16>Ot.b),tn=a(ce);if(tn==null)xt=0;else{var ie=Ot.K[0],jt=Ot.w;for(tn[0]=Ot.K[0][0],Pt=1;Pt<1*re;++Pt)tn[Pt]=Wt(ie[jt+Pt],tn[Pt-1]);for(;Pt<4*ce;++Pt)tn[Pt]=0;Ot.K[0]=null,Ot.K[0]=tn,xt=1}}ut=xt;break;case 2:break;default:e(0)}w=ut}}if(y=y[0],A=A[0],w&&wt(L,1)&&!(w=1<=(et=wt(L,4))&&11>=et)){g.a=3;break t}var Nt;if(Nt=w)e:{var Ve,ee,pe,Ee=g,ln=y,_n=A,qe=et,gn=f,An=Ee.m,en=Ee.s,me=[null],we=1,Ue=0,ye=Vf[qe];n:for(;;){if(gn&&wt(An,1)){var un=wt(An,3)+2,$n=yt(ln,un),Ge=yt(_n,un),Sn=$n*Ge;if(!ar($n,Ge,0,Ee,me))break n;for(me=me[0],en.xc=un,Ve=0;Ve>8&65535;me[Ve]=Le,Le>=we&&(we=Le+1)}}if(An.h)break n;for(ee=0;5>ee;++ee){var nn=gl[ee];!ee&&0=Nn),On=En;var kn=a(Ue);if(On==null||kn==null||Fn==null){Ee.a=1;break n}var jn=Fn;for(Ve=pe=0;Veee;++ee){nn=gl[ee],Bn[ee]=jn,Zn[ee]=pe,!ee&&0vs)break r}else fo=vs;for(Sa=0;SaZi)Il[Sa++]=Zi,Zi!=0&&(Cl=Zi);else{var wh=Zi==16,Ol=Zi-16,yh=Uf[Ol],jl=wt(Gr,qf[Ol])+yh;if(Sa+jl>vs)break r;for(var xh=wh?Cl:0;0=ee){var ka,co=kn[0];for(ka=1;kaco&&(co=kn[ka]);fn+=co}}if(Ce.nd=Ir,Ce.Qb=0,Ir&&(Ce.qb=(Bn[3][Zn[3]+0].value<<24|Bn[1][Zn[1]+0].value<<16|Bn[2][Zn[2]+0].value)>>>0,wi==0&&256>Bn[0][Zn[0]+0].value&&(Ce.Qb=1,Ce.qb+=Bn[0][Zn[0]+0].value<<8)),Ce.jc=!Ce.Qb&&6>fn,Ce.jc){var bs,Cr=Ce;for(bs=0;bs>=an(ws,8,Jr),Yr>>=an(Cr.G[1][Cr.H[1]+Yr],16,Jr),Yr>>=an(Cr.G[2][Cr.H[2]+Yr],0,Jr),an(Cr.G[3][Cr.H[3]+Yr],24,Jr))}}}en.vc=me,en.Wb=we,en.Ya=On,en.yc=Fn,Nt=1;break e}Nt=0}if(!(w=Nt)){g.a=3;break t}if(0g+1?[]:0),!(b.lengthr?0:r>o?o:r}function ji(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Ms(){var r=new Va;return r!=null&&(r.a=0,r.sc="OK",r.cb=0,r.Xb=0,Aa||(Aa=Bi)),r}function Xe(r,o,f){return r.a==0&&(r.a=o,r.sc=f,r.cb=0),0}function Ga(r,o,f){return 3<=f&&r[o+0]==157&&r[o+1]==1&&r[o+2]==42}function or(r,o){if(r==null)return 0;if(r.a=0,r.sc="OK",o==null)return Xe(r,2,"null VP8Io passed to VP8GetHeaders()");var f=o.data,g=o.w,b=o.ha;if(4>b)return Xe(r,7,"Truncated header.");var w=f[g+0]|f[g+1]<<8|f[g+2]<<16,y=r.Od;if(y.Rb=!(1&w),y.td=w>>1&7,y.yd=w>>4&1,y.ub=w>>5,3b)return Xe(r,7,"cannot parse picture header");if(!Ga(f,g,b))return Xe(r,3,"Bad code word");A.c=16383&(f[g+4]<<8|f[g+3]),A.Td=f[g+4]>>6,A.i=16383&(f[g+6]<<8|f[g+5]),A.Ud=f[g+6]>>6,g+=7,b-=7,r.za=A.c+15>>4,r.Ub=A.i+15>>4,o.width=A.c,o.height=A.i,o.Da=0,o.j=0,o.v=0,o.va=o.width,o.o=o.height,o.da=0,o.ib=o.width,o.hb=o.height,o.U=o.width,o.T=o.height,s((w=r.Pa).jb,0,255,w.jb.length),e((w=r.Qa)!=null),w.Cb=0,w.Bb=0,w.Fb=1,s(w.Zb,0,0,w.Zb.length),s(w.Lb,0,0,w.Lb)}if(y.ub>b)return Xe(r,7,"bad partition length");ot(w=r.m,f,g,y.ub),g+=y.ub,b-=y.ub,y.Rb&&(A.Ld=st(w),A.Kd=st(w)),A=r.Qa;var L,C=r.Pa;if(e(w!=null),e(A!=null),A.Cb=st(w),A.Cb){if(A.Bb=st(w),st(w)){for(A.Fb=st(w),L=0;4>L;++L)A.Zb[L]=st(w)?nt(w,7):0;for(L=0;4>L;++L)A.Lb[L]=st(w)?nt(w,6):0}if(A.Bb)for(L=0;3>L;++L)C.jb[L]=st(w)?ft(w,8):255}else A.Bb=0;if(w.Ka)return Xe(r,3,"cannot parse segment header");if((A=r.ed).zd=st(w),A.Tb=ft(w,6),A.wb=ft(w,3),A.Pc=st(w),A.Pc&&st(w)){for(C=0;4>C;++C)st(w)&&(A.vd[C]=nt(w,6));for(C=0;4>C;++C)st(w)&&(A.od[C]=nt(w,6))}if(r.L=A.Tb==0?0:A.zd?1:2,w.Ka)return Xe(r,3,"cannot parse filter header");var W=b;if(b=L=g,g=L+W,A=W,r.Xb=(1<A&&(et=A),ot(r.Jc[+W],f,L,et),L+=et,A-=et,b+=3}ot(r.Jc[+C],f,L,A),f=Let;++et){if(W.Cb){var F=W.Zb[et];W.Fb||(F+=f)}else{if(0>16,8>Y.Eb[1]&&(Y.Eb[1]=8),Y.Qc[0]=ao[sr(F+C,117)],Y.Qc[1]=so[sr(F+L,127)],Y.lc=F+L}if(!y.Rb)return Xe(r,4,"Not a key frame.");for(st(w),y=r.Pa,f=0;4>f;++f){for(b=0;8>b;++b)for(g=0;3>g;++g)for(A=0;11>A;++A)C=gt(w,$f[f][b][g][A])?ft(w,8):Kf[f][b][g][A],y.Wc[f][b].Yb[g][A]=C;for(b=0;17>b;++b)y.Xc[f][b]=y.Wc[f][Zf[b]]}return r.kc=st(w),r.kc&&(r.Bd=ft(w,8)),r.cb=1}function Bi(r,o,f,g,b,w,y){var A=o[b].Yb[f];for(f=0;16>b;++b){if(!gt(r,A[f+0]))return b;for(;!gt(r,A[f+1]);)if(A=o[++b].Yb[0],f=0,b==16)return 16;var L=o[b+1].Yb;if(gt(r,A[f+2])){var C=r,W=0;if(gt(C,(F=A)[(et=f)+3]))if(gt(C,F[et+6])){for(A=0,et=2*(W=gt(C,F[et+8]))+(F=gt(C,F[et+9+W])),W=0,F=Yf[et];F[A];++A)W+=W+gt(C,F[A]);W+=3+(8<(C=r).b&&at(C);var et,F=C.b,Y=(et=C.Ca>>1)-(C.I>>F)>>31;--C.b,C.Ca+=Y,C.Ca|=1,C.I-=(et+1&Y)<>3),r[o+f+32*g]=-256&b?0>b?0:255:b}function Mi(r,o,f,g,b,w){In(r,o,0,f,g+b),In(r,o,1,f,g+w),In(r,o,2,f,g-w),In(r,o,3,f,g-b)}function yr(r){return(20091*r>>16)+r}function on(r,o,f,g){var b,w=0,y=a(16);for(b=0;4>b;++b){var A=r[o+0]+r[o+8],L=r[o+0]-r[o+8],C=(35468*r[o+4]>>16)-yr(r[o+12]),W=yr(r[o+4])+(35468*r[o+12]>>16);y[w+0]=A+W,y[w+1]=L+C,y[w+2]=L-C,y[w+3]=A-W,w+=4,o++}for(b=w=0;4>b;++b)A=(r=y[w+0]+4)+y[w+8],L=r-y[w+8],C=(35468*y[w+4]>>16)-yr(y[w+12]),In(f,g,0,0,A+(W=yr(y[w+4])+(35468*y[w+12]>>16))),In(f,g,1,0,L+C),In(f,g,2,0,L-C),In(f,g,3,0,A-W),w++,g+=32}function Ya(r,o,f,g){var b=r[o+0]+4,w=35468*r[o+4]>>16,y=yr(r[o+4]),A=35468*r[o+1]>>16;Mi(f,g,0,b+y,r=yr(r[o+1]),A),Mi(f,g,1,b+w,r,A),Mi(f,g,2,b-w,r,A),Mi(f,g,3,b-y,r,A)}function Rs(r,o,f,g,b){on(r,o,f,g),b&&on(r,o+16,f,g+4)}function Ts(r,o,f,g){Sr(r,o+0,f,g,1),Sr(r,o+32,f,g+128,1)}function Ds(r,o,f,g){var b;for(r=r[o+0]+4,b=0;4>b;++b)for(o=0;4>o;++o)In(f,g,o,b,r)}function lr(r,o,f,g){r[o+0]&&pn(r,o+0,f,g),r[o+16]&&pn(r,o+16,f,g+4),r[o+32]&&pn(r,o+32,f,g+128),r[o+48]&&pn(r,o+48,f,g+128+4)}function Ja(r,o,f,g){var b,w=a(16);for(b=0;4>b;++b){var y=r[o+0+b]+r[o+12+b],A=r[o+4+b]+r[o+8+b],L=r[o+4+b]-r[o+8+b],C=r[o+0+b]-r[o+12+b];w[0+b]=y+A,w[8+b]=y-A,w[4+b]=C+L,w[12+b]=C-L}for(b=0;4>b;++b)y=(r=w[0+4*b]+3)+w[3+4*b],A=w[1+4*b]+w[2+4*b],L=w[1+4*b]-w[2+4*b],C=r-w[3+4*b],f[g+0]=y+A>>3,f[g+16]=C+L>>3,f[g+32]=y-A>>3,f[g+48]=C-L>>3,g+=64}function Ri(r,o,f){var g,b=o-32,w=Cn,y=255-r[b-1];for(g=0;gf;++f)i(r,o+32*f,r,o-32,16)}function zs(r,o){var f;for(f=16;0g;++g)s(o,f+32*g,r,16)}function Ka(r,o){var f,g=16;for(f=0;16>f;++f)g+=r[o-1+32*f]+r[o+f-32];Br(g>>5,r,o)}function Mr(r,o){var f,g=8;for(f=0;16>f;++f)g+=r[o-1+32*f];Br(g>>4,r,o)}function Hs(r,o){var f,g=8;for(f=0;16>f;++f)g+=r[o+f-32];Br(g>>4,r,o)}function ai(r,o){Br(128,r,o)}function Jt(r,o,f){return r+2*o+f+2>>2}function Ws(r,o){var f,g=o-32;for(g=new Uint8Array([Jt(r[g-1],r[g+0],r[g+1]),Jt(r[g+0],r[g+1],r[g+2]),Jt(r[g+1],r[g+2],r[g+3]),Jt(r[g+2],r[g+3],r[g+4])]),f=0;4>f;++f)i(r,o+32*f,g,0,g.length)}function Vs(r,o){var f=r[o-1],g=r[o-1+32],b=r[o-1+64],w=r[o-1+96];_t(r,o+0,16843009*Jt(r[o-1-32],f,g)),_t(r,o+32,16843009*Jt(f,g,b)),_t(r,o+64,16843009*Jt(g,b,w)),_t(r,o+96,16843009*Jt(b,w,w))}function Gs(r,o){var f,g=4;for(f=0;4>f;++f)g+=r[o+f-32]+r[o-1+32*f];for(g>>=3,f=0;4>f;++f)s(r,o+32*f,g,4)}function Ys(r,o){var f=r[o-1+0],g=r[o-1+32],b=r[o-1+64],w=r[o-1-32],y=r[o+0-32],A=r[o+1-32],L=r[o+2-32],C=r[o+3-32];r[o+0+96]=Jt(g,b,r[o-1+96]),r[o+1+96]=r[o+0+64]=Jt(f,g,b),r[o+2+96]=r[o+1+64]=r[o+0+32]=Jt(w,f,g),r[o+3+96]=r[o+2+64]=r[o+1+32]=r[o+0+0]=Jt(y,w,f),r[o+3+64]=r[o+2+32]=r[o+1+0]=Jt(A,y,w),r[o+3+32]=r[o+2+0]=Jt(L,A,y),r[o+3+0]=Jt(C,L,A)}function Js(r,o){var f=r[o+1-32],g=r[o+2-32],b=r[o+3-32],w=r[o+4-32],y=r[o+5-32],A=r[o+6-32],L=r[o+7-32];r[o+0+0]=Jt(r[o+0-32],f,g),r[o+1+0]=r[o+0+32]=Jt(f,g,b),r[o+2+0]=r[o+1+32]=r[o+0+64]=Jt(g,b,w),r[o+3+0]=r[o+2+32]=r[o+1+64]=r[o+0+96]=Jt(b,w,y),r[o+3+32]=r[o+2+64]=r[o+1+96]=Jt(w,y,A),r[o+3+64]=r[o+2+96]=Jt(y,A,L),r[o+3+96]=Jt(A,L,L)}function xr(r,o){var f=r[o-1+0],g=r[o-1+32],b=r[o-1+64],w=r[o-1-32],y=r[o+0-32],A=r[o+1-32],L=r[o+2-32],C=r[o+3-32];r[o+0+0]=r[o+1+64]=w+y+1>>1,r[o+1+0]=r[o+2+64]=y+A+1>>1,r[o+2+0]=r[o+3+64]=A+L+1>>1,r[o+3+0]=L+C+1>>1,r[o+0+96]=Jt(b,g,f),r[o+0+64]=Jt(g,f,w),r[o+0+32]=r[o+1+96]=Jt(f,w,y),r[o+1+32]=r[o+2+96]=Jt(w,y,A),r[o+2+32]=r[o+3+96]=Jt(y,A,L),r[o+3+32]=Jt(A,L,C)}function _r(r,o){var f=r[o+0-32],g=r[o+1-32],b=r[o+2-32],w=r[o+3-32],y=r[o+4-32],A=r[o+5-32],L=r[o+6-32],C=r[o+7-32];r[o+0+0]=f+g+1>>1,r[o+1+0]=r[o+0+64]=g+b+1>>1,r[o+2+0]=r[o+1+64]=b+w+1>>1,r[o+3+0]=r[o+2+64]=w+y+1>>1,r[o+0+32]=Jt(f,g,b),r[o+1+32]=r[o+0+96]=Jt(g,b,w),r[o+2+32]=r[o+1+96]=Jt(b,w,y),r[o+3+32]=r[o+2+96]=Jt(w,y,A),r[o+3+64]=Jt(y,A,L),r[o+3+96]=Jt(A,L,C)}function Ks(r,o){var f=r[o-1+0],g=r[o-1+32],b=r[o-1+64],w=r[o-1+96];r[o+0+0]=f+g+1>>1,r[o+2+0]=r[o+0+32]=g+b+1>>1,r[o+2+32]=r[o+0+64]=b+w+1>>1,r[o+1+0]=Jt(f,g,b),r[o+3+0]=r[o+1+32]=Jt(g,b,w),r[o+3+32]=r[o+1+64]=Jt(b,w,w),r[o+3+64]=r[o+2+64]=r[o+0+96]=r[o+1+96]=r[o+2+96]=r[o+3+96]=w}function Xs(r,o){var f=r[o-1+0],g=r[o-1+32],b=r[o-1+64],w=r[o-1+96],y=r[o-1-32],A=r[o+0-32],L=r[o+1-32],C=r[o+2-32];r[o+0+0]=r[o+2+32]=f+y+1>>1,r[o+0+32]=r[o+2+64]=g+f+1>>1,r[o+0+64]=r[o+2+96]=b+g+1>>1,r[o+0+96]=w+b+1>>1,r[o+3+0]=Jt(A,L,C),r[o+2+0]=Jt(y,A,L),r[o+1+0]=r[o+3+32]=Jt(f,y,A),r[o+1+32]=r[o+3+64]=Jt(g,f,y),r[o+1+64]=r[o+3+96]=Jt(b,g,f),r[o+1+96]=Jt(w,b,g)}function Di(r,o){var f;for(f=0;8>f;++f)i(r,o+32*f,r,o-32,8)}function fa(r,o){var f;for(f=0;8>f;++f)s(r,o,r[o-1],8),o+=32}function ur(r,o,f){var g;for(g=0;8>g;++g)s(o,f+32*g,r,8)}function $s(r,o){var f,g=8;for(f=0;8>f;++f)g+=r[o+f-32]+r[o-1+32*f];ur(g>>4,r,o)}function qi(r,o){var f,g=4;for(f=0;8>f;++f)g+=r[o+f-32];ur(g>>3,r,o)}function Zs(r,o){var f,g=4;for(f=0;8>f;++f)g+=r[o-1+32*f];ur(g>>3,r,o)}function ha(r,o){ur(128,r,o)}function Rr(r,o,f){var g=r[o-f],b=r[o+0],w=3*(b-g)+to[1020+r[o-2*f]-r[o+f]],y=is[112+(w+4>>3)];r[o-f]=Cn[255+g+is[112+(w+3>>3)]],r[o+0]=Cn[255+b-y]}function ca(r,o,f,g){var b=r[o+0],w=r[o+f];return Hn[255+r[o-2*f]-r[o-f]]>g||Hn[255+w-b]>g}function si(r,o,f,g){return 4*Hn[255+r[o-f]-r[o+0]]+Hn[255+r[o-2*f]-r[o+f]]<=g}function da(r,o,f,g,b){var w=r[o-3*f],y=r[o-2*f],A=r[o-f],L=r[o+0],C=r[o+f],W=r[o+2*f],et=r[o+3*f];return 4*Hn[255+A-L]+Hn[255+y-C]>g?0:Hn[255+r[o-4*f]-w]<=b&&Hn[255+w-y]<=b&&Hn[255+y-A]<=b&&Hn[255+et-W]<=b&&Hn[255+W-C]<=b&&Hn[255+C-L]<=b}function Ui(r,o,f,g){var b=2*g+1;for(g=0;16>g;++g)si(r,o+g,f,b)&&Rr(r,o+g,f)}function pa(r,o,f,g){var b=2*g+1;for(g=0;16>g;++g)si(r,o+g*f,1,b)&&Rr(r,o+g*f,1)}function zi(r,o,f,g){var b;for(b=3;0>7,ht=18*pt+63>>7,pt=9*pt+63>>7;L[C-3*W]=Cn[255+L[C-3*W]+pt],L[C-2*W]=Cn[255+et+ht],L[C-W]=Cn[255+F+Q],L[C+0]=Cn[255+Y-Q],L[C+W]=Cn[255+$-ht],L[C+2*W]=Cn[255+ut-pt]}o+=g}}function Nr(r,o,f,g,b,w,y,A){for(w=2*w+1;0>3)],ut=is[112+(ut+3>>3)],Q=$+1>>1;L[C-2*W]=Cn[255+L[C-2*W]+Q],L[C-W]=Cn[255+et+ut],L[C+0]=Cn[255+F-$],L[C+W]=Cn[255+Y-Q]}o+=g}}function $a(r,o,f,g,b,w){Ar(r,o,f,1,16,g,b,w)}function Za(r,o,f,g,b,w){Ar(r,o,1,f,16,g,b,w)}function Qa(r,o,f,g,b,w){var y;for(y=3;0C?0:255:C)&255,C=L,b[w+A]=W}}function $e(r,o,f,g){var b=o.width,w=o.o;if(e(r!=null&&o!=null),0>f||0>=g||f+g>w)return null;if(!r.Cc){if(r.ga==null){var y;if(r.ga=new Ft,(y=r.ga==null)||(y=o.width*o.o,e(r.Gb.length==0),r.Gb=a(y),r.Uc=0,r.Gb==null?y=0:(r.mb=r.Gb,r.nb=r.Uc,r.rc=null,y=1),y=!y),!y){y=r.ga;var A=r.Fa,L=r.P,C=r.qc,W=r.mb,et=r.nb,F=L+1,Y=C-1,$=y.l;if(e(A!=null&&W!=null&&o!=null),Wr[0]=null,Wr[1]=Xt,Wr[2]=te,Wr[3]=de,y.ca=W,y.tb=et,y.c=o.width,y.i=o.height,e(0=C)o=0;else if(y.$a=3&A[L+0],y.Z=A[L+0]>>2&3,y.Lc=A[L+0]>>4&3,L=A[L+0]>>6&3,0>y.$a||1=y.c*y.i;y=!o}if(y)return null;r.ga.Lc!=1?r.Ga=0:g=w-f}e(r.ga!=null),e(f+g<=w);t:{if(o=(A=r.ga).c,w=A.l.o,A.$a==0){if(F=r.rc,Y=r.Vc,$=r.Fa,L=r.P+1+f*o,C=r.mb,W=r.nb+f*o,e(L<=r.P+r.qc),A.Z!=0)for(e(Wr[A.Z]!=null),y=0;y=o)o=1;else if(A.ic||Te(),A.ic){A=y.V,F=y.Ba,Y=y.c;var ut=y.i,Q=($=1,L=y.$/Y,C=y.$%Y,W=y.m,et=y.s,y.$),ht=Y*ut,pt=Y*o,xt=et.wc,bt=Q(ut=De(bt.G[0],bt.H[0],W)))A[F+Q]=ut,++Q,++C>=Y&&(C=0,++L<=o&&!(L%16)&&Yn(y,L));else{if(!(280>ut)){$=0;break e}ut=Tn(ut-256,W);var Rt,Pt=De(bt.G[4],bt.H[4],W);if(Z(W),!(Q>=(Pt=Dn(Y,Pt=Tn(Pt,W)))&&ht-Q>=ut)){$=0;break e}for(Rt=0;Rt=Y;)C-=Y,++L<=o&&!(L%16)&&Yn(y,L);Qo?o:L);break e}!$||W.h&&Q=w&&(r.Cc=1),g=1}if(!g)return null;if(r.Cc&&((g=r.ga)!=null&&(g.mc=null),r.ga=null,0>23,A[L+4*y+1]=A[L+4*y+1]*et>>23,A[L+4*y+2]=A[L+4*y+2]*et>>23)}o+=w}}function Ae(r,o,f,g,b){for(;0>4)*L>>16;r[o+2*w+0]=(240&y|y>>4)*L>>16&240|(15&y|y<<4)*L>>16>>4&15,r[o+2*w+1]=240&C|A}o+=b}}function Fe(r,o,f,g,b,w,y,A){var L,C,W=255;for(C=0;C>8}function Te(){_a=Ne,al=Ae,sl=Fe,ol=Re}function cn(r,o,f){R[r]=function(g,b,w,y,A,L,C,W,et,F,Y,$,ut,Q,ht,pt,xt){var bt,Rt=xt-1>>1,Pt=A[L+0]|C[W+0]<<16,re=et[F+0]|Y[$+0]<<16;e(g!=null);var Ot=3*Pt+re+131074>>2;for(o(g[b+0],255&Ot,Ot>>16,ut,Q),w!=null&&(Ot=3*re+Pt+131074>>2,o(w[y+0],255&Ot,Ot>>16,ht,pt)),bt=1;bt<=Rt;++bt){var ce=A[L+bt]|C[W+bt]<<16,tn=et[F+bt]|Y[$+bt]<<16,ie=Pt+ce+re+tn+524296,jt=ie+2*(ce+re)>>3;Ot=jt+Pt>>1,Pt=(ie=ie+2*(Pt+tn)>>3)+ce>>1,o(g[b+2*bt-1],255&Ot,Ot>>16,ut,Q+(2*bt-1)*f),o(g[b+2*bt-0],255&Pt,Pt>>16,ut,Q+(2*bt-0)*f),w!=null&&(Ot=ie+re>>1,Pt=jt+tn>>1,o(w[y+2*bt-1],255&Ot,Ot>>16,ht,pt+(2*bt-1)*f),o(w[y+2*bt+0],255&Pt,Pt>>16,ht,pt+(2*bt+0)*f)),Pt=ce,re=tn}1&xt||(Ot=3*Pt+re+131074>>2,o(g[b+xt-1],255&Ot,Ot>>16,ut,Q+(xt-1)*f),w!=null&&(Ot=3*re+Pt+131074>>2,o(w[y+xt-1],255&Ot,Ot>>16,ht,pt+(xt-1)*f)))}}function Lr(){Wn[as]=th,Wn[ss]=bl,Wn[dl]=eh,Wn[os]=wl,Wn[ls]=yl,Wn[eo]=xl,Wn[pl]=nh,Wn[no]=bl,Wn[ro]=wl,Wn[us]=yl,Wn[io]=xl}function ga(r){return r&-16384?0>r?0:255:r>>rh}function li(r,o){return ga((19077*r>>8)+(26149*o>>8)-14234)}function ui(r,o,f){return ga((19077*r>>8)-(6419*o>>8)-(13320*f>>8)+8708)}function Tr(r,o){return ga((19077*r>>8)+(33050*o>>8)-17685)}function fi(r,o,f,g,b){g[b+0]=li(r,f),g[b+1]=ui(r,o,f),g[b+2]=Tr(r,o)}function Hi(r,o,f,g,b){g[b+0]=Tr(r,o),g[b+1]=ui(r,o,f),g[b+2]=li(r,f)}function Wi(r,o,f,g,b){var w=ui(r,o,f);o=w<<3&224|Tr(r,o)>>3,g[b+0]=248&li(r,f)|w>>5,g[b+1]=o}function dn(r,o,f,g,b){var w=240&Tr(r,o)|15;g[b+0]=240&li(r,f)|ui(r,o,f)>>4,g[b+1]=w}function hi(r,o,f,g,b){g[b+0]=255,fi(r,o,f,g,b+1)}function ci(r,o,f,g,b){Hi(r,o,f,g,b),g[b+3]=255}function ma(r,o,f,g,b){fi(r,o,f,g,b),g[b+3]=255}function fr(r,o,f){R[r]=function(g,b,w,y,A,L,C,W,et){for(var F=W+(-2&et)*f;W!=F;)o(g[b+0],w[y+0],A[L+0],C,W),o(g[b+1],w[y+0],A[L+0],C,W+f),b+=2,++y,++L,W+=2*f;1&et&&o(g[b+0],w[y+0],A[L+0],C,W)}}function yn(r,o,f){return f==0?r==0?o==0?6:5:o==0?4:0:f}function es(r,o,f,g,b){switch(r>>>30){case 3:Sr(o,f,g,b,0);break;case 2:zr(o,f,g,b);break;case 1:pn(o,f,g,b)}}function Vi(r,o){var f,g,b=o.M,w=o.Nb,y=r.oc,A=r.pc+40,L=r.oc,C=r.pc+584,W=r.oc,et=r.pc+600;for(f=0;16>f;++f)y[A+32*f-1]=129;for(f=0;8>f;++f)L[C+32*f-1]=129,W[et+32*f-1]=129;for(0f;++f)i(y,A+32*f-4,y,A+32*f+12,4);for(f=-1;8>f;++f)i(L,C+32*f-4,L,C+32*f+4,4),i(W,et+32*f-4,W,et+32*f+4,4)}var Y=r.Gd,$=r.Hd+g,ut=F.ad,Q=F.Hc;if(0=r.za-1?s(ht,pt,Y[$].y[15],4):i(ht,pt,Y[$+1].y,0,4)),f=0;4>f;f++)ht[pt+128+f]=ht[pt+256+f]=ht[pt+384+f]=ht[pt+0+f];for(f=0;16>f;++f,Q<<=2)ht=y,pt=A+Al[f],Xn[F.Ob[f]](ht,pt),es(Q,ut,16*+f,ht,pt)}else if(ht=yn(g,b,F.Ob[0]),Hr[ht](y,A),Q!=0)for(f=0;16>f;++f,Q<<=2)es(Q,ut,16*+f,y,A+Al[f]);for(f=F.Gc,ht=yn(g,b,F.Dd),Pr[ht](L,C),Pr[ht](W,et),Q=ut,ht=L,pt=C,255&(F=0|f)&&(170&F?Xi(Q,256,ht,pt):cr(Q,256,ht,pt)),F=W,Q=et,255&(f>>=8)&&(170&f?Xi(ut,320,F,Q):cr(ut,320,F,Q)),bf;++f)i(Y,$+f*r.R,y,A+32*f,16);for(f=0;8>f;++f)i(ut,F+f*r.B,L,C+32*f,8),i(Q,ht+f*r.B,W,et+32*f,8)}}function ns(r,o,f,g,b,w,y,A,L){var C=[0],W=[0],et=0,F=L!=null?L.kd:0,Y=L??new K;if(r==null||12>f)return 7;Y.data=r,Y.w=o,Y.ha=f,o=[o],f=[f],Y.gb=[Y.gb];t:{var $=o,ut=f,Q=Y.gb;if(e(r!=null),e(ut!=null),e(Q!=null),Q[0]=0,12<=ut[0]&&!t(r,$[0],"RIFF")){if(t(r,$[0]+8,"WEBP")){Q=3;break t}var ht=Dt(r,$[0]+4);if(12>ht||4294967286ut[0]-8){Q=7;break t}Q[0]=ht,$[0]+=12,ut[0]-=12}Q=0}if(Q!=0)return Q;for(ht=0Q[0])Q=7;else{if(!t(pt,ut[0],"VP8X")){if(Dt(pt,ut[0]+4)!=10){Q=3;break t}if(18>Q[0]){Q=7;break t}var Pt=Dt(pt,ut[0]+8),re=1+St(pt,ut[0]+12);if(2147483648<=re*(pt=1+St(pt,ut[0]+15))){Q=3;break t}Rt!=null&&(Rt[0]=Pt),xt!=null&&(xt[0]=re),bt!=null&&(bt[0]=pt),ut[0]+=18,Q[0]-=18,Ot[0]=1}Q=0}}if(et=et[0],$=$[0],Q!=0)return Q;if(ut=!!(2&$),!ht&&et)return 3;if(w!=null&&(w[0]=!!(16&$)),y!=null&&(y[0]=ut),A!=null&&(A[0]=0),y=C[0],$=W[0],et&&ut&&L==null){Q=0;break}if(4>f){Q=7;break}if(ht&&et||!ht&&!et&&!t(r,o[0],"ALPH")){f=[f],Y.na=[Y.na],Y.P=[Y.P],Y.Sa=[Y.Sa];t:{Pt=r,Q=o,ht=f;var Ot=Y.gb;xt=Y.na,bt=Y.P,Rt=Y.Sa,re=22,e(Pt!=null),e(ht!=null),pt=Q[0];var ce=ht[0];for(e(xt!=null),e(Rt!=null),xt[0]=null,bt[0]=null,Rt[0]=0;;){if(Q[0]=pt,ht[0]=ce,8>ce){Q=7;break t}var tn=Dt(Pt,pt+4);if(4294967286Ot){Q=3;break t}if(!t(Pt,pt,"VP8 ")||!t(Pt,pt,"VP8L")){Q=0;break t}if(ce[0]ht[0])Q=7;else{if(pt||re){if(Ot=Dt(Ot,Pt+4),12<=xt&&Ot>xt-12){Q=3;break t}if(F&&Ot>ht[0]-8){Q=7;break t}bt[0]=Ot,Q[0]+=8,ht[0]-=8,Rt[0]=re}else Rt[0]=5<=ht[0]&&Ot[Pt+0]==47&&!(Ot[Pt+4]>>5),bt[0]=ht[0];Q=0}if(f=f[0],Y.Ja=Y.Ja[0],Y.xa=Y.xa[0],o=o[0],Q!=0)break;if(4294967286f){Q=7;break}A=y,F=$,ut=w,r==null||5>f?r=0:5<=f&&r[o+0]==47&&!(r[o+4]>>5)?(ht=[0],Ot=[0],xt=[0],ct(bt=new B,r,o,f),wr(bt,ht,Ot,xt)?(A!=null&&(A[0]=ht[0]),F!=null&&(F[0]=Ot[0]),ut!=null&&(ut[0]=xt[0]),r=1):r=0):r=0}else{if(10>f){Q=7;break}A=$,r==null||10>f||!Ga(r,o+3,f-3)?r=0:(F=r[o+0]|r[o+1]<<8|r[o+2]<<16,ut=16383&(r[o+7]<<8|r[o+6]),r=16383&(r[o+9]<<8|r[o+8]),1&F||3<(F>>1&7)||!(F>>4&1)||F>>5>=Y.Ja||!ut||!r?r=0:(y&&(y[0]=ut),A&&(A[0]=r),r=1))}if(!r||(y=y[0],$=$[0],et&&(C[0]!=y||W[0]!=$)))return 3;L!=null&&(L[0]=Y,L.offset=o-L.w,e(4294967286>o-L.w),e(L.offset==L.ha-f));break}return Q==0||Q==7&&et&&L==null?(w!=null&&(w[0]|=Y.na!=null&&0f||(w&=-2,y&=-2),0>w||0>y||0>=A||0>=L||w+A>g||y+L>b))return 0;if(o.v=w,o.j=y,o.va=w+A,o.o=y+L,o.U=A,o.T=L,o.da=r!=null&&0r.S){var o=r.f.RGBA;o.fb+=(r.height-1)*o.A,o.A=-o.A}else o=r.f.kb,r=r.height,o.O+=(r-1)*o.fa,o.fa=-o.fa,o.N+=(r-1>>1)*o.Ab,o.Ab=-o.Ab,o.W+=(r-1>>1)*o.Db,o.Db=-o.Db,o.F!=null&&(o.J+=(r-1)*o.lb,o.lb=-o.lb);return 0}function va(r,o,f,g){if(g==null||0>=r||0>=o)return 2;if(f!=null){if(f.Da){var b=f.cd,w=f.bd,y=-2&f.v,A=-2&f.j;if(0>y||0>A||0>=b||0>=w||y+b>r||A+w>o)return 2;r=b,o=w}if(f.da){if(!Ht(r,o,b=[f.ib],w=[f.hb]))return 2;r=b[0],o=w[0]}}g.width=r,g.height=o;t:{var L=g.width,C=g.height;if(r=g.S,0>=L||0>=C||!(r>=as&&13>r))r=2;else{if(0>=g.Rd&&g.sd==null){y=w=b=o=0;var W=(A=L*Nl[r])*C;if(11>r||(w=(C+1)/2*(o=(L+1)/2),r==12&&(y=(b=L)*C)),(C=a(W+2*w+y))==null){r=1;break t}g.sd=C,11>r?((L=g.f.RGBA).eb=C,L.fb=0,L.A=A,L.size=W):((L=g.f.kb).y=C,L.O=0,L.fa=A,L.Fd=W,L.f=C,L.N=0+W,L.Ab=o,L.Cd=w,L.ea=C,L.W=0+W+w,L.Db=o,L.Ed=w,r==12&&(L.F=C,L.J=0+W+2*w),L.Tc=y,L.lb=b)}if(o=1,b=g.S,w=g.width,y=g.height,b>=as&&13>b)if(11>b)r=g.f.RGBA,o&=(A=Math.abs(r.A))*(y-1)+w<=r.size,o&=A>=w*Nl[b],o&=r.eb!=null;else{r=g.f.kb,A=(w+1)/2,W=(y+1)/2,L=Math.abs(r.fa),C=Math.abs(r.Ab);var et=Math.abs(r.Db),F=Math.abs(r.lb),Y=F*(y-1)+w;o&=L*(y-1)+w<=r.Fd,o&=C*(W-1)+A<=r.Cd,o=(o&=et*(W-1)+A<=r.Ed)&L>=w&C>=A&et>=A,o&=r.y!=null,o&=r.f!=null,o&=r.ea!=null,b==12&&(o&=F>=w,o&=Y<=r.Tc,o&=r.F!=null)}else o=0;r=o?0:2}}return r!=0||f!=null&&f.fd&&(r=di(g)),r}var Gi=64,pi=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],ba=24,xn=32,Ln=8,Yi=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ct("Predictor0","PredictorAdd0"),R.Predictor0=function(){return 4278190080},R.Predictor1=function(r){return r},R.Predictor2=function(r,o,f){return o[f+0]},R.Predictor3=function(r,o,f){return o[f+1]},R.Predictor4=function(r,o,f){return o[f-1]},R.Predictor5=function(r,o,f){return qt(qt(r,o[f+1]),o[f+0])},R.Predictor6=function(r,o,f){return qt(r,o[f-1])},R.Predictor7=function(r,o,f){return qt(r,o[f+0])},R.Predictor8=function(r,o,f){return qt(o[f-1],o[f+0])},R.Predictor9=function(r,o,f){return qt(o[f+0],o[f+1])},R.Predictor10=function(r,o,f){return qt(qt(r,o[f-1]),qt(o[f+0],o[f+1]))},R.Predictor11=function(r,o,f){var g=o[f+0];return 0>=Zt(g>>24&255,r>>24&255,(o=o[f-1])>>24&255)+Zt(g>>16&255,r>>16&255,o>>16&255)+Zt(g>>8&255,r>>8&255,o>>8&255)+Zt(255&g,255&r,255&o)?g:r},R.Predictor12=function(r,o,f){var g=o[f+0];return(ve((r>>24&255)+(g>>24&255)-((o=o[f-1])>>24&255))<<24|ve((r>>16&255)+(g>>16&255)-(o>>16&255))<<16|ve((r>>8&255)+(g>>8&255)-(o>>8&255))<<8|ve((255&r)+(255&g)-(255&o)))>>>0},R.Predictor13=function(r,o,f){var g=o[f-1];return(ue((r=qt(r,o[f+0]))>>24&255,g>>24&255)<<24|ue(r>>16&255,g>>16&255)<<16|ue(r>>8&255,g>>8&255)<<8|ue(255&r,255&g))>>>0};var Dr=R.PredictorAdd0;R.PredictorAdd1=he,Ct("Predictor2","PredictorAdd2"),Ct("Predictor3","PredictorAdd3"),Ct("Predictor4","PredictorAdd4"),Ct("Predictor5","PredictorAdd5"),Ct("Predictor6","PredictorAdd6"),Ct("Predictor7","PredictorAdd7"),Ct("Predictor8","PredictorAdd8"),Ct("Predictor9","PredictorAdd9"),Ct("Predictor10","PredictorAdd10"),Ct("Predictor11","PredictorAdd11"),Ct("Predictor12","PredictorAdd12"),Ct("Predictor13","PredictorAdd13");var qr=R.PredictorAdd2;Tt("ColorIndexInverseTransform","MapARGB","32b",function(r){return r>>8&255},function(r){return r}),Tt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(r){return r},function(r){return r>>8&255});var Ji,gi=R.ColorIndexInverseTransform,Ze=R.MapARGB,Qs=R.VP8LColorIndexInverseTransformAlpha,hr=R.MapAlpha,Kn=R.VP8LPredictorsAdd=[];Kn.length=16,(R.VP8LPredictors=[]).length=16,(R.VP8LPredictorsAdd_C=[]).length=16,(R.VP8LPredictors_C=[]).length=16;var mi,wa,ya,Ki,vi,bi,Ur,Sr,zr,Xi,pn,cr,Pe,Ie,We,Qe,kr,xa,$i,rs,el,nl,rl,il,_a,al,sl,ol,ll=a(511),ul=a(2041),fl=a(225),hl=a(767),cl=0,to=ul,is=fl,Cn=hl,Hn=ll,as=0,ss=1,dl=2,os=3,ls=4,eo=5,pl=6,no=7,ro=8,us=9,io=10,qf=[2,3,7],Uf=[3,3,11],gl=[280,256,256,256,40],zf=[0,1,1,1,0],Hf=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Wf=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Vf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Gf=8,ao=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],so=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Aa=null,Yf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Jf=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ml=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Kf=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Xf=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],$f=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Zf=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Hr=[],Xn=[],Pr=[],Qf=1,vl=2,Wr=[],Wn=[];cn("UpsampleRgbLinePair",fi,3),cn("UpsampleBgrLinePair",Hi,3),cn("UpsampleRgbaLinePair",ma,4),cn("UpsampleBgraLinePair",ci,4),cn("UpsampleArgbLinePair",hi,4),cn("UpsampleRgba4444LinePair",dn,2),cn("UpsampleRgb565LinePair",Wi,2);var th=R.UpsampleRgbLinePair,eh=R.UpsampleBgrLinePair,bl=R.UpsampleRgbaLinePair,wl=R.UpsampleBgraLinePair,yl=R.UpsampleArgbLinePair,xl=R.UpsampleRgba4444LinePair,nh=R.UpsampleRgb565LinePair,fs=16,hs=1<g.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),g.ca.f.kb.F!=null&&Te()),g.Pb&&0(L=f.Md)?0:100C;++C)12>(et=b.pb[C]).lc&&(et.ia=L*fh[0>et.lc?0:et.lc]>>3),W|=et.ia;W&&(alert("todo:VP8InitRandom"),b.ia=1)}b.Ga=f.Id,100b.Ga&&(b.Ga=0)}(function(F,Y){if(F==null)return 0;if(Y==null)return Xe(F,2,"NULL VP8Io parameter in VP8Decode().");if(!F.cb&&!or(F,Y))return 0;if(e(F.cb),Y.ac==null||Y.ac(Y)){Y.ob&&(F.L=0);var $=cs[F.L];if(F.L==2?(F.yb=0,F.zb=0):(F.yb=Y.v-$>>4,F.zb=Y.j-$>>4,0>F.yb&&(F.yb=0),0>F.zb&&(F.zb=0)),F.Va=Y.o+15+$>>4,F.Hb=Y.va+15+$>>4,F.Hb>F.za&&(F.Hb=F.za),F.Va>F.Ub&&(F.Va=F.Ub),0$;++$){var Q;if(F.Qa.Cb){var ht=F.Qa.Lb[$];F.Qa.Fb||(ht+=ut.Tb)}else ht=ut.Tb;for(Q=0;1>=Q;++Q){var pt=F.gd[$][Q],xt=ht;if(ut.Pc&&(xt+=ut.vd[0],Q&&(xt+=ut.od[0])),0<(xt=0>xt?0:63>2:bt>>1)>9-ut.wb&&(bt=9-ut.wb),1>bt&&(bt=1),pt.dd=bt,pt.tc=2*xt+bt,pt.ld=40<=xt?2:15<=xt?1:0}else pt.tc=0;pt.La=Q}}}$=0}else Xe(F,6,"Frame setup failed"),$=F.a;if($=$==0){if($){F.$c=0,0F.Vb){if(F.Vb=0,F.Ec=a(pt),F.Fc=0,F.Ec==null){$=Xe(F,1,"no memory during frame initialization.");break e}F.Vb=pt}pt=F.Ec,xt=F.Fc,F.Ac=pt,F.Bc=xt,xt+=ut,F.Gd=c(Rt,Wa),F.Hd=0,F.rb=c(Pt+1,sa),F.sb=1,F.wa=re?c(re,Un):null,F.Y=0,F.D.Nb=0,F.D.wa=F.wa,F.D.Y=F.Y,0=$;++$)ll[255+$]=0>$?-$:$;for($=-1020;1020>=$;++$)ul[1020+$]=-128>$?-128:127<$?127:$;for($=-112;112>=$;++$)fl[112+$]=-16>$?-16:15<$?15:$;for($=-255;510>=$;++$)hl[255+$]=0>$?0:255<$?255:$;cl=1}Ur=Ja,Sr=Rs,Xi=Ts,pn=Ds,cr=lr,zr=Ya,Pe=$a,Ie=Za,We=ts,Qe=u,kr=Qa,xa=oi,$i=v,rs=I,el=Ui,nl=pa,rl=zi,il=Xa,Xn[0]=Gs,Xn[1]=Ti,Xn[2]=Ws,Xn[3]=Vs,Xn[4]=Ys,Xn[5]=xr,Xn[6]=Js,Xn[7]=_r,Xn[8]=Xs,Xn[9]=Ks,Hr[0]=Ka,Hr[1]=qs,Hr[2]=Us,Hr[3]=zs,Hr[4]=Mr,Hr[5]=Hs,Hr[6]=ai,Pr[0]=$s,Pr[1]=ua,Pr[2]=Di,Pr[3]=fa,Pr[4]=Zs,Pr[5]=qi,Pr[6]=ha,$=1}else $=0}$&&($=function(ce,tn){for(ce.M=0;ce.Mpe;++pe){var en,me=_n[0+pe];for(en=0;4>en;++en){me=Xf[Ee[ln+en]][me];for(var we=ml[gt(ee,me[0])];0>3;for(we=0;256>we;we+=16)pe[gn+we]=Sn}un=1,$n=ln[0]}var Le=15&ee.la,nn=15&An.la;for(we=0;4>we;++we){var Fn=1&nn;for(Sn=ye=0;4>Sn;++Sn)Le=Le>>1|(Fn=(Ge=Aa(Ee,$n,Ge=Fn+(1&Le),qe.Sc,un,pe,gn))>un)<<7,ye=ye<<2|(3>=4,nn=nn>>1|Fn<<7,en=(en<<8|ye)>>>0}for($n=Le,un=nn>>4,Ue=0;4>Ue;Ue+=2){for(ye=0,Le=ee.la>>4+Ue,nn=An.la>>4+Ue,we=0;2>we;++we){for(Fn=1&nn,Sn=0;2>Sn;++Sn)Ge=Fn+(1&Le),Le=Le>>1|(Fn=0<(Ge=Aa(Ee,ln[2],Ge,qe.Qc,0,pe,gn)))<<3,ye=ye<<2|(3>=2,nn=nn>>1|Fn<<5}me|=ye<<4*Ue,$n|=Le<<4<=jt.zb&&jt.M<=jt.Va,jt.Aa==0)e:{if(ie.M=jt.M,ie.uc=ee,Vi(jt,ie),Ve=1,ie=(ye=jt.D).Nb,ee=(me=cs[jt.L])*jt.R,Ee=me/2*jt.B,we=16*ie*jt.R,Sn=8*ie*jt.B,ln=jt.sa,_n=jt.ta-ee+we,qe=jt.qa,pe=jt.ra-Ee+Sn,gn=jt.Ha,An=jt.Ia-Ee+Sn,nn=(Le=ye.M)==0,en=Le>=jt.Va-1,jt.Aa==2&&Vi(jt,ye),ye.uc)for(Fn=(Ge=jt).D.M,e(Ge.D.uc),ye=Ge.yb;yeNt.o&&(Le=Nt.o),Nt.F=null,Nt.J=null,jt.Fa!=null&&0>1),Nt.W+=jt.B*(me>>1),Nt.F!=null&&(Nt.J+=Nt.width*me)),ye>1,Nt.W+=Nt.v>>1,Nt.F!=null&&(Nt.J+=Nt.v),Nt.ka=ye-Nt.j,Nt.U=Nt.va-Nt.v,Nt.T=Le-ye,Ve=Nt.put(Nt))}ie+1!=jt.Ic||en||(i(jt.sa,jt.ta-ee,ln,_n+16*jt.R,ee),i(jt.qa,jt.ra-Ee,qe,pe+8*jt.B,Ee),i(jt.Ha,jt.Ia-Ee,gn,An+8*jt.B,Ee))}if(!Ve)return Xe(ce,6,"Output aborted.")}return 1}(F,Y)),Y.bc!=null&&Y.bc(Y),$&=1}return $?(F.cb=0,$):0})(r,g)||(o=r.a)}}else o=r.a}o==0&&y.Oa!=null&&y.Oa.fd&&(o=di(y.ba))}y=o}w=y!=0?null:11>w?A.f.RGBA.eb:A.f.kb.y}else w=null;return w};var Nl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function d(R,tt){for(var N="",E=0;E<4;E++)N+=String.fromCharCode(R[tt++]);return N}function m(R,tt){return R[tt+0]|R[tt+1]<<8}function _(R,tt){return(R[tt+0]|R[tt+1]<<8|R[tt+2]<<16)>>>0}function k(R,tt){return(R[tt+0]|R[tt+1]<<8|R[tt+2]<<16|R[tt+3]<<24)>>>0}new h;var p=[0],j=[0],O=[],M=new h,S=n,V=function(R,tt){var N={},E=0,z=!1,U=0,rt=0;if(N.frames=[],!function(x,B){for(var T=0;T<4;T++)if(x[B+T]!="RIFF".charCodeAt(T))return!0;return!1}(R,tt)){for(k(R,tt+=4),tt+=8;tt>1&1}ot!="ANMF"&&(tt+=nt)}return N}}(S,0);V.response=S,V.rgbaoutput=!0,V.dataurl=!1;var G=V.header?V.header:null,q=V.frames?V.frames:null;if(G){G.loop_counter=G.loop_count,p=[G.canvas_height],j=[G.canvas_width];for(var it=0;it'+t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")+"",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+n.length+" >>"),this.internal.write("stream"),this.internal.write(n),this.internal.write("endstream"),this.internal.write("endobj")}function t2(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(n){var e,t,i,s,a,c,l,h,d,m=function(x){return x=x||{},this.isStrokeTransparent=x.isStrokeTransparent||!1,this.strokeOpacity=x.strokeOpacity||1,this.strokeStyle=x.strokeStyle||"#000000",this.fillStyle=x.fillStyle||"#000000",this.isFillTransparent=x.isFillTransparent||!1,this.fillOpacity=x.fillOpacity||1,this.font=x.font||"10px sans-serif",this.textBaseline=x.textBaseline||"alphabetic",this.textAlign=x.textAlign||"left",this.lineWidth=x.lineWidth||1,this.lineJoin=x.lineJoin||"miter",this.lineCap=x.lineCap||"butt",this.path=x.path||[],this.transform=x.transform!==void 0?x.transform.clone():new h,this.globalCompositeOperation=x.globalCompositeOperation||"normal",this.globalAlpha=x.globalAlpha||1,this.clip_path=x.clip_path||[],this.currentPoint=x.currentPoint||new c,this.miterLimit=x.miterLimit||10,this.lastPoint=x.lastPoint||new c,this.lineDashOffset=x.lineDashOffset||0,this.lineDash=x.lineDash||[],this.margin=x.margin||[0,0,0,0],this.prevPageLastElemOffset=x.prevPageLastElemOffset||0,this.ignoreClearRect=typeof x.ignoreClearRect!="boolean"||x.ignoreClearRect,this};n.events.push(["initialized",function(){this.context2d=new _(this),e=this.internal.f2,t=this.internal.getCoordinateString,i=this.internal.getVerticalCoordinateString,s=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,c=this.internal.Point,l=this.internal.Rectangle,h=this.internal.Matrix,d=new m}]);var _=function(x){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var B=x;Object.defineProperty(this,"pdf",{get:function(){return B}});var T=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return T},set:function(P){T=!!P}});var H=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return H},set:function(P){H=!!P}});var J=0;Object.defineProperty(this,"posX",{get:function(){return J},set:function(P){isNaN(P)||(J=P)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(P){isNaN(P)||(Z=P)}}),Object.defineProperty(this,"margin",{get:function(){return d.margin},set:function(P){var Lt;typeof P=="number"?Lt=[P,P,P,P]:((Lt=new Array(4))[0]=P[0],Lt[1]=P.length>=2?P[1]:Lt[0],Lt[2]=P.length>=3?P[2]:Lt[0],Lt[3]=P.length>=4?P[3]:Lt[1]),d.margin=Lt}});var at=!1;Object.defineProperty(this,"autoPaging",{get:function(){return at},set:function(P){at=P}});var st=0;Object.defineProperty(this,"lastBreak",{get:function(){return st},set:function(P){st=P}});var gt=[];Object.defineProperty(this,"pageBreaks",{get:function(){return gt},set:function(P){gt=P}}),Object.defineProperty(this,"ctx",{get:function(){return d},set:function(P){P instanceof m&&(d=P)}}),Object.defineProperty(this,"path",{get:function(){return d.path},set:function(P){d.path=P}});var _t=[];Object.defineProperty(this,"ctxStack",{get:function(){return _t},set:function(P){_t=P}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(P){var Lt;Lt=k(P),this.ctx.fillStyle=Lt.style,this.ctx.isFillTransparent=Lt.a===0,this.ctx.fillOpacity=Lt.a,this.pdf.setFillColor(Lt.r,Lt.g,Lt.b,{a:Lt.a}),this.pdf.setTextColor(Lt.r,Lt.g,Lt.b,{a:Lt.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(P){var Lt=k(P);this.ctx.strokeStyle=Lt.style,this.ctx.isStrokeTransparent=Lt.a===0,this.ctx.strokeOpacity=Lt.a,Lt.a===0?this.pdf.setDrawColor(255,255,255):(Lt.a,this.pdf.setDrawColor(Lt.r,Lt.g,Lt.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(P){["butt","round","square"].indexOf(P)!==-1&&(this.ctx.lineCap=P,this.pdf.setLineCap(P))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(P){isNaN(P)||(this.ctx.lineWidth=P,this.pdf.setLineWidth(P))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(P){["bevel","round","miter"].indexOf(P)!==-1&&(this.ctx.lineJoin=P,this.pdf.setLineJoin(P))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(P){isNaN(P)||(this.ctx.miterLimit=P,this.pdf.setMiterLimit(P))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(P){this.ctx.textBaseline=P}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(P){["right","end","center","left","start"].indexOf(P)!==-1&&(this.ctx.textAlign=P)}});var kt=null,St=null,Dt=null;Object.defineProperty(this,"fontFaces",{get:function(){return Dt},set:function(P){kt=null,St=null,Dt=P}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(P){var Lt;if(this.ctx.font=P,(Lt=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(P))!==null){var ae=Lt[1];Lt[2];var Ht=Lt[3],yt=Lt[4];Lt[5];var Wt=Lt[6],Ct=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(yt)[2];yt=Math.floor(Ct==="px"?parseFloat(yt)*this.pdf.internal.scaleFactor:Ct==="em"?parseFloat(yt)*this.pdf.getFontSize():parseFloat(yt)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(yt);var zt=function(Tt){var He,ge,se=[],oe=Tt.trim();if(oe==="")return Mo;if(oe in Ou)return[Ou[oe]];for(;oe!=="";){switch(ge=null,He=(oe=Bu(oe)).charAt(0)){case'"':case"'":ge=Y1(oe.substring(1),He);break;default:ge=J1(oe)}if(ge===null||(se.push(ge[0]),(oe=Bu(ge[1]))!==""&&oe.charAt(0)!==","))return Mo;oe=oe.replace(/^,/,"")}return se}(Wt);if(this.fontFaces){var qt=function(Tt,He){var ge=Tt.getFontList(),se=JSON.stringify(ge);if(kt===null||St!==se){var oe=function(je){var Ut=[];return Object.keys(je).forEach(function(ke){je[ke].forEach(function(Yt){var Qt=null;switch(Yt){case"bold":Qt={family:ke,weight:"bold"};break;case"italic":Qt={family:ke,style:"italic"};break;case"bolditalic":Qt={family:ke,weight:"bold",style:"italic"};break;case"":case"normal":Qt={family:ke}}Qt!==null&&(Qt.ref={name:ke,style:Yt},Ut.push(Qt))})}),Ut}(ge);kt=function(je){for(var Ut={},ke=0;ke=700||ae==="bold")&&(Zt="bold"),ae==="italic"&&(Zt+="italic"),Zt.length===0&&(Zt="normal");for(var he="",fe={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Bt=0;Bt=2*Math.PI&&(H=0,J=2*Math.PI),this.path.push({type:"arc",x,y:B,radius:T,startAngle:H,endAngle:J,counterclockwise:Z})},_.prototype.arcTo=function(x,B,T,H,J){throw new Error("arcTo not implemented.")},_.prototype.rect=function(x,B,T,H){if(isNaN(x)||isNaN(B)||isNaN(T)||isNaN(H))throw Se.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(x,B),this.lineTo(x+T,B),this.lineTo(x+T,B+H),this.lineTo(x,B+H),this.lineTo(x,B),this.lineTo(x+T,B),this.lineTo(x,B)},_.prototype.fillRect=function(x,B,T,H){if(isNaN(x)||isNaN(B)||isNaN(T)||isNaN(H))throw Se.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var J={};this.lineCap!=="butt"&&(J.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(J.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(x,B,T,H),this.fill(),J.hasOwnProperty("lineCap")&&(this.lineCap=J.lineCap),J.hasOwnProperty("lineJoin")&&(this.lineJoin=J.lineJoin)}},_.prototype.strokeRect=function(x,B,T,H){if(isNaN(x)||isNaN(B)||isNaN(T)||isNaN(H))throw Se.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");j.call(this)||(this.beginPath(),this.rect(x,B,T,H),this.stroke())},_.prototype.clearRect=function(x,B,T,H){if(isNaN(x)||isNaN(B)||isNaN(T)||isNaN(H))throw Se.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(x,B,T,H))},_.prototype.save=function(x){x=typeof x!="boolean"||x;for(var B=this.pdf.internal.getCurrentPageInfo().pageNumber,T=0;T0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};_.prototype.drawImage=function(x,B,T,H,J,Z,at,st,gt){var _t=this.pdf.getImageProperties(x),kt=1,St=1,Dt=1,P=1;H!==void 0&&st!==void 0&&(Dt=st/H,P=gt/J,kt=_t.width/H*st/H,St=_t.height/J*gt/J),Z===void 0&&(Z=B,at=T,B=0,T=0),H!==void 0&&st===void 0&&(st=H,gt=J),H===void 0&&st===void 0&&(st=_t.width,gt=_t.height);var Lt=this.ctx.transform.decompose(),ae=nt(Lt.rotate.shx),Ht=new h,yt=(Ht=(Ht=(Ht=Ht.multiply(Lt.translate)).multiply(Lt.skew)).multiply(Lt.scale)).applyToRectangle(new l(Z-B*Dt,at-T*P,H*kt,J*St));if(this.autoPaging){for(var Wt,Ct=M.call(this,yt),zt=[],qt=0;qtve||Ztyt||Ct0)){for(;gt>=0;gt--)if(J[gt-1].close!==!0&&J[gt-1].begin!==!0){J[gt-1].deltas.push(T),J[gt-1].abs.push(st);break}}break;case"bct":T=[st.x1-Z[at-1].x,st.y1-Z[at-1].y,st.x2-Z[at-1].x,st.y2-Z[at-1].y,st.x-Z[at-1].x,st.y-Z[at-1].y],J[J.length-1].deltas.push(T);break;case"qct":var _t=Z[at-1].x+2/3*(st.x1-Z[at-1].x),kt=Z[at-1].y+2/3*(st.y1-Z[at-1].y),St=st.x+2/3*(st.x1-st.x),Dt=st.y+2/3*(st.y1-st.y),P=st.x,Lt=st.y;T=[_t-Z[at-1].x,kt-Z[at-1].y,St-Z[at-1].x,Dt-Z[at-1].y,P-Z[at-1].x,Lt-Z[at-1].y],J[J.length-1].deltas.push(T);break;case"arc":J.push({deltas:[],abs:[],arc:!0}),Array.isArray(J[J.length-1].abs)&&J[J.length-1].abs.push(st)}}H=B?null:x==="stroke"?"stroke":"fill";for(var ae=!1,Ht=0;Ht=.01&&(H=this.pdf.internal.getFontSize(),this.pdf.setFontSize(H*x.scale),J=this.lineWidth,this.lineWidth=J*x.scale);var ne=this.autoPaging!=="text";if(ne||Bt.y+Bt.h<=qt){if(ne||Bt.y>=Ct&&Bt.x<=ue){var Tt=ne?x.text:this.pdf.splitTextToSize(x.text,x.maxWidth||ue-Bt.x)[0],He=V([JSON.parse(JSON.stringify(St))],this.posX+this.margin[3],-he+Ct+this.ctx.prevPageLastElemOffset)[0],ge=ne&&(Wt>Ht||Wt=.01&&(this.pdf.setFontSize(H),this.lineWidth=J)}}else x.scale>=.01&&(H=this.pdf.internal.getFontSize(),this.pdf.setFontSize(H*x.scale),J=this.lineWidth,this.lineWidth=J*x.scale),this.pdf.text(x.text,gt.x+this.posX,gt.y+this.posY,{angle:x.angle,align:B,renderingMode:x.renderingMode,maxWidth:x.maxWidth}),x.scale>=.01&&(this.pdf.setFontSize(H),this.lineWidth=J)},z=function(x,B,T,H){T=T||0,H=H||0,this.pdf.internal.out(t(x+T)+" "+i(B+H)+" l")},U=function(x,B,T){return this.pdf.lines(x,B,T,null,null)},rt=function(x,B,T,H,J,Z,at,st){this.pdf.internal.out([e(s(T+x)),e(a(H+B)),e(s(J+x)),e(a(Z+B)),e(s(at+x)),e(a(st+B)),"c"].join(" "))},ot=function(x,B,T,H){for(var J=2*Math.PI,Z=Math.PI/2;B>T;)B-=J;var at=Math.abs(T-B);at1e-5;){var kt=_t+gt*Math.min(at,Z);st.push(ft.call(this,x,_t,kt)),at-=Math.abs(kt-_t),_t=kt}return st},ft=function(x,B,T){var H=(T-B)/2,J=x*Math.cos(H),Z=x*Math.sin(H),at=J,st=-Z,gt=at*at+st*st,_t=gt+at*J+st*Z,kt=4/3*(Math.sqrt(2*gt*_t)-_t)/(at*Z-st*J),St=at-kt*st,Dt=st+kt*at,P=St,Lt=-Dt,ae=H+B,Ht=Math.cos(ae),yt=Math.sin(ae);return{x1:x*Math.cos(B),y1:x*Math.sin(B),x2:St*Ht-Dt*yt,y2:St*yt+Dt*Ht,x3:P*Ht-Lt*yt,y3:P*yt+Lt*Ht,x4:x*Math.cos(T),y4:x*Math.sin(T)}},nt=function(x){return 180*x/Math.PI},ct=function(x,B,T,H,J,Z){var at=x+.5*(T-x),st=B+.5*(H-B),gt=J+.5*(T-J),_t=Z+.5*(H-Z),kt=Math.min(x,J,at,gt),St=Math.max(x,J,at,gt),Dt=Math.min(B,Z,st,_t),P=Math.max(B,Z,st,_t);return new l(kt,Dt,St-kt,P-Dt)},At=function(x,B,T,H,J,Z,at,st){var gt,_t,kt,St,Dt,P,Lt,ae,Ht,yt,Wt,Ct,zt,qt,ve=T-x,ue=H-B,Zt=J-T,he=Z-H,fe=at-J,Bt=st-Z;for(_t=0;_t<41;_t++)Ht=(Lt=(kt=x+(gt=_t/40)*ve)+gt*((Dt=T+gt*Zt)-kt))+gt*(Dt+gt*(J+gt*fe-Dt)-Lt),yt=(ae=(St=B+gt*ue)+gt*((P=H+gt*he)-St))+gt*(P+gt*(Z+gt*Bt-P)-ae),_t==0?(Wt=Ht,Ct=yt,zt=Ht,qt=yt):(Wt=Math.min(Wt,Ht),Ct=Math.min(Ct,yt),zt=Math.max(zt,Ht),qt=Math.max(qt,yt));return new l(Math.round(Wt),Math.round(Ct),Math.round(zt-Wt),Math.round(qt-Ct))},wt=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var x,B,T=(x=this.ctx.lineDash,B=this.ctx.lineDashOffset,JSON.stringify({lineDash:x,lineDashOffset:B}));this.prevLineDash!==T&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=T)}}})(Mt.API),function(n){var e=function(c){var l,h,d,m,_,k,p,j,O,M;for(h=[],d=0,m=(c+=l="\0\0\0\0".slice(c.length%4||4)).length;m>d;d+=4)(_=(c.charCodeAt(d)<<24)+(c.charCodeAt(d+1)<<16)+(c.charCodeAt(d+2)<<8)+c.charCodeAt(d+3))!==0?(k=(_=((_=((_=((_=(_-(M=_%85))/85)-(O=_%85))/85)-(j=_%85))/85)-(p=_%85))/85)%85,h.push(k+33,p+33,j+33,O+33,M+33)):h.push(122);return function(S,V){for(var G=V;G>0;G--)S.pop()}(h,l.length),String.fromCharCode.apply(String,h)+"~>"},t=function(c){var l,h,d,m,_,k=String,p="length",j=255,O="charCodeAt",M="slice",S="replace";for(c[M](-2),c=c[M](0,-2)[S](/\s/g,"")[S]("z","!!!!!"),d=[],m=0,_=(c+=l="uuuuu"[M](c[p]%5||5))[p];_>m;m+=5)h=52200625*(c[O](m)-33)+614125*(c[O](m+1)-33)+7225*(c[O](m+2)-33)+85*(c[O](m+3)-33)+(c[O](m+4)-33),d.push(j&h>>24,j&h>>16,j&h>>8,j&h);return function(V,G){for(var q=G;q>0;q--)V.pop()}(d,l[p]),k.fromCharCode.apply(k,d)},i=function(c){return c.split("").map(function(l){return("0"+l.charCodeAt().toString(16)).slice(-2)}).join("")+">"},s=function(c){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((c=c.replace(/\s/g,"")).indexOf(">")!==-1&&(c=c.substr(0,c.indexOf(">"))),c.length%2&&(c+="0"),l.test(c)===!1)return"";for(var h="",d=0;dimport("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function t(){return(Kt.DOMPurify?Promise.resolve(Kt.DOMPurify):vo(()=>import("./purify.es-BgtpMKW3.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var i=function(l){var h=_e(l);return h==="undefined"?"undefined":h==="string"||l instanceof String?"string":h==="number"||l instanceof Number?"number":h==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":h==="object"?"object":"unknown"},s=function(l,h){var d=document.createElement(l);for(var m in h.className&&(d.className=h.className),h.innerHTML&&h.dompurify&&(d.innerHTML=h.dompurify.sanitize(h.innerHTML)),h.style)d.style[m]=h.style[m];return d},a=function l(h,d){for(var m=h.nodeType===3?document.createTextNode(h.nodeValue):h.cloneNode(!1),_=h.firstChild;_;_=_.nextSibling)d!==!0&&_.nodeType===1&&_.nodeName==="SCRIPT"||m.appendChild(l(_,d));return h.nodeType===1&&(h.nodeName==="CANVAS"?(m.width=h.width,m.height=h.height,m.getContext("2d").drawImage(h,0,0)):h.nodeName!=="TEXTAREA"&&h.nodeName!=="SELECT"||(m.value=h.value),m.addEventListener("load",function(){m.scrollTop=h.scrollTop,m.scrollLeft=h.scrollLeft},!0)),m},c=function l(h){var d=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),m=l.convert(Promise.resolve(),d);return(m=m.setProgress(1,l,1,[l])).set(h)};(c.prototype=Object.create(Promise.prototype)).constructor=c,c.convert=function(l,h){return l.__proto__=h||c.prototype,l},c.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},c.prototype.from=function(l,h){return this.then(function(){switch(h=h||function(d){switch(i(d)){case"string":return"string";case"element":return d.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(l),h){case"string":return this.then(t).then(function(d){return this.set({src:s("div",{innerHTML:l,dompurify:d})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},c.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},c.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},h=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);h.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=s("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=s("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(h),this.prop.container.firstChild.appendChild(s("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},c.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(e).then(function(h){var d=Object.assign({},this.opt.html2canvas);return delete d.onrendered,h(this.prop.container,d)}).then(function(h){(this.opt.html2canvas.onrendered||function(){})(h),this.prop.canvas=h,document.body.removeChild(this.prop.overlay)})},c.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(e).then(function(h){var d=this.opt.jsPDF,m=this.opt.fontFaces,_=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,k=Object.assign({async:!0,allowTaint:!0,scale:_,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete k.onrendered,d.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,d.context2d.posX=this.opt.x,d.context2d.posY=this.opt.y,d.context2d.margin=this.opt.margin,d.context2d.fontFaces=m,m)for(var p=0;pO&&(j=M,M=O,O=j);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",O>M&&(j=M,M=O,O=j)}return{width:M,height:O,unit:h,k:_,orientation:l}},n.html=function(l,h){(h=h||{}).callback=h.callback||function(){},h.html2canvas=h.html2canvas||{},h.html2canvas.canvas=h.html2canvas.canvas||this.canvas,h.jsPDF=h.jsPDF||this,h.fontFaces=h.fontFaces?h.fontFaces.map(Bo):null;var d=new c(h);return h.worker?d:d.from(l).doCallback()}}(Mt.API),Mt.API.addJS=function(n){var e,t,i=function(s){for(var a="",c=0;c=0&&s[d]==="\\";d--)h++;a+=h%2==0?"\\"+l:l}else a+=l}return a}(n);return this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+i+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e!==void 0&&t!==void 0&&this.internal.out("/Names <>")}),this},function(n){var e;n.events.push(["postPutResources",function(){var t=this,i=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var s=t.outline.render().split(/\r\n/),a=0;a> endobj")}var p=t.internal.newObject();for(t.internal.write("<< /Names [ "),a=0;a>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+p+" 0 R"),t.internal.write(">>","endobj")}}]),n.events.push(["putCatalog",function(){var t=this;t.outline.root.children.length>0&&(t.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&t.internal.write("/Names "+e+" 0 R"))}]),n.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(i,s,a){var c={title:s,options:a,children:[]};return i==null&&(i=this.root),i.children.push(c),c},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(i){i.id=t.internal.newObjectDeferred();for(var s=0;s0&&(this.line("/First "+this.makeRef(i.children[0])),this.line("/Last "+this.makeRef(i.children[i.children.length-1]))),this.line("/Count "+this.count_r({count:0},i)),this.objEnd()},t.outline.renderItems=function(i){for(var s=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a0&&this.line("/Prev "+this.makeRef(i.children[a-1])),a0&&(this.line("/First "+this.makeRef(c.children[0])),this.line("/Last "+this.makeRef(c.children[c.children.length-1])));var l=this.count=this.count_r({count:0},c);if(l>0&&this.line("/Count "+l),c.options&&c.options.pageNumber){var h=t.internal.getPageInfo(c.options.pageNumber);this.line("/Dest ["+h.objId+" 0 R /XYZ 0 "+s(0)+" 0]")}this.objEnd()}for(var d=0;d> \r -endobj\r -`},t.outline.count_r=function(i,s){for(var a=0;a1){U=!0,ot=void 0;var J=R*tt;ft=new Uint8Array(J);for(var Z=new DataView(N.buffer),at=0;at536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(e);try{this[n]()}catch(t){Se.log("bit decode error:"+t)}},Qn.prototype.bit1=function(){var n,e=Math.ceil(this.width/8),t=e%4;for(n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,s=0;s>7-l&1];this.data[c+4*l]=h.blue,this.data[c+4*l+1]=h.green,this.data[c+4*l+2]=h.red,this.data[c+4*l+3]=255}t!==0&&(this.pos+=4-t)}},Qn.prototype.bit4=function(){for(var n=Math.ceil(this.width/2),e=n%4,t=this.height-1;t>=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>4,h=15&a,d=this.palette[l];if(this.data[c]=d.blue,this.data[c+1]=d.green,this.data[c+2]=d.red,this.data[c+3]=255,2*s+1>=this.width)break;d=this.palette[h],this.data[c+4]=d.blue,this.data[c+4+1]=d.green,this.data[c+4+2]=d.red,this.data[c+4+3]=255}e!==0&&(this.pos+=4-e)}},Qn.prototype.bit8=function(){for(var n=this.width%4,e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,i=0;i=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>5&e)/e*255|0,h=(a>>10&e)/e*255|0,d=a>>15?255:0,m=i*this.width*4+4*s;this.data[m]=h,this.data[m+1]=l,this.data[m+2]=c,this.data[m+3]=d}this.pos+=n}},Qn.prototype.bit16=function(){for(var n=this.width%3,e=parseInt("11111",2),t=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var s=this.bottom_up?i:this.height-1-i,a=0;a>5&t)/t*255|0,d=(c>>11)/e*255|0,m=s*this.width*4+4*a;this.data[m]=d,this.data[m+1]=h,this.data[m+2]=l,this.data[m+3]=255}this.pos+=n}},Qn.prototype.bit24=function(){for(var n=this.height-1;n>=0;n--){for(var e=this.bottom_up?n:this.height-1-n,t=0;t=0;n--)for(var e=this.bottom_up?n:this.height-1-n,t=0;ti&&(s.push(n.slice(h,a)),l=0,h=a),l+=e[a],a++;return h!==a&&s.push(n.slice(h,a)),s},Tu=function(n,e,t){t||(t={});var i,s,a,c,l,h,d,m=[],_=[m],k=t.textIndent||0,p=0,j=0,O=n.split(" "),M=ks.apply(this,[" ",t])[0];if(h=t.lineIndent===-1?O[0].length+2:t.lineIndent||0){var S=Array(h).join(" "),V=[];O.map(function(q){(q=q.split(/\s*\n/)).length>1?V=V.concat(q.map(function(it,vt){return(vt&&it.length?` -`:"")+it})):V.push(q[0])}),O=V,h=Mu.apply(this,[S,t])}for(a=0,c=O.length;ae||G){if(j>e){for(l=Ru.apply(this,[i,s,e-(k+p),e]),m.push(l.shift()),m=[l.pop()];l.length;)_.push([l.shift()]);j=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(q,it){return q+it},0)}else m=[i];_.push(m),k=j+h,p=M}else m.push(i),k+=p+j,p=M}return d=h?function(q,it){return(it?S:"")+q.join(" ")}:function(q){return q.join(" ")},_.map(d)},ea.splitTextToSize=function(n,e,t){var i,s=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var _=this.internal.getFont(m.fontName,m.fontStyle),k="Unicode";return _.metadata[k]?{widths:_.metadata[k].widths||{0:1},kerning:_.metadata[k].kerning||{}}:{font:_.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);i=Array.isArray(n)?n:String(n).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/s;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=t.lineIndent;var l,h,d=[];for(l=0,h=i.length;limport("./index.es-DQ6YK4So.js"),__vite__mapDeps([0,1,2]))).catch(function(k){return Promise.reject(new Error("Could not load canvg: "+k))}).then(function(k){return k.default?k.default:k}).then(function(k){return k.fromString(d,n,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(k){return k.render(m)}).then(function(){_.addImage(h.toDataURL("image/jpeg",1),e,t,i,s,c,l)})},Mt.API.putTotalPages=function(n){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(n,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(n,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s1){for(m=0;m>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},Mt.API.addMetadata=function(n,e){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceUri:e??"http://jspdf.default.namespaceuri/",rawXml:typeof e=="boolean"&&e},this.internal.events.subscribe("putCatalog",t2),this.internal.events.subscribe("postPutResources",Q1)),this},function(n){var e=n.API,t=e.pdfEscape16=function(a,c){for(var l,h=c.metadata.Unicode.widths,d=["","0","00","000","0000"],m=[""],_=0,k=a.length;_> def -/CMapName /Adobe-Identity-UCS def -/CMapType 2 def -1 begincodespacerange -<0000> -endcodespacerange`,h=[],_=0,k=(l=Object.keys(a).sort(function(p,j){return p-j})).length;_=100&&(m+=` -`+h.length+` beginbfchar -`+h.join(` -`)+` -endbfchar`,h=[]),a[c]!==void 0&&a[c]!==null&&typeof a[c].toString=="function"&&(d=("0000"+a[c].toString(16)).slice(-4),c=("0000"+(+c).toString(16)).slice(-4),h.push("<"+c+"><"+d+">"));return h.length&&(m+=` -`+h.length+` beginbfchar -`+h.join(` -`)+` -endbfchar -`),m+`endcmap -CMapName currentdict /CMap defineresource pop -end -end`};e.events.push(["putFont",function(a){(function(c){var l=c.font,h=c.out,d=c.newObject,m=c.putStream;if(l.metadata instanceof n.API.TTFFont&&l.encoding==="Identity-H"){for(var _=l.metadata.Unicode.widths,k=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),p="",j=0;j>"),h("endobj");var V=d();h("<<"),h("/Type /Font"),h("/BaseFont /"+ra(l.fontName)),h("/FontDescriptor "+S+" 0 R"),h("/W "+n.API.PDFObject.convert(_)),h("/CIDToGIDMap /Identity"),h("/DW 1000"),h("/Subtype /CIDFontType2"),h("/CIDSystemInfo"),h("<<"),h("/Supplement 0"),h("/Registry (Adobe)"),h("/Ordering ("+l.encoding+")"),h(">>"),h(">>"),h("endobj"),l.objectNumber=d(),h("<<"),h("/Type /Font"),h("/Subtype /Type0"),h("/ToUnicode "+M+" 0 R"),h("/BaseFont /"+ra(l.fontName)),h("/Encoding /"+l.encoding),h("/DescendantFonts ["+V+" 0 R]"),h(">>"),h("endobj"),l.isAlreadyPutted=!0}})(a)}]),e.events.push(["putFont",function(a){(function(c){var l=c.font,h=c.out,d=c.newObject,m=c.putStream;if(l.metadata instanceof n.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var _=l.metadata.rawData,k="",p=0;p<_.length;p++)k+=String.fromCharCode(_[p]);var j=d();m({data:k,addLength1:!0,objectId:j}),h("endobj");var O=d();m({data:i(l.metadata.toUnicode),addLength1:!0,objectId:O}),h("endobj");var M=d();h("<<"),h("/Descent "+l.metadata.decender),h("/CapHeight "+l.metadata.capHeight),h("/StemV "+l.metadata.stemV),h("/Type /FontDescriptor"),h("/FontFile2 "+j+" 0 R"),h("/Flags 96"),h("/FontBBox "+n.API.PDFObject.convert(l.metadata.bbox)),h("/FontName /"+ra(l.fontName)),h("/ItalicAngle "+l.metadata.italicAngle),h("/Ascent "+l.metadata.ascender),h(">>"),h("endobj"),l.objectNumber=d();for(var S=0;S>"),h("endobj"),l.isAlreadyPutted=!0}})(a)}]);var s=function(a){var c,l=a.text||"",h=a.x,d=a.y,m=a.options||{},_=a.mutex||{},k=_.pdfEscape,p=_.activeFontKey,j=_.fonts,O=p,M="",S=0,V="",G=j[O].encoding;if(j[O].encoding!=="Identity-H")return{text:l,x:h,y:d,options:m,mutex:_};for(V=l,O=p,Array.isArray(l)&&(V=l[0]),S=0;S","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],S=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),V=!1,G=0;this.__bidiEngine__={};var q=function(N){var E=N.charCodeAt(),z=E>>8,U=O[z];return U!==void 0?_[256*U+(255&E)]:z===252||z===253?"AL":S.test(z)?"L":z===8?"R":"N"},it=function(N){for(var E,z=0;z=E.length||(rt=z[U-1])!=="EN"&&rt!=="AN"||(ot=E[U+1])!=="EN"&&ot!=="AN"?ct="N":V&&(ot="AN"),ct=ot===rt?ot:"N";break;case"ES":ct=(rt=U>0?z[U-1]:"B")==="EN"&&U+10&&z[U-1]==="EN"){ct="EN";break}if(V){ct="N";break}for(ft=U+1,nt=E.length;ft=1425&&At<=2303||At===64286;if(rt=E[ft],wt&&(rt==="R"||rt==="AL")){ct="R";break}}}ct=U<1||(rt=E[U-1])==="B"?"N":z[U-1];break;case"B":V=!1,s=!0,ct=G;break;case"S":a=!0,ct="N"}return ct},dt=function(N,E,z){var U=N.split("");return z&&X(U,z,{hiLevel:G}),U.reverse(),E&&E.reverse(),U.join("")},X=function(N,E,z){var U,rt,ot,ft,nt,ct=-1,At=N.length,wt=0,x=[],B=G?p:k,T=[];for(V=!1,s=!1,a=!1,rt=0;rt0)if(U===16){for(rt=ct;rt-1){for(rt=ct;rt=0&&H[st]==="WS";st--)J[st]=G}}(T,E,At)},R=function(N,E,z,U,rt){if(!(rt.hiLevel=N){for(nt=wt+1;nt=N;)nt++;for(ct=wt,ft=nt-1;ct=0&&(ot[At]=M[ct+1])}(U,z,rt),R(2,U,E,z,rt),R(1,U,E,z,rt),U.join("")};return this.__bidiEngine__.doBidiReorder=function(N,E,z){if(function(rt,ot){if(ot)for(var ft=0;ft>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+i)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},n.prototype.characterToGlyph=function(e){var t;return((t=this.cmap.unicode)!=null?t.codeMap[e]:void 0)||0},n.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},n.prototype.widthOfString=function(e,t,i){var s,a,c,l;for(c=0,a=0,l=(e=""+e).length;0<=l?al;a=0<=l?++a:--a)s=e.charCodeAt(a),c+=this.widthOfGlyph(this.characterToGlyph(s))+i*(1e3/t)||0;return c*(t/1e3)},n.prototype.lineHeight=function(e,t){var i;return t==null&&(t=!1),i=t?this.lineGap:0,(this.ascender+i-this.decender)/1e3*e},n}();var nr,ti=function(){function n(e){this.data=e??[],this.pos=0,this.length=this.data.length}return n.prototype.readByte=function(){return this.data[this.pos++]},n.prototype.writeByte=function(e){return this.data[this.pos++]=e},n.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},n.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},n.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},n.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},n.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},n.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},n.prototype.readString=function(e){var t,i;for(i=[],t=0;0<=e?te;t=0<=e?++t:--t)i[t]=String.fromCharCode(this.readByte());return i.join("")},n.prototype.writeString=function(e){var t,i,s;for(s=[],t=0,i=e.length;0<=i?ti;t=0<=i?++t:--t)s.push(this.writeByte(e.charCodeAt(t)));return s},n.prototype.readShort=function(){return this.readInt16()},n.prototype.writeShort=function(e){return this.writeInt16(e)},n.prototype.readLongLong=function(){var e,t,i,s,a,c,l,h;return e=this.readByte(),t=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),c=this.readByte(),l=this.readByte(),h=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^i)+4294967296*(255^s)+16777216*(255^a)+65536*(255^c)+256*(255^l)+(255^h)+1):72057594037927940*e+281474976710656*t+1099511627776*i+4294967296*s+16777216*a+65536*c+256*l+h},n.prototype.writeLongLong=function(e){var t,i;return t=Math.floor(e/4294967296),i=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},n.prototype.readInt=function(){return this.readInt32()},n.prototype.writeInt=function(e){return this.writeInt32(e)},n.prototype.read=function(e){var t,i;for(t=[],i=0;0<=e?ie;i=0<=e?++i:--i)t.push(this.readByte());return t},n.prototype.write=function(e){var t,i,s,a;for(a=[],i=0,s=e.length;ia;s=0<=a?++s:--s)i={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[i.tag]=i}return e.prototype.encode=function(t){var i,s,a,c,l,h,d,m,_,k,p,j,O;for(O in p=Object.keys(t).length,h=Math.log(2),_=16*Math.floor(Math.log(p)/h),c=Math.floor(_/h),m=16*p-_,(s=new ti).writeInt(this.scalarType),s.writeShort(p),s.writeShort(_),s.writeShort(c),s.writeShort(m),a=16*p,d=s.pos+a,l=null,j=[],t)for(k=t[O],s.writeString(O),s.writeInt(n(k)),s.writeInt(d),s.writeInt(k.length),j=j.concat(k),O==="head"&&(l=d),d+=k.length;d%4;)j.push(0),d++;return s.write(j),i=2981146554-n(s.data),s.pos=l+8,s.writeUInt32(i),s.data},n=function(t){var i,s,a,c;for(t=Df.call(t);t.length%4;)t.push(0);for(a=new ti(t),s=0,i=0,c=t.length;ik;h=0<=k?++q:--q)it.push(e.readUInt16());return it}(),e.pos+=2,O=function(){var q,it;for(it=[],h=q=0;0<=k?qk;h=0<=k?++q:--q)it.push(e.readUInt16());return it}(),d=function(){var q,it;for(it=[],h=q=0;0<=k?qk;h=0<=k?++q:--q)it.push(e.readUInt16());return it}(),m=function(){var q,it;for(it=[],h=q=0;0<=k?qk;h=0<=k?++q:--q)it.push(e.readUInt16());return it}(),s=(this.length-e.pos+this.offset)/2,l=function(){var q,it;for(it=[],h=q=0;0<=s?qs;h=0<=s?++q:--q)it.push(e.readUInt16());return it}(),h=S=0,G=a.length;S=M;i=j<=M?++V:--V)m[h]===0?c=i+d[h]:(c=l[m[h]/2+(i-j)-(k-h)]||0)!==0&&(c+=d[h]),this.codeMap[i]=65535&c}e.pos=_}return n.encode=function(e,t){var i,s,a,c,l,h,d,m,_,k,p,j,O,M,S,V,G,q,it,vt,dt,X,R,tt,N,E,z,U,rt,ot,ft,nt,ct,At,wt,x,B,T,H,J,Z,at,st,gt,_t,kt;switch(U=new ti,c=Object.keys(e).sort(function(St,Dt){return St-Dt}),t){case"macroman":for(O=0,M=function(){var St=[];for(j=0;j<256;++j)St.push(0);return St}(),V={0:0},a={},rt=0,ct=c.length;rt=32768)for(h.push(0),vt.push(2*(p.length+R-j)),s=nt=N;N<=m?nt<=m:nt>=m;s=N<=m?++nt:--nt)p.push(i[s].new);else h.push(z-N),vt.push(0)}for(U.writeUInt16(3),U.writeUInt16(1),U.writeUInt32(12),U.writeUInt16(4),U.writeUInt16(16+8*R+2*p.length),U.writeUInt16(0),U.writeUInt16(tt),U.writeUInt16(X),U.writeUInt16(k),U.writeUInt16(dt),Z=0,x=_.length;Zs;i=0<=s?++i:--i)t=new Yu(e,this.offset),this.tables.push(t),t.isUnicode&&this.unicode==null&&(this.unicode=t);return!0},n.encode=function(e,t){var i,s;return t==null&&(t="macroman"),i=Yu.encode(e,t),(s=new ti).writeUInt16(0),s.writeUInt16(1),i.table=s.data.concat(i.subtable),i},n}(),i2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="hhea",n.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},n}(),a2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="OS/2",n.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,i;for(i=[],t=0;t<10;++t)i.push(e.readByte());return i}(),this.charRange=function(){var t,i;for(i=[],t=0;t<4;++t)i.push(e.readInt());return i}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,i;for(i=[],t=0;t<2;t=++t)i.push(e.readInt());return i}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},n}(),s2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="post",n.prototype.parse=function(e){var t,i,s;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(i=e.readUInt16(),this.glyphNameIndex=[],a=0;0<=i?ai;a=0<=i?++a:--a)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],s=[];e.posl;a=0<=l?++c:--c)h.push(e.readUInt32());return h}).call(this)}},n}(),o2=function(n,e){this.raw=n,this.length=n.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},l2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="name",n.prototype.parse=function(e){var t,i,s,a,c,l,h,d,m,_,k;for(e.pos=this.offset,e.readShort(),t=e.readShort(),l=e.readShort(),i=[],a=0;0<=t?at;a=0<=t?++a:--a)i.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+l+e.readShort()});for(h={},a=m=0,_=i.length;m<_;a=++m)s=i[a],e.pos=s.offset,d=e.readString(s.length),c=new o2(d,s),h[k=s.nameID]==null&&(h[k]=[]),h[s.nameID].push(c);this.strings=h,this.copyright=h[0],this.fontFamily=h[1],this.fontSubfamily=h[2],this.uniqueSubfamily=h[3],this.fontName=h[4],this.version=h[5];try{this.postscriptName=h[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=h[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=h[7],this.manufacturer=h[8],this.designer=h[9],this.description=h[10],this.vendorUrl=h[11],this.designerUrl=h[12],this.license=h[13],this.licenseUrl=h[14],this.preferredFamily=h[15],this.preferredSubfamily=h[17],this.compatibleFull=h[18],this.sampleText=h[19]},n}(),u2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="maxp",n.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},n}(),f2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="hmtx",n.prototype.parse=function(e){var t,i,s,a,c,l,h;for(e.pos=this.offset,this.metrics=[],t=0,l=this.file.hhea.numberOfMetrics;0<=l?tl;t=0<=l?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(s=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var d,m;for(m=[],t=d=0;0<=s?ds;t=0<=s?++d:--d)m.push(e.readInt16());return m}(),this.widths=(function(){var d,m,_,k;for(k=[],d=0,m=(_=this.metrics).length;ds;t=0<=s?++c:--c)h.push(this.widths.push(i));return h},n.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},n}(),Df=[].slice,h2=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return mr(n,nr),n.prototype.tag="glyf",n.prototype.parse=function(){return this.cache={}},n.prototype.glyphFor=function(e){var t,i,s,a,c,l,h,d,m,_;return e in this.cache?this.cache[e]:(a=this.file.loca,t=this.file.contents,i=a.indexOf(e),(s=a.lengthOf(e))===0?this.cache[e]=null:(t.pos=this.offset+i,c=(l=new ti(t.read(s))).readShort(),d=l.readShort(),_=l.readShort(),h=l.readShort(),m=l.readShort(),this.cache[e]=c===-1?new d2(l,d,_,h,m):new c2(l,c,d,_,h,m),this.cache[e]))},n.prototype.encode=function(e,t,i){var s,a,c,l,h;for(c=[],a=[],l=0,h=t.length;l0&&(s+=h)}for(var d=new Array(4*i.length),m=0;m>8,d[4*m+1]=(16711680&i[m])>>16,d[4*m]=(4278190080&i[m])>>24;return d},n}(),g2=function(){function n(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return n.prototype.generateCmap=function(){var e,t,i,s,a;for(t in s=this.font.cmap.tables[0].codeMap,e={},a=this.subset)i=a[t],e[t]=s[i];return e},n.prototype.glyphsFor=function(e){var t,i,s,a,c,l,h;for(s={},c=0,l=e.length;c0)for(a in h=this.glyphsFor(t))i=h[a],s[a]=i;return s},n.prototype.encode=function(e,t){var i,s,a,c,l,h,d,m,_,k,p,j,O,M,S;for(s in i=Tf.encode(this.generateCmap(),"unicode"),c=this.glyphsFor(e),p={0:0},S=i.charMap)p[(h=S[s]).old]=h.new;for(j in k=i.maxGlyphID,c)j in p||(p[j]=k++);return m=function(V){var G,q;for(G in q={},V)q[V[G]]=G;return q}(p),_=Object.keys(m).sort(function(V,G){return V-G}),O=function(){var V,G,q;for(q=[],V=0,G=_.length;V>"),a.join(` -`)}return""+t},e}();const b2=Object.freeze(Object.defineProperty({__proto__:null,AcroForm:W1,AcroFormAppearance:It,AcroFormButton:rn,AcroFormCheckBox:ja,AcroFormChoiceField:_i,AcroFormComboBox:Ni,AcroFormEditBox:Ea,AcroFormListBox:Ai,AcroFormPasswordField:Ba,AcroFormPushButton:Oa,AcroFormRadioButton:Li,AcroFormTextField:Qr,GState:Ta,ShadingPattern:$r,TilingPattern:xi,default:Mt,jsPDF:Mt},Symbol.toStringTag,{value:"Module"}));export{_e as _,b2 as j}; diff --git a/dist/index.html b/dist/index.html index c5e4621..be91ff1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,11 @@ PAT Test Manager - - + + + + +
diff --git a/src/App.jsx b/src/App.jsx index 35bbfd3..877e682 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,18 +1,25 @@ -import React, { useEffect, useState } from 'react' +import React, { lazy, Suspense, useEffect, useState } from 'react' import { Moon, Sun } from 'lucide-react' -import PatTestManager from './components/PatTestManager' -import AuthPanel from './components/AuthPanel' import { supabase } from './lib/supabaseClient' -import Landing from './components/Landing' -import SharedAssessmentPage from './components/SharedAssessmentPage' -import PublicInfoPage from './components/public/PublicInfoPage' -import ProfileTab from './components/ProfileTab' import { useUserProfile } from './hooks/useUserProfile' import { getCountryLabel, getCountryOption } from './data/countries' import CountryFlag from './components/CountryFlag' import { LanguageProvider } from './i18n/LanguageContext' import { getTranslator } from './i18n/translations' +const PatTestManager = lazy(() => import('./components/PatTestManager')) +const AuthPanel = lazy(() => import('./components/AuthPanel')) +const Landing = lazy(() => import('./components/Landing')) +const SharedAssessmentPage = lazy(() => import('./components/SharedAssessmentPage')) +const PublicInfoPage = lazy(() => import('./components/public/PublicInfoPage')) +const ProfileTab = lazy(() => import('./components/ProfileTab')) + +const PageSpinner = () => ( +
+ Laden… +
+) + const readShareToken = () => { if (typeof window === 'undefined') return '' return new URLSearchParams(window.location.search).get('share') || '' @@ -156,7 +163,9 @@ function App() { if (shareToken) { return ( - + }> + + ) } @@ -197,7 +206,9 @@ function App() { if (showAuth) { return ( - setShowAuth(false)} /> + }> + setShowAuth(false)} /> + ) } @@ -205,23 +216,27 @@ function App() { if (publicPath === '/datenschutz' || publicPath === '/impressum' || publicPath === '/kontakt') { return ( - setShowAuth(true)} - onNavigate={navigatePublic} - themeToggle={renderThemeToggle()} - /> + }> + setShowAuth(true)} + onNavigate={navigatePublic} + themeToggle={renderThemeToggle()} + /> + ) } return ( - setShowAuth(true)} - onNavigate={navigatePublic} - themeToggle={renderThemeToggle()} - /> + }> + setShowAuth(true)} + onNavigate={navigatePublic} + themeToggle={renderThemeToggle()} + /> + ) } @@ -306,27 +321,29 @@ function App() { - {activeTab !== 'profile' && ( - - )} + }> + {activeTab !== 'profile' && ( + + )} - {activeTab === 'profile' && ( - - )} + {activeTab === 'profile' && ( + + )} + ) diff --git a/src/components/Analysis/RadarChart.jsx b/src/components/Analysis/RadarChart.jsx index 5a838df..5001947 100644 --- a/src/components/Analysis/RadarChart.jsx +++ b/src/components/Analysis/RadarChart.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useTranslation } from '../../i18n/LanguageContext'; const polarToCartesian = (centerX, centerY, radius, angle) => ({ x: centerX + radius * Math.cos(angle), @@ -8,12 +9,13 @@ const polarToCartesian = (centerX, centerY, radius, angle) => ({ const truncate = (value, maxLength = 16) => (value.length > maxLength ? `${value.slice(0, maxLength - 1)}…` : value); export default function RadarChart({ radarSeries = [] }) { + const t = useTranslation(); const data = radarSeries.slice(0, 6); if (!data.length) { return (
- Kein Radarprofil verfügbar. + {t('radar.no_data')}
); } @@ -40,8 +42,8 @@ export default function RadarChart({ radarSeries = [] }) { return (
-

Radar-Profil (Ist/Soll)

- +

{t('radar.title')}

+ {[0.25, 0.5, 0.75, 1].map((level) => ( - Für den Trend werden mindestens 2 Assessments benötigt. + {t('trend.no_data')}
); } @@ -35,8 +38,8 @@ export default function TrendChart({ trendSeries = [] }) { return (
-

Trend (Gesamtpunkte)

- +

{t('trend.title')}

+ diff --git a/src/components/PatDetail/PatDetail.jsx b/src/components/PatDetail/PatDetail.jsx index 2fe6469..3fb21fa 100644 --- a/src/components/PatDetail/PatDetail.jsx +++ b/src/components/PatDetail/PatDetail.jsx @@ -3,7 +3,8 @@ import { CheckCircle2, FileDown, Lock, Save, Share2 } from 'lucide-react'; import ExerciseInput from './ExerciseInput'; import SaveDialog from './SaveDialog'; import { downloadAssessmentPdf } from '../../utils/pdfExport'; -import { useTranslation } from '../../i18n/LanguageContext'; +import { useTranslation, useLanguage } from '../../i18n/LanguageContext'; +import { translateExerciseName } from '../../i18n/exerciseNames'; const PatDetail = ({ currentAssessment, @@ -32,11 +33,18 @@ const PatDetail = ({ onRevokeShare }) => { const t = useTranslation(); + const language = useLanguage(); if (!currentAssessment) return null; const totalPoints = calculateTotal(); const achievement = getAchievement(currentAssessment?.patType, totalPoints); + + const getAchievementName = (name) => { + if (name === 'Nicht bestanden') return t('achievement.not_passed'); + if (name.endsWith(' Teilnahme')) return name.replace(' Teilnahme', ` ${t('achievement.participation')}`); + return name; + }; const handleDownloadPdf = async () => { await downloadAssessmentPdf({ assessment: currentAssessment, @@ -104,7 +112,7 @@ const PatDetail = ({
-
{exercise.name}
+
{translateExerciseName(exercise.name, language)}
@@ -222,7 +230,7 @@ const PatDetail = ({
-

{achievement.name}

+

{getAchievementName(achievement.name)}

{achievement.subtitle &&

{achievement.subtitle}

}
diff --git a/src/components/PatList/PatList.jsx b/src/components/PatList/PatList.jsx index ce0e29e..5687bea 100644 --- a/src/components/PatList/PatList.jsx +++ b/src/components/PatList/PatList.jsx @@ -218,7 +218,7 @@ const PatList = ({

{title}

{t('patlist.count', { count: entries.length })} - {entries.length !== totalEntries ? ` von ${totalEntries}` : ''} + {entries.length !== totalEntries ? ` ${t('patlist.of')} ${totalEntries}` : ''}

diff --git a/src/components/PatTestManager.jsx b/src/components/PatTestManager.jsx index 6c348ac..1a1e529 100644 --- a/src/components/PatTestManager.jsx +++ b/src/components/PatTestManager.jsx @@ -1,8 +1,8 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import React, { lazy, Suspense, useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from '../i18n/LanguageContext'; import PatList from './PatList/PatList'; import PatDetail from './PatDetail/PatDetail'; -import AnalysisTab from './Analysis/AnalysisTab'; +const AnalysisTab = lazy(() => import('./Analysis/AnalysisTab')); import { patTypes } from '../data/patTypes'; import { useAssessments } from '../hooks/useAssessments'; import { getAchievement, getPatTypeColor } from '../utils/patCalculations'; @@ -309,13 +309,15 @@ export default function PatTestManager({ if (activeTab === 'analysis') { return ( - + Laden…}> + + ); } diff --git a/src/components/ProfileTab.jsx b/src/components/ProfileTab.jsx index 7fb38db..a380ba6 100644 --- a/src/components/ProfileTab.jsx +++ b/src/components/ProfileTab.jsx @@ -3,6 +3,7 @@ import { Check, ChevronDown } from 'lucide-react'; import { countryOptions, getCountryLabel, getCountryOption } from '../data/countries'; import CountryFlag from './CountryFlag'; import { useTranslation } from '../i18n/LanguageContext'; +import { getTranslator } from '../i18n/translations'; const emptyStatus = { message: '', @@ -81,6 +82,8 @@ export default function ProfileTab({ setStatus(emptyStatus); const result = await onSave(formValues); + // Nach dem Speichern in der neu gewählten Sprache übersetzen + const tNew = getTranslator(formValues.language); if (result?.ok) { if (result.session) { @@ -89,14 +92,14 @@ export default function ProfileTab({ setStatus({ message: result.emailUpdateRequested - ? t('profile.saved_email') - : t('profile.saved'), + ? tNew('profile.saved_email') + : tNew('profile.saved'), error: '' }); } else { setStatus({ message: '', - error: result?.error?.message || t('profile.error_save') + error: result?.error?.message || tNew('profile.error_save') }); } diff --git a/src/i18n/LanguageContext.jsx b/src/i18n/LanguageContext.jsx index a14f3a2..4d59520 100644 --- a/src/i18n/LanguageContext.jsx +++ b/src/i18n/LanguageContext.jsx @@ -1,18 +1,24 @@ import React, { createContext, useContext, useMemo } from 'react'; -import { getTranslator } from './translations'; +import { getTranslator, SUPPORTED_LANGUAGES } from './translations'; -const LanguageContext = createContext(() => (key) => key); +const LanguageContext = createContext({ t: (key) => key, language: 'de' }); export function LanguageProvider({ language, children }) { - const t = useMemo(() => getTranslator(language), [language]); + const lang = SUPPORTED_LANGUAGES.includes(language) ? language : 'de'; + const t = useMemo(() => getTranslator(lang), [lang]); + const value = useMemo(() => ({ t, language: lang }), [t, lang]); return ( - + {children} ); } export function useTranslation() { - return useContext(LanguageContext); + return useContext(LanguageContext).t; +} + +export function useLanguage() { + return useContext(LanguageContext).language; } diff --git a/src/i18n/exerciseNames.js b/src/i18n/exerciseNames.js new file mode 100644 index 0000000..eb59b93 --- /dev/null +++ b/src/i18n/exerciseNames.js @@ -0,0 +1,138 @@ +/** + * Übersetzungen für PAT-Übungsnamen. + * Der deutsche Name (wie er in der Datenbank steht) ist der Schlüssel. + */ +const exerciseNameMap = { + // ── PAT Start ────────────────────────────────────────────────────────────── + '1) Stoß-Geschwindigkeit': { + en: '1) Stroke Speed', + it: '1) Velocità del colpo', + es: '1) Velocidad del golpe', + pt: '1) Velocidade do golpe', + }, + '2) Stoß-Gradlinigkeit': { + en: '2) Stroke Straightness', + it: '2) Linearità del colpo', + es: '2) Linealidad del golpe', + pt: '2) Linearidade do golpe', + }, + '3) Winkelbälle': { + en: '3) Angle Balls', + it: '3) Palle angolate', + es: '3) Bolas en ángulo', + pt: '3) Bolas em ângulo', + }, + '4) Nachlauf Wirkung': { + en: '4) Follow-Through Effect', + it: '4) Effetto di seguita', + es: '4) Efecto de seguimiento', + pt: '4) Efeito de avanço', + }, + '5) Rücklauf-Wirkung': { + en: '5) Back Spin Effect', + it: '5) Effetto di ritorno', + es: '5) Efecto de retroceso', + pt: '5) Efeito de retorno', + }, + '6) Kl. Positions-Spiel': { + en: '6) Sm. Position Play', + it: '6) Pic. gioco di posizione', + es: '6) Peq. juego de posición', + pt: '6) Peq. jogo de posição', + }, + '7) Gr. Pos. Bereich': { + en: '7) Lg. Position Range', + it: '7) Gr. area di posizione', + es: '7) Gr. rango de posición', + pt: '7) Gr. área de posição', + }, + '8) Press Bande': { + en: '8) Cushion Press', + it: '8) Pressione sponda', + es: '8) Presión de banda', + pt: '8) Pressão de banda', + }, + '9) Standardbälle': { + en: '9) Standard Balls', + it: '9) Palle standard', + es: '9) Bolas estándar', + pt: '9) Bolas padrão', + }, + '10) 8-Ball Situation': { + en: '10) 8-Ball Situation', + it: '10) Situazione 8-Ball', + es: '10) Situación 8-Ball', + pt: '10) Situação 8-Ball', + }, + + // ── PAT 1 ────────────────────────────────────────────────────────────────── + '1) Geschwindigkeit': { + en: '1) Speed', + it: '1) Velocità', + es: '1) Velocidad', + pt: '1) Velocidade', + }, + '2) Geradlinigkeit (Speed 2)': { + en: '2) Straightness (Speed 2)', + it: '2) Linearità (Speed 2)', + es: '2) Linealidad (Speed 2)', + pt: '2) Linearidade (Speed 2)', + }, + '3) Nachlauf': { + en: '3) Follow-Through', + it: '3) Seguita', + es: '3) Seguimiento', + pt: '3) Avanço', + }, + '4) Rücklauf': { + en: '4) Back Spin', + it: '4) Effetto retro', + es: '4) Retroceso', + pt: '4) Retorno', + }, + '5) Kl. Pos.-Bereich': { + en: '5) Sm. Position Range', + it: '5) Pic. area di posizione', + es: '5) Peq. rango de posición', + pt: '5) Peq. área de posição', + }, + '6) Gr. Pos.-Bereich': { + en: '6) Lg. Position Range', + it: '6) Gr. area di posizione', + es: '6) Gr. rango de posición', + pt: '6) Gr. área de posição', + }, + '7) Press Bande': { + en: '7) Cushion Press', + it: '7) Pressione sponda', + es: '7) Presión de banda', + pt: '7) Pressão de banda', + }, + '8) Endlos-Übung (Max: 9)': { + en: '8) Continuous Exercise (Max: 9)', + it: '8) Esercizio continuo (Max: 9)', + es: '8) Ejercicio continuo (Máx: 9)', + pt: '8) Exercício contínuo (Máx: 9)', + }, + '9) Standardbälle': { + en: '9) Standard Balls', + it: '9) Palle standard', + es: '9) Bolas estándar', + pt: '9) Bolas padrão', + }, + '10) 9-Ball Situation 5': { + en: '10) 9-Ball Situation 5', + it: '10) Situazione 9-Ball 5', + es: '10) Situación 9-Ball 5', + pt: '10) Situação 9-Ball 5', + }, +}; + +/** + * Gibt den übersetzten Übungsnamen zurück. + * Fällt auf den deutschen Namen zurück, wenn keine Übersetzung vorhanden. + */ +export function translateExerciseName(germanName, language) { + if (!language || language === 'de') return germanName; + return exerciseNameMap[germanName]?.[language] ?? germanName; +} diff --git a/src/i18n/translations.js b/src/i18n/translations.js index 1b9836c..03c659c 100644 --- a/src/i18n/translations.js +++ b/src/i18n/translations.js @@ -112,6 +112,9 @@ const translations = { 'detail.col_factor': 'Faktor', 'detail.col_points': 'Points', 'detail.col_result': 'Ergebnis', + 'detail.finalize_title': 'Test final abschließen', + 'detail.share_title': 'Test als Link teilen', + 'patlist.of': 'von', // ── Speichern-Dialog ───────────────────────────────────────────────────── 'savedialog.title': 'Ungespeicherte Änderungen', @@ -182,6 +185,20 @@ const translations = { 'training.history': 'Plan-Historie', 'training.no_history': 'Keine archivierten Pläne vorhanden.', + // ── Ergebnis-Bewertungen ───────────────────────────────────────────────── + 'achievement.not_passed': 'Nicht bestanden', + 'achievement.participation': 'Teilnahme', + + // ── Radar-Chart ────────────────────────────────────────────────────────── + 'radar.no_data': 'Kein Radarprofil verfügbar.', + 'radar.title': 'Radar-Profil (Ist/Soll)', + 'radar.aria': 'Radarprofil', + + // ── Trend-Chart ────────────────────────────────────────────────────────── + 'trend.no_data': 'Für den Trend werden mindestens 2 Assessments benötigt.', + 'trend.title': 'Trend (Gesamtpunkte)', + 'trend.aria': 'Trenddiagramm', + // ── Gap-Chart ──────────────────────────────────────────────────────────── 'gapchart.no_data': 'Kein Gap-Chart verfügbar.', 'gapchart.title': 'Gap-Bar-Chart (Priorität)', @@ -347,6 +364,9 @@ const translations = { 'detail.col_factor': 'Factor', 'detail.col_points': 'Points', 'detail.col_result': 'Result', + 'detail.finalize_title': 'Finalize test', + 'detail.share_title': 'Share test as link', + 'patlist.of': 'of', 'savedialog.title': 'Unsaved changes', 'savedialog.message': 'You have unsaved changes. Would you like to save them?', @@ -412,6 +432,14 @@ const translations = { 'training.history': 'Plan history', 'training.no_history': 'No archived plans available.', + 'achievement.not_passed': 'Not passed', + 'achievement.participation': 'Participation', + 'radar.no_data': 'No radar profile available.', + 'radar.title': 'Radar Profile (Actual/Target)', + 'radar.aria': 'Radar profile', + 'trend.no_data': 'At least 2 assessments are needed for the trend.', + 'trend.title': 'Trend (Total points)', + 'trend.aria': 'Trend chart', 'gapchart.no_data': 'No gap chart available.', 'gapchart.title': 'Gap Bar Chart (Priority)', 'gapchart.aria': 'Gap bar chart', @@ -573,6 +601,9 @@ const translations = { 'detail.col_factor': 'Fattore', 'detail.col_points': 'Punti', 'detail.col_result': 'Risultato', + 'detail.finalize_title': 'Finalizza il test', + 'detail.share_title': 'Condividi il test come link', + 'patlist.of': 'di', 'savedialog.title': 'Modifiche non salvate', 'savedialog.message': 'Hai modifiche non salvate. Vuoi salvarle?', @@ -638,6 +669,14 @@ const translations = { 'training.history': 'Cronologia piani', 'training.no_history': 'Nessun piano archiviato disponibile.', + 'achievement.not_passed': 'Non superato', + 'achievement.participation': 'Partecipazione', + 'radar.no_data': 'Nessun profilo radar disponibile.', + 'radar.title': 'Profilo Radar (Effettivo/Obiettivo)', + 'radar.aria': 'Profilo radar', + 'trend.no_data': 'Sono necessari almeno 2 assessment per il trend.', + 'trend.title': 'Trend (Punti totali)', + 'trend.aria': 'Grafico trend', 'gapchart.no_data': 'Nessun grafico gap disponibile.', 'gapchart.title': 'Grafico Gap (Priorità)', 'gapchart.aria': 'Grafico a barre gap', @@ -799,6 +838,9 @@ const translations = { 'detail.col_factor': 'Factor', 'detail.col_points': 'Puntos', 'detail.col_result': 'Resultado', + 'detail.finalize_title': 'Finalizar test', + 'detail.share_title': 'Compartir test como enlace', + 'patlist.of': 'de', 'savedialog.title': 'Cambios sin guardar', 'savedialog.message': 'Tienes cambios sin guardar. ¿Deseas guardarlos?', @@ -864,6 +906,14 @@ const translations = { 'training.history': 'Historial de planes', 'training.no_history': 'No hay planes archivados disponibles.', + 'achievement.not_passed': 'No aprobado', + 'achievement.participation': 'Participación', + 'radar.no_data': 'No hay perfil radar disponible.', + 'radar.title': 'Perfil Radar (Real/Objetivo)', + 'radar.aria': 'Perfil radar', + 'trend.no_data': 'Se necesitan al menos 2 evaluaciones para la tendencia.', + 'trend.title': 'Tendencia (Puntos totales)', + 'trend.aria': 'Gráfico de tendencia', 'gapchart.no_data': 'No hay gráfico de gap disponible.', 'gapchart.title': 'Gráfico de Gap (Prioridad)', 'gapchart.aria': 'Gráfico de barras de gap', @@ -1025,6 +1075,9 @@ const translations = { 'detail.col_factor': 'Fator', 'detail.col_points': 'Pontos', 'detail.col_result': 'Resultado', + 'detail.finalize_title': 'Finalizar teste', + 'detail.share_title': 'Partilhar teste como link', + 'patlist.of': 'de', 'savedialog.title': 'Alterações não guardadas', 'savedialog.message': 'Tem alterações não guardadas. Deseja guardá-las?', @@ -1090,6 +1143,14 @@ const translations = { 'training.history': 'Histórico de planos', 'training.no_history': 'Sem planos arquivados disponíveis.', + 'achievement.not_passed': 'Não aprovado', + 'achievement.participation': 'Participação', + 'radar.no_data': 'Sem perfil radar disponível.', + 'radar.title': 'Perfil Radar (Real/Objetivo)', + 'radar.aria': 'Perfil radar', + 'trend.no_data': 'São necessárias pelo menos 2 avaliações para a tendência.', + 'trend.title': 'Tendência (Pontos totais)', + 'trend.aria': 'Gráfico de tendência', 'gapchart.no_data': 'Sem gráfico de gap disponível.', 'gapchart.title': 'Gráfico de Gap (Prioridade)', 'gapchart.aria': 'Gráfico de barras de gap', diff --git a/vite.config.js b/vite.config.js index 401c393..3d0440c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,19 @@ import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], + build: { + chunkSizeWarningLimit: 600, + rollupOptions: { + output: { + manualChunks: { + 'vendor-react': ['react', 'react-dom'], + 'vendor-supabase': ['@supabase/supabase-js'], + 'vendor-ui': ['lucide-react', 'country-flag-icons'], + 'vendor-xlsx': ['xlsx'], + }, + }, + }, + }, test: { environment: 'node', include: ['src/**/*.test.{js,jsx}']